Update to 1.15.2
This commit is contained in:
@@ -13,31 +13,31 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class GuiButtonItem extends GuiButtonBase
|
||||
{
|
||||
private final ItemStack stack;
|
||||
private final ItemStack stack;
|
||||
|
||||
public GuiButtonItem(int x, int y, int width, int height, Item item, ActionHandler actionHandler)
|
||||
{
|
||||
this(x, y, width, height, new ItemStack(item), actionHandler);
|
||||
}
|
||||
|
||||
public GuiButtonItem(int x, int y, int width, int height, ItemStack stack, ActionHandler actionHandler)
|
||||
{
|
||||
super(x, y, width, height, stack.getTextComponent().getString(), actionHandler);
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderButton(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
super.renderBg(Minecraft.getInstance(), mouseX, mouseY);
|
||||
|
||||
RenderSystem.enableRescaleNormal();
|
||||
RenderHelper.func_227784_d_();
|
||||
|
||||
public GuiButtonItem(int x, int y, int width, int height, Item item, ActionHandler actionHandler)
|
||||
{
|
||||
this(x, y, width, height, new ItemStack(item), actionHandler);
|
||||
}
|
||||
|
||||
public GuiButtonItem(int x, int y, int width, int height, ItemStack stack, ActionHandler actionHandler)
|
||||
{
|
||||
super(x, y, width, height, stack.getTextComponent().getString(), actionHandler);
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderButton(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
super.renderBg(Minecraft.getInstance(), mouseX, mouseY);
|
||||
|
||||
RenderSystem.enableRescaleNormal();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(this.stack, this.x + this.width / 2 - 8, this.y + 2);
|
||||
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
RenderSystem.disableRescaleNormal();
|
||||
RenderSystem.enableAlphaTest();
|
||||
}
|
||||
RenderSystem.disableRescaleNormal();
|
||||
RenderSystem.enableAlphaTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,12 +46,12 @@ public class GuiButtonList<T> extends GuiButtonTooltip
|
||||
String leftArrow = this.isHoveringLeft(mouseX, mouseY) ? TextFormatting.BOLD + "<" + TextFormatting.RESET : "<";
|
||||
String rightArrow = this.isHoveringRight(mouseX, mouseY) ? TextFormatting.BOLD + ">" + TextFormatting.RESET : ">";
|
||||
|
||||
int maxWidth = Math.max(0, this.width - fontRenderer.getStringWidth("< >"));
|
||||
int spaceWidth = fontRenderer.getStringWidth(" ");
|
||||
|
||||
String display = exopandora.worldhandler.util.TextFormatting.shortenString(this.getMessage(), maxWidth, fontRenderer);
|
||||
int yPos = this.y + (this.height - 8) / 2;
|
||||
|
||||
int maxWidth = Math.max(0, this.width - fontRenderer.getStringWidth("< >"));
|
||||
int spaceWidth = fontRenderer.getStringWidth(" ");
|
||||
|
||||
String display = exopandora.worldhandler.util.TextFormatting.shortenString(this.getMessage(), maxWidth, fontRenderer);
|
||||
int yPos = this.y + (this.height - 8) / 2;
|
||||
|
||||
this.drawCenteredString(fontRenderer, display, this.x + this.width / 2, yPos, this.getFGColor());
|
||||
this.drawCenteredString(fontRenderer, leftArrow, this.x + this.width / 2 - maxWidth / 2 - spaceWidth, yPos, this.getFGColor());
|
||||
this.drawCenteredString(fontRenderer, rightArrow, this.x + this.width / 2 + maxWidth / 2 + spaceWidth, yPos, this.getFGColor());
|
||||
|
||||
@@ -13,15 +13,15 @@ public abstract class GuiButtonTab extends AbstractButton
|
||||
super(x, y, widthIn, heightIn, narration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playDownSound(SoundHandler soundHandlerIn)
|
||||
{
|
||||
|
||||
}
|
||||
@Override
|
||||
public void render(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playDownSound(SoundHandler soundHandlerIn)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import exopandora.worldhandler.util.ActionHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.client.config.GuiUtils;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class GuiButtonTooltip extends GuiButtonBase
|
||||
|
||||
@@ -31,8 +31,8 @@ public class GuiTextFieldTooltip extends TextFieldWidget
|
||||
if(this.getVisible() && !this.isFocused() && this.tooltip != null && TextFormatting.getTextWithoutFormattingCodes(this.getText()).isEmpty())
|
||||
{
|
||||
boolean enableBackgroundDrawing = this.getAdjustedWidth() != this.width;
|
||||
int tx = enableBackgroundDrawing ? this.x + 4 : this.x;
|
||||
int ty = enableBackgroundDrawing ? this.y + (this.height - 8) / 2 : this.y;
|
||||
int tx = enableBackgroundDrawing ? this.x + 4 : this.x;
|
||||
int ty = enableBackgroundDrawing ? this.y + (this.height - 8) / 2 : this.y;
|
||||
|
||||
Minecraft.getInstance().fontRenderer.drawStringWithShadow(this.tooltip, (float) tx, (float) ty, 0x7F7F7F);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.client.config.GuiUtils;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class GuiWorldHandler extends Container
|
||||
@@ -380,7 +380,7 @@ public class GuiWorldHandler extends Container
|
||||
if(this.splash != null)
|
||||
{
|
||||
RenderSystem.pushMatrix();
|
||||
RenderHelper.func_227784_d_();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
RenderSystem.disableLighting();
|
||||
RenderSystem.translatef((float) (backgroundX + 212), backgroundY + 15, 0.0F);
|
||||
RenderSystem.rotatef(17.0F, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.client.gui.screen.ConnectingScreen;
|
||||
import net.minecraft.client.gui.screen.DirtMessageScreen;
|
||||
import net.minecraft.client.gui.screen.MainMenuScreen;
|
||||
import net.minecraft.client.gui.screen.MultiplayerScreen;
|
||||
import net.minecraft.client.gui.screen.MultiplayerWarningScreen;
|
||||
import net.minecraft.client.gui.screen.WorldSelectionScreen;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
@@ -39,7 +40,16 @@ public class ContentChangeWorld extends ContentChild
|
||||
container.add(new GuiButtonBase(x + 116 / 2, y + 48, 232 / 2, 20, I18n.format("gui.worldhandler.change_world.multiplayer"), () ->
|
||||
{
|
||||
Connection connection = ContentChangeWorld.disconnect();
|
||||
Minecraft.getInstance().displayGuiScreen(new MultiplayerScreen(new DummyScreen(() -> ContentChangeWorld.reconnect(connection))));
|
||||
DummyScreen dummy = new DummyScreen(() -> ContentChangeWorld.reconnect(connection));
|
||||
|
||||
if(Minecraft.getInstance().gameSettings.field_230152_Z_)
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new MultiplayerScreen(dummy));
|
||||
}
|
||||
else
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new MultiplayerWarningScreen(dummy));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -55,13 +65,13 @@ public class ContentChangeWorld extends ContentChild
|
||||
String folderName = Minecraft.getInstance().getIntegratedServer().getFolderName();
|
||||
|
||||
Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
|
||||
Minecraft.getInstance().func_213231_b(new DirtMessageScreen(new TranslationTextComponent("menu.savingLevel")));
|
||||
Minecraft.getInstance().unloadWorld(new DirtMessageScreen(new TranslationTextComponent("menu.savingLevel")));
|
||||
|
||||
return new IntegratedConnection(Type.INTEGRATED, worldName, folderName);
|
||||
}
|
||||
|
||||
Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
|
||||
Minecraft.getInstance().func_213254_o();
|
||||
Minecraft.getInstance().unloadWorld();
|
||||
|
||||
if(isRealms)
|
||||
{
|
||||
|
||||
@@ -63,12 +63,12 @@ public class ContentGamerules extends Content
|
||||
|
||||
Map<String, ArgumentType<?>> map = new HashMap<String, ArgumentType<?>>();
|
||||
|
||||
GameRules.func_223590_a(new IRuleEntryVisitor()
|
||||
GameRules.visitAll(new IRuleEntryVisitor()
|
||||
{
|
||||
@Override
|
||||
public <T extends RuleValue<T>> void func_223481_a(RuleKey<T> rule, RuleType<T> type)
|
||||
public <T extends RuleValue<T>> void visit(RuleKey<T> rule, RuleType<T> type)
|
||||
{
|
||||
map.put(rule.func_223576_a(), type.func_223581_a(null).getType());
|
||||
map.put(rule.getName(), type.createArgument(null).getType());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ public class ContentNoteEditor extends Content
|
||||
|
||||
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.pushMatrix();
|
||||
RenderHelper.func_227784_d_();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
RenderSystem.translatef(container.width / 2 - 8 * scale, container.height / 2 - 15 - 8 * scale, 0);
|
||||
RenderSystem.scalef(scale, scale, scale);
|
||||
|
||||
@@ -115,9 +115,9 @@ public class ContentPlayer extends Content
|
||||
|
||||
container.add(new GuiButtonBase(x + 118, y + 72, 114, 20, I18n.format("gui.worldhandler.entities.player.position.copy_position"), () ->
|
||||
{
|
||||
int posX = MathHelper.floor(Minecraft.getInstance().player.func_226277_ct_());
|
||||
int posY = MathHelper.floor(Minecraft.getInstance().player.func_226278_cu_());
|
||||
int posZ = MathHelper.floor(Minecraft.getInstance().player.func_226281_cx_());
|
||||
int posX = MathHelper.floor(Minecraft.getInstance().player.getPosX());
|
||||
int posY = MathHelper.floor(Minecraft.getInstance().player.getPosY());
|
||||
int posZ = MathHelper.floor(Minecraft.getInstance().player.getPosZ());
|
||||
|
||||
Minecraft.getInstance().keyboardListener.setClipboardString(posX + " " + posY + " " + posZ);
|
||||
}));
|
||||
@@ -148,9 +148,9 @@ public class ContentPlayer extends Content
|
||||
@Override
|
||||
public void tick(Container container)
|
||||
{
|
||||
this.posXField.setText("X: " + MathHelper.floor(Minecraft.getInstance().player.func_226277_ct_()));
|
||||
this.posYField.setText("Y: " + MathHelper.floor(Minecraft.getInstance().player.func_226278_cu_()));
|
||||
this.posZField.setText("Z: " + MathHelper.floor(Minecraft.getInstance().player.func_226281_cx_()));
|
||||
this.posXField.setText("X: " + MathHelper.floor(Minecraft.getInstance().player.getPosX()));
|
||||
this.posYField.setText("Y: " + MathHelper.floor(Minecraft.getInstance().player.getPosY()));
|
||||
this.posZField.setText("Z: " + MathHelper.floor(Minecraft.getInstance().player.getPosZ()));
|
||||
this.scoreField.setText(I18n.format("gui.worldhandler.entities.player.score") + ": " + Minecraft.getInstance().player.getScore());
|
||||
this.coinsField.setText(I18n.format("gui.worldhandler.entities.player.score.experience") + ": " + Minecraft.getInstance().player.experienceLevel + "L");
|
||||
this.xpField.setText(I18n.format("gui.worldhandler.entities.player.score.experience_coins") + ": " + Minecraft.getInstance().player.experienceTotal);
|
||||
|
||||
@@ -177,17 +177,17 @@ public class ContentSignEditor extends Content
|
||||
}
|
||||
else
|
||||
{
|
||||
float scale = 4;
|
||||
float scale = 4;
|
||||
|
||||
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.pushMatrix();
|
||||
RenderHelper.func_227784_d_();
|
||||
|
||||
RenderSystem.translatef(container.width / 2 - 8.5F * scale, container.height / 2 - 15 - 8.5F * scale, 0);
|
||||
RenderSystem.scalef(scale, scale, scale);
|
||||
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(new ItemStack(Items.OAK_SIGN), 0, 0);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
RenderSystem.translatef(container.width / 2 - 8.5F * scale, container.height / 2 - 15 - 8.5F * scale, 0);
|
||||
RenderSystem.scalef(scale, scale, scale);
|
||||
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(new ItemStack(Items.OAK_SIGN), 0, 0);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
String displayString = I18n.format("gui.worldhandler.blocks.sign_editor.look_at_sign", KeyHandler.KEY_WORLD_HANDLER.getLocalizedName());
|
||||
|
||||
Reference in New Issue
Block a user