Update to 1.16.2
This commit is contained in:
@@ -12,7 +12,7 @@ public class Main
|
||||
{
|
||||
public static final String NAME = "World Handler";
|
||||
public static final String MODID = "worldhandler";
|
||||
public static final String MC_VERSION = "1.16.1";
|
||||
public static final String MC_VERSION = "1.16.2";
|
||||
public static final String MOD_VERSION = "2.11.1";
|
||||
public static final String URL = "https://minecraft.curseforge.com/projects/world-handler-command-gui";
|
||||
|
||||
|
||||
@@ -492,7 +492,7 @@ public class BuilderSummon extends CommandBuilderNBT
|
||||
}
|
||||
else if(entity.equalsIgnoreCase("Pigman") || entity.equalsIgnoreCase("ZombiePig") || entity.equalsIgnoreCase("ZombiePigman"))
|
||||
{
|
||||
return EntityType.field_233592_ba_.getRegistryName();
|
||||
return EntityType.PIGLIN.getRegistryName();
|
||||
}
|
||||
else if(entity.equalsIgnoreCase("Wither"))
|
||||
{
|
||||
|
||||
@@ -72,7 +72,7 @@ public class BlockResourceLocation extends ItemResourceLocation
|
||||
|
||||
public <T extends Comparable<T>> void setProperty(Property<T> property, T value)
|
||||
{
|
||||
if(this.state != null && this.state.func_235901_b_(property)) //has
|
||||
if(this.state != null && this.state.hasProperty(property))
|
||||
{
|
||||
this.state = this.state.with(property, value);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class ConfigCategorySettings
|
||||
.define("permission_query", true);
|
||||
this.highlightBlocks = builder
|
||||
.translation("gui.worldhandler.config.settings.highlight_blocks")
|
||||
.comment("Whether or not selected blocks will be highlighted")
|
||||
.comment("Whether or not selected blocks will be highlighted (Incompatible with fabolous graphics)")
|
||||
.define("highlight_blocks", true);
|
||||
|
||||
this.dawn = builder
|
||||
|
||||
@@ -8,11 +8,11 @@ import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
|
||||
import exopandora.worldhandler.config.Config;
|
||||
import exopandora.worldhandler.render.CustomRenderType;
|
||||
import exopandora.worldhandler.util.BlockHelper;
|
||||
import exopandora.worldhandler.util.CommandHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
@@ -50,11 +50,36 @@ public class ClientEventHandler
|
||||
matrix.translate(-projected.getX(), -projected.getY(), -projected.getZ());
|
||||
|
||||
IRenderTypeBuffer.Impl buffer = Minecraft.getInstance().getRenderTypeBuffers().getBufferSource();
|
||||
IVertexBuilder builder = buffer.getBuffer(CustomRenderType.LINES2);
|
||||
IVertexBuilder builder = buffer.getBuffer(RenderType.getLines());
|
||||
|
||||
WorldRenderer.drawBoundingBox(matrix, builder, minX, minY, minZ, maxX, maxY, maxZ, 0.9F, 0.9F, 0.9F, 1.0F, 0.5F, 0.5F, 0.5F);
|
||||
|
||||
buffer.finish(CustomRenderType.LINES2);
|
||||
buffer.finish(RenderType.getLines());
|
||||
buffer.finish();
|
||||
|
||||
// try
|
||||
// {
|
||||
// Field field_239227_K_ = WorldRenderer.class.getDeclaredField("field_239227_K_");
|
||||
// field_239227_K_.setAccessible(true);
|
||||
// ShaderGroup shader = (ShaderGroup) field_239227_K_.get(event.getContext());
|
||||
//
|
||||
// if(shader != null)
|
||||
// {
|
||||
// Field field_241712_U_ = RenderState.class.getDeclaredField("field_241712_U_");
|
||||
// field_241712_U_.setAccessible(true);
|
||||
// RenderState.TargetState target = (RenderState.TargetState) field_241712_U_.get(null);
|
||||
// target.setupRenderState();
|
||||
// event.getContext().func_239229_r_().framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
|
||||
// event.getContext().func_239229_r_().func_237506_a_(Minecraft.getInstance().getFramebuffer());
|
||||
// Minecraft.getInstance().getFramebuffer().bindFramebuffer(false);
|
||||
// target.clearRenderState();
|
||||
// }
|
||||
// }
|
||||
// catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
matrix.pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class DummyScreen extends Screen
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void func_231160_c_()
|
||||
protected void init()
|
||||
{
|
||||
this.runnable.run();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import exopandora.worldhandler.util.ActionHelper;
|
||||
import exopandora.worldhandler.util.RenderUtils;
|
||||
import exopandora.worldhandler.util.ResourceHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -23,41 +24,41 @@ public class GuiButtonBase extends Button
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230431_b_(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) //renderButton
|
||||
public void renderButton(MatrixStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
this.func_230441_a_(matrix, Minecraft.getInstance(), mouseX, mouseY); //renderBg
|
||||
this.func_238472_a_(matrix, Minecraft.getInstance().fontRenderer, this.func_230458_i_(), this.field_230690_l_ + this.field_230688_j_ / 2, this.field_230691_m_ + (this.field_230689_k_ - 8) / 2, this.getFGColor()); //drawCenteredString
|
||||
this.renderBg(matrix, Minecraft.getInstance(), mouseX, mouseY);
|
||||
AbstractGui.drawCenteredString(matrix, Minecraft.getInstance().fontRenderer, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, this.getFGColor());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void func_230441_a_(MatrixStack matrix, Minecraft minecraft, int mouseX, int mouseY) //renderBg
|
||||
protected void renderBg(MatrixStack matrix, Minecraft minecraft, int mouseX, int mouseY)
|
||||
{
|
||||
RenderSystem.enableBlend();
|
||||
RenderUtils.color(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF());
|
||||
|
||||
int hovered = this.func_230989_a_(this.func_230449_g_());
|
||||
int hovered = this.getYImage(this.isHovered());
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getButtonTexture());
|
||||
|
||||
int hWidth = this.field_230688_j_ / 2;
|
||||
int hHeight = this.field_230689_k_ / 2;
|
||||
int hWidth = this.width / 2;
|
||||
int hHeight = this.height / 2;
|
||||
|
||||
if(Config.getSkin().getTextureType().equals("resourcepack"))
|
||||
{
|
||||
int textureOffset = 46 + hovered * 20;
|
||||
|
||||
this.func_238474_b_(matrix, this.field_230690_l_, this.field_230691_m_, 0, textureOffset, hWidth, hHeight); //blit
|
||||
this.func_238474_b_(matrix, this.field_230690_l_, this.field_230691_m_ + hHeight, 0, textureOffset + 20 - hHeight, hWidth, hHeight); //blit
|
||||
this.func_238474_b_(matrix, this.field_230690_l_ + hWidth, this.field_230691_m_, 200 - hWidth, textureOffset, hWidth, hHeight); //blit
|
||||
this.func_238474_b_(matrix, this.field_230690_l_ + hWidth, this.field_230691_m_ + hHeight, 200 - hWidth, textureOffset + 20 - hHeight, hWidth, hHeight); //blit
|
||||
this.blit(matrix, this.x, this.y, 0, textureOffset, hWidth, hHeight);
|
||||
this.blit(matrix, this.x, this.y + hHeight, 0, textureOffset + 20 - hHeight, hWidth, hHeight);
|
||||
this.blit(matrix, this.x + hWidth, this.y, 200 - hWidth, textureOffset, hWidth, hHeight);
|
||||
this.blit(matrix, this.x + hWidth, this.y + hHeight, 200 - hWidth, textureOffset + 20 - hHeight, hWidth, hHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
int textureOffset = hovered * 20;
|
||||
|
||||
this.func_238474_b_(matrix, this.field_230690_l_, this.field_230691_m_, 0, textureOffset, hWidth, hHeight); //blit
|
||||
this.func_238474_b_(matrix, this.field_230690_l_, this.field_230691_m_ + hHeight, 0, textureOffset + 20 - hHeight, hWidth, hHeight); //blit
|
||||
this.func_238474_b_(matrix, this.field_230690_l_ + hWidth, this.field_230691_m_, 200 - hWidth, textureOffset, this.field_230688_j_ / 2, hHeight); //blit
|
||||
this.func_238474_b_(matrix, this.field_230690_l_ + hWidth, this.field_230691_m_ + hHeight, 200 - hWidth, textureOffset + 20 - hHeight, hWidth, hHeight); //blit
|
||||
this.blit(matrix, this.x, this.y, 0, textureOffset, hWidth, hHeight);
|
||||
this.blit(matrix, this.x, this.y + hHeight, 0, textureOffset + 20 - hHeight, hWidth, hHeight);
|
||||
this.blit(matrix, this.x + hWidth, this.y, 200 - hWidth, textureOffset, this.width / 2, hHeight);
|
||||
this.blit(matrix, this.x + hWidth, this.y + hHeight, 200 - hWidth, textureOffset + 20 - hHeight, hWidth, hHeight);
|
||||
}
|
||||
|
||||
RenderSystem.disableBlend();
|
||||
|
||||
@@ -22,9 +22,9 @@ public class GuiButtonIcon extends GuiButtonTooltip
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230431_b_(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) //renderButton
|
||||
public void renderButton(MatrixStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
super.func_230441_a_(matrix, Minecraft.getInstance(), mouseX, mouseY); //renderBg
|
||||
super.renderBg(matrix, Minecraft.getInstance(), mouseX, mouseY);
|
||||
|
||||
if(this.icon != null)
|
||||
{
|
||||
@@ -36,7 +36,7 @@ public class GuiButtonIcon extends GuiButtonTooltip
|
||||
{
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getIconTexture());
|
||||
|
||||
if(this.field_230693_o_)
|
||||
if(this.active)
|
||||
{
|
||||
RenderUtils.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
@@ -45,6 +45,6 @@ public class GuiButtonIcon extends GuiButtonTooltip
|
||||
RenderUtils.color(0.8F, 0.8F, 0.8F, 1.0F);
|
||||
}
|
||||
|
||||
this.func_238474_b_(matrix, this.field_230690_l_ + this.field_230688_j_ / 2 - 4, this.field_230691_m_ + this.field_230689_k_ / 2 - 4, this.icon.getX() * 8, this.icon.getY() * 8, 8, 8); //blit
|
||||
this.blit(matrix, this.x + this.width / 2 - 4, this.y + this.height / 2 - 4, this.icon.getX() * 8, this.icon.getY() * 8, 8, 8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@ public class GuiButtonItem extends GuiButtonBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230431_b_(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) //renderButton
|
||||
public void renderButton(MatrixStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
super.func_230441_a_(matrix, Minecraft.getInstance(), mouseX, mouseY); //renderBg
|
||||
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(this.stack, this.field_230690_l_ + this.field_230688_j_ / 2 - 8, this.field_230691_m_ + 2);
|
||||
super.renderBg(matrix, Minecraft.getInstance(), mouseX, mouseY);
|
||||
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(this.stack, this.x + this.width / 2 - 8, this.y + 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import exopandora.worldhandler.gui.container.Container;
|
||||
import exopandora.worldhandler.gui.menu.impl.ILogicMapped;
|
||||
import exopandora.worldhandler.util.TextUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.util.text.IFormattableTextComponent;
|
||||
@@ -25,7 +26,7 @@ public class GuiButtonList<T> extends GuiButtonTooltip
|
||||
|
||||
public GuiButtonList(int x, int y, List<T> items, int widthIn, int heightIn, Container container, ILogicMapped<T> logic)
|
||||
{
|
||||
super(x, y, widthIn, heightIn, StringTextComponent.field_240750_d_, null, null);
|
||||
super(x, y, widthIn, heightIn, StringTextComponent.EMPTY, null, null);
|
||||
this.items = items;
|
||||
this.logic = logic;
|
||||
this.persistence = container.getContent().getPersistence(this.logic.getId(), Persistence::new);
|
||||
@@ -39,46 +40,46 @@ public class GuiButtonList<T> extends GuiButtonTooltip
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230431_b_(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) //renderButton
|
||||
public void renderButton(MatrixStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
this.func_230441_a_(matrix, Minecraft.getInstance(), mouseX, mouseY); //renderBg
|
||||
this.renderBg(matrix, Minecraft.getInstance(), mouseX, mouseY);
|
||||
this.updateMessage();
|
||||
|
||||
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
|
||||
|
||||
if(this.func_230458_i_() != null && !this.func_230458_i_().getString().isEmpty())
|
||||
if(this.getMessage() != null && !this.getMessage().getString().isEmpty())
|
||||
{
|
||||
ITextComponent leftArrow = this.isHoveringLeft(mouseX, mouseY) ? TextUtils.ARROW_LEFT_BOLD : TextUtils.ARROW_LEFT;
|
||||
ITextComponent rightArrow = this.isHoveringRight(mouseX, mouseY) ? TextUtils.ARROW_RIGHT_BOLD : TextUtils.ARROW_RIGHT;
|
||||
|
||||
int maxWidth = Math.max(0, this.field_230688_j_ - fontRenderer.getStringWidth("< >"));
|
||||
int maxWidth = Math.max(0, this.width - fontRenderer.getStringWidth("< >"));
|
||||
int spaceWidth = fontRenderer.getStringWidth(" ");
|
||||
|
||||
ITextComponent display = TextUtils.stripText((IFormattableTextComponent) this.func_230458_i_(), maxWidth, fontRenderer);
|
||||
int yPos = this.field_230691_m_ + (this.field_230689_k_ - 8) / 2;
|
||||
ITextComponent display = TextUtils.stripText((IFormattableTextComponent) this.getMessage(), maxWidth, fontRenderer);
|
||||
int yPos = this.y + (this.height - 8) / 2;
|
||||
|
||||
this.func_238472_a_(matrix, fontRenderer, display, this.field_230690_l_ + this.field_230688_j_ / 2, yPos, this.getFGColor());
|
||||
this.func_238472_a_(matrix, fontRenderer, leftArrow, this.field_230690_l_ + this.field_230688_j_ / 2 - maxWidth / 2 - spaceWidth, yPos, this.getFGColor());
|
||||
this.func_238472_a_(matrix, fontRenderer, rightArrow, this.field_230690_l_ + this.field_230688_j_ / 2 + maxWidth / 2 + spaceWidth, yPos, this.getFGColor());
|
||||
AbstractGui.drawCenteredString(matrix, fontRenderer, display, this.x + this.width / 2, yPos, this.getFGColor());
|
||||
AbstractGui.drawCenteredString(matrix, fontRenderer, leftArrow, this.x + this.width / 2 - maxWidth / 2 - spaceWidth, yPos, this.getFGColor());
|
||||
AbstractGui.drawCenteredString(matrix, fontRenderer, rightArrow, this.x + this.width / 2 + maxWidth / 2 + spaceWidth, yPos, this.getFGColor());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTooltip(MatrixStack matrix, int mouseX, int mouseY)
|
||||
public void renderTooltip(Screen screen, MatrixStack matrix, int mouseX, int mouseY)
|
||||
{
|
||||
this.tooltip = this.logic.formatTooltip(this.items.get(this.persistence.getIndex()), this.persistence.getIndex() + 1, this.items.size());
|
||||
super.renderTooltip(matrix, mouseX, mouseY);
|
||||
super.renderTooltip(screen, matrix, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230982_a_(double mouseX, double mouseY) //onClick
|
||||
public void onClick(double mouseX, double mouseY)
|
||||
{
|
||||
int max = this.items.size() - 1;
|
||||
int index = this.persistence.getIndex();
|
||||
|
||||
if(this.isHoveringLeft(mouseX, mouseY))
|
||||
{
|
||||
if(Screen.func_231173_s_())
|
||||
if(Screen.hasShiftDown())
|
||||
{
|
||||
if(index < 10)
|
||||
{
|
||||
@@ -103,7 +104,7 @@ public class GuiButtonList<T> extends GuiButtonTooltip
|
||||
}
|
||||
else if(this.isHoveringRight(mouseX, mouseY))
|
||||
{
|
||||
if(Screen.func_231173_s_())
|
||||
if(Screen.hasShiftDown())
|
||||
{
|
||||
if(index > max - 10)
|
||||
{
|
||||
@@ -132,22 +133,22 @@ public class GuiButtonList<T> extends GuiButtonTooltip
|
||||
|
||||
private void updateMessage()
|
||||
{
|
||||
this.func_238482_a_(this.logic.translate(this.items.get(this.persistence.getIndex()))); //setMessage
|
||||
this.setMessage(this.logic.translate(this.items.get(this.persistence.getIndex())));
|
||||
}
|
||||
|
||||
private boolean isHoveringLeft(double mouseX, double mouseY)
|
||||
{
|
||||
return this.isHoveringVertical(mouseY) && mouseX >= this.field_230690_l_ && mouseX < this.field_230690_l_ + Math.ceil(this.field_230688_j_ / 2);
|
||||
return this.isHoveringVertical(mouseY) && mouseX >= this.x && mouseX < this.x + Math.ceil(this.width / 2);
|
||||
}
|
||||
|
||||
private boolean isHoveringRight(double mouseX, double mouseY)
|
||||
{
|
||||
return this.isHoveringVertical(mouseY) && mouseX >= this.field_230690_l_ + Math.ceil(this.field_230688_j_ / 2) && mouseX < this.field_230690_l_ + this.field_230688_j_;
|
||||
return this.isHoveringVertical(mouseY) && mouseX >= this.x + Math.ceil(this.width / 2) && mouseX < this.x + this.width;
|
||||
}
|
||||
|
||||
private boolean isHoveringVertical(double mouseY)
|
||||
{
|
||||
return mouseY >= this.field_230691_m_ && mouseY < this.field_230691_m_ + this.field_230689_k_;
|
||||
return mouseY >= this.y && mouseY < this.y + this.height;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -33,27 +33,27 @@ public class GuiButtonPiano extends GuiButtonBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230431_b_(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) //renderButton
|
||||
public void renderButton(MatrixStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
switch(this.type)
|
||||
{
|
||||
case LEFT:
|
||||
this.field_230692_n_ = this.isHoveringLeft(mouseX, mouseY);
|
||||
this.isHovered = this.isHoveringLeft(mouseX, mouseY);
|
||||
break;
|
||||
case NORMAL:
|
||||
this.field_230692_n_ = this.isHoveringNormal(mouseX, mouseY);
|
||||
this.isHovered = this.isHoveringNormal(mouseX, mouseY);
|
||||
break;
|
||||
case RIGHT:
|
||||
this.field_230692_n_ = this.isHoveringRight(mouseX, mouseY);
|
||||
this.isHovered = this.isHoveringRight(mouseX, mouseY);
|
||||
break;
|
||||
case BLACK:
|
||||
this.field_230692_n_ = this.isHoveringBlack(mouseX, mouseY);
|
||||
this.isHovered = this.isHoveringBlack(mouseX, mouseY);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
int hovered = this.func_230989_a_(this.func_230449_g_());
|
||||
int hovered = this.getYImage(this.isHovered());
|
||||
RenderUtils.color(1.0F, 1.0F, 1.0F, Config.getSkin().getButtonAlphaF());
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(NOTE);
|
||||
|
||||
@@ -77,13 +77,13 @@ public class GuiButtonPiano extends GuiButtonBase
|
||||
int textColor = this.getFGColor();
|
||||
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
|
||||
|
||||
this.func_238474_b_(matrix, this.field_230690_l_, this.field_230691_m_, 25 + hoverstate * 15 - 15, 0, 15, 92);
|
||||
fontRenderer.func_238422_b_(matrix, this.func_230458_i_(), (float) (this.field_230690_l_ + this.field_230688_j_ / 2 - fontRenderer.func_238414_a_(this.func_230458_i_()) / 2), (float) (this.field_230691_m_ + (this.field_230689_k_ - 8) / 2 + 36), textColor); //drawString
|
||||
this.blit(matrix, this.x, this.y, 25 + hoverstate * 15 - 15, 0, 15, 92);
|
||||
fontRenderer.func_243248_b(matrix, this.getMessage(), (float) (this.x + this.width / 2 - fontRenderer.func_238414_a_(this.getMessage()) / 2), (float) (this.y + (this.height - 8) / 2 + 36), textColor); //drawString
|
||||
}
|
||||
|
||||
protected void drawBlackKey(MatrixStack matrix, int hoverstate)
|
||||
{
|
||||
this.func_238474_b_(matrix, this.field_230690_l_, this.field_230691_m_, 55 + hoverstate * -9 + 18, 0, 9, 58); //blit
|
||||
this.blit(matrix, this.x, this.y, 55 - hoverstate * 9 + 18, 0, 9, 58);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,11 +91,11 @@ public class GuiButtonPiano extends GuiButtonBase
|
||||
{
|
||||
int textColor = 0x000000;
|
||||
|
||||
if(!this.field_230693_o_)
|
||||
if(!this.active)
|
||||
{
|
||||
textColor = 0xA0A0A0;
|
||||
}
|
||||
else if (this.func_230449_g_())
|
||||
else if(this.isHovered())
|
||||
{
|
||||
textColor = 0x8B8B8B;
|
||||
}
|
||||
@@ -104,53 +104,53 @@ public class GuiButtonPiano extends GuiButtonBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230988_a_(SoundHandler soundHandler) //playDownSound
|
||||
public void playDownSound(SoundHandler soundHandler)
|
||||
{
|
||||
soundHandler.play(SimpleSound.master(this.sound, this.pitch));
|
||||
}
|
||||
|
||||
private boolean isHoveringBlack(double mouseX, double mouseY)
|
||||
{
|
||||
return mouseX >= this.field_230690_l_ && mouseY >= this.field_230691_m_ && mouseX < this.field_230690_l_ + this.field_230688_j_ && mouseY < this.field_230691_m_ + this.field_230689_k_;
|
||||
return mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
|
||||
}
|
||||
|
||||
private boolean isHoveringLeft(double mouseX, double mouseY)
|
||||
{
|
||||
return (mouseX >= this.field_230690_l_ && mouseY >= this.field_230691_m_ && mouseX < this.field_230690_l_ + 10 && mouseY < this.field_230691_m_ + 60) || (mouseX >= this.field_230690_l_ && mouseY >= this.field_230691_m_ + 58 && mouseX < this.field_230690_l_ + 14 && mouseY < this.field_230691_m_ + 93);
|
||||
return (mouseX >= this.x && mouseY >= this.y && mouseX < this.x + 10 && mouseY < this.y + 60) || (mouseX >= this.x && mouseY >= this.y + 58 && mouseX < this.x + 14 && mouseY < this.y + 93);
|
||||
}
|
||||
|
||||
private boolean isHoveringNormal(double mouseX, double mouseY)
|
||||
{
|
||||
return (mouseX >= this.field_230690_l_ + 4 && mouseY >= this.field_230691_m_ && mouseX < this.field_230690_l_ + 10 && mouseY < this.field_230691_m_ + 60) || (mouseX >= this.field_230690_l_ && mouseY >= this.field_230691_m_ + 58 && mouseX < this.field_230690_l_ + 14 && mouseY < this.field_230691_m_ + 93);
|
||||
return (mouseX >= this.x + 4 && mouseY >= this.y && mouseX < this.x + 10 && mouseY < this.y + 60) || (mouseX >= this.x && mouseY >= this.y + 58 && mouseX < this.x + 14 && mouseY < this.y + 93);
|
||||
}
|
||||
|
||||
private boolean isHoveringRight(double mouseX, double mouseY)
|
||||
{
|
||||
return (mouseX >= this.field_230690_l_ + 4 && mouseY >= this.field_230691_m_ && mouseX < this.field_230690_l_ + 14 && mouseY < this.field_230691_m_ + 60) || (mouseX >= this.field_230690_l_ && mouseY >= this.field_230691_m_ + 58 && mouseX < this.field_230690_l_ + 14 && mouseY < this.field_230691_m_ + 93);
|
||||
return (mouseX >= this.x + 4 && mouseY >= this.y && mouseX < this.x + 14 && mouseY < this.y + 60) || (mouseX >= this.x && mouseY >= this.y + 58 && mouseX < this.x + 14 && mouseY < this.y + 93);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231047_b_(double mouseX, double mouseY) //isMouseOver
|
||||
public boolean isMouseOver(double mouseX, double mouseY)
|
||||
{
|
||||
switch(this.type)
|
||||
{
|
||||
case LEFT:
|
||||
return this.field_230693_o_ && this.field_230694_p_ && this.isHoveringLeft(mouseX, mouseY);
|
||||
return this.active && this.visible && this.isHoveringLeft(mouseX, mouseY);
|
||||
case NORMAL:
|
||||
return this.field_230693_o_ && this.field_230694_p_ && this.isHoveringNormal(mouseX, mouseY);
|
||||
return this.active && this.visible && this.isHoveringNormal(mouseX, mouseY);
|
||||
case RIGHT:
|
||||
return this.field_230693_o_ && this.field_230694_p_ && this.isHoveringRight(mouseX, mouseY);
|
||||
return this.active && this.visible && this.isHoveringRight(mouseX, mouseY);
|
||||
case BLACK:
|
||||
return this.field_230693_o_ && this.field_230694_p_ && this.isHoveringBlack(mouseX, mouseY);
|
||||
return this.active && this.visible && this.isHoveringBlack(mouseX, mouseY);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean func_230992_c_(double mouseX, double mouseY) //clicked
|
||||
protected boolean clicked(double mouseX, double mouseY)
|
||||
{
|
||||
return this.func_231047_b_(mouseX, mouseY);
|
||||
return this.isMouseOver(mouseX, mouseY);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -17,13 +17,13 @@ public abstract class GuiButtonTab extends AbstractButton
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230430_a_(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_) //render
|
||||
public void render(MatrixStack p_230430_1_, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230988_a_(SoundHandler soundHandler) //playDownSound
|
||||
public void playDownSound(SoundHandler soundHandler)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
package exopandora.worldhandler.gui.button;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
|
||||
import exopandora.worldhandler.util.ActionHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class GuiButtonTooltip extends GuiButtonBase
|
||||
@@ -23,20 +19,11 @@ public class GuiButtonTooltip extends GuiButtonBase
|
||||
this.tooltip = tooltip;
|
||||
}
|
||||
|
||||
public void renderTooltip(MatrixStack matrix, int mouseX, int mouseY)
|
||||
public void renderTooltip(Screen screen, MatrixStack matrix, int mouseX, int mouseY)
|
||||
{
|
||||
if(this.func_230449_g_() && this.tooltip != null && !this.tooltip.getString().isEmpty())
|
||||
if(this.isHovered() && this.tooltip != null && !this.tooltip.getString().isEmpty())
|
||||
{
|
||||
List<ITextComponent> list = Arrays.asList(this.tooltip);
|
||||
|
||||
if(!list.isEmpty())
|
||||
{
|
||||
int tooltipWidth = Minecraft.getInstance().fontRenderer.func_238414_a_(this.tooltip) + 9;
|
||||
int width = Minecraft.getInstance().currentScreen.field_230708_k_;
|
||||
int height = Minecraft.getInstance().currentScreen.field_230709_l_;
|
||||
|
||||
GuiUtils.drawHoveringText(matrix, list, mouseX, mouseY, width, height, tooltipWidth, Minecraft.getInstance().fontRenderer);
|
||||
}
|
||||
screen.renderTooltip(matrix, this.tooltip, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class GuiSlider extends GuiButtonBase
|
||||
|
||||
public GuiSlider(int x, int y, int widthIn, int heightIn, double min, double max, double start, Container container, ILogicSlider logic)
|
||||
{
|
||||
super(x, y, widthIn, heightIn, StringTextComponent.field_240750_d_, null);
|
||||
super(x, y, widthIn, heightIn, StringTextComponent.EMPTY, null);
|
||||
this.logic = Objects.requireNonNull(logic);
|
||||
this.container = Objects.requireNonNull(container);
|
||||
this.persistence = this.container.getContent().getPersistence(this.logic.getId(), () -> new Persistence(min, max, min == max ? 0.0 : ((start - min) / (max - min))));
|
||||
@@ -36,38 +36,38 @@ public class GuiSlider extends GuiButtonBase
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void func_230441_a_(MatrixStack matrix, Minecraft minecraft, int mouseX, int mouseY) //renderBg
|
||||
protected void renderBg(MatrixStack matrix, Minecraft minecraft, int mouseX, int mouseY)
|
||||
{
|
||||
super.func_230441_a_(matrix, minecraft, mouseX, mouseY); //renderBg
|
||||
super.renderBg(matrix, minecraft, mouseX, mouseY);
|
||||
|
||||
int hovered = super.func_230989_a_(this.func_230449_g_());
|
||||
int hovered = super.getYImage(this.isHovered());
|
||||
int textureOffset = (Config.getSkin().getTextureType().equals("resourcepack") ? 46 : 0) + hovered * 20;
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
RenderUtils.color(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF());
|
||||
|
||||
this.func_238474_b_(matrix, this.field_230690_l_ + (int) (this.persistence.getValue() * (float) (this.field_230688_j_ - 8)), this.field_230691_m_, 0, textureOffset, 4, 20); //blit
|
||||
this.func_238474_b_(matrix, this.field_230690_l_ + (int) (this.persistence.getValue() * (float) (this.field_230688_j_ - 8)) + 4, this.field_230691_m_, 196, textureOffset, 4, 20); //blit
|
||||
this.blit(matrix, this.x + (int) (this.persistence.getValue() * (float) (this.width - 8)), this.y, 0, textureOffset, 4, 20);
|
||||
this.blit(matrix, this.x + (int) (this.persistence.getValue() * (float) (this.width - 8)) + 4, this.y, 196, textureOffset, 4, 20);
|
||||
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230982_a_(double mouseX, double mouseY) //onClick
|
||||
public void onClick(double mouseX, double mouseY)
|
||||
{
|
||||
this.updateSlider(mouseX);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void func_230983_a_(double mouseX, double mouseY, double deltaX, double deltaY) //onDrag
|
||||
protected void onDrag(double mouseX, double mouseY, double deltaX, double deltaY)
|
||||
{
|
||||
this.updateSlider(mouseX);
|
||||
super.func_230983_a_(mouseX, mouseY, deltaX, deltaY); //onDrag
|
||||
super.onDrag(mouseX, mouseY, deltaX, deltaY);
|
||||
}
|
||||
|
||||
protected void updateSlider(double mouseX)
|
||||
{
|
||||
this.persistence.setValue((mouseX - (this.field_230690_l_ + 4)) / (float) (this.field_230688_j_ - 8));
|
||||
this.persistence.setValue((mouseX - (this.x + 4)) / (float) (this.width - 8));
|
||||
|
||||
if(this.persistence.getValue() < 0.0F)
|
||||
{
|
||||
@@ -84,7 +84,7 @@ public class GuiSlider extends GuiButtonBase
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int func_230989_a_(boolean mouseOver) //getYImage
|
||||
protected int getYImage(boolean mouseOver)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -92,10 +92,10 @@ public class GuiSlider extends GuiButtonBase
|
||||
private void updateDisplayString()
|
||||
{
|
||||
int value = this.persistence.getValueInt();
|
||||
IFormattableTextComponent suffix = this.logic.formatValue(value).func_230529_a_(this.logic.formatSuffix(value));
|
||||
IFormattableTextComponent suffix = this.logic.formatValue(value).append(this.logic.formatSuffix(value));
|
||||
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
|
||||
IFormattableTextComponent text = TextUtils.stripText(this.logic.formatPrefix(value), this.field_230688_j_ - fontRenderer.func_238414_a_(suffix), fontRenderer).func_230529_a_(suffix);
|
||||
this.func_238482_a_(text); //setMessage
|
||||
IFormattableTextComponent text = TextUtils.stripText(this.logic.formatPrefix(value), this.width - fontRenderer.func_238414_a_(suffix), fontRenderer).append(suffix);
|
||||
this.setMessage(text);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -27,17 +27,22 @@ public class GuiTextFieldTooltip extends TextFieldWidget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230431_b_(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) //renderButton
|
||||
public void renderButton(MatrixStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
super.func_230431_b_(matrix, mouseX, mouseY, partialTicks); // renderButton
|
||||
super.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
|
||||
if(this.getVisible() && !this.func_230999_j_() && this.tooltip != null && TextFormatting.getTextWithoutFormattingCodes(this.getText()).isEmpty())
|
||||
if(this.getVisible() && !this.isFocused() && this.tooltip != null && TextFormatting.getTextWithoutFormattingCodes(this.getText()).isEmpty())
|
||||
{
|
||||
boolean enableBackgroundDrawing = this.getAdjustedWidth() != this.field_230688_j_;
|
||||
int tx = enableBackgroundDrawing ? this.field_230690_l_ + 4 : this.field_230690_l_;
|
||||
int ty = enableBackgroundDrawing ? this.field_230691_m_ + (this.field_230689_k_ - 8) / 2 : this.field_230691_m_;
|
||||
int x = this.x;
|
||||
int y = this.y;
|
||||
|
||||
Minecraft.getInstance().fontRenderer.func_238407_a_(matrix, this.tooltip, (float) tx, (float) ty, 0x7F7F7F); //drawStringWithShadow
|
||||
if(this.getAdjustedWidth() != this.width)
|
||||
{
|
||||
x += 4;
|
||||
y += (this.height - 8) / 2;
|
||||
}
|
||||
|
||||
Minecraft.getInstance().fontRenderer.func_243246_a(matrix, this.tooltip, (float) x, (float) y, 0x7F7F7F); //drawStringWithShadow
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,8 +58,8 @@ public class GuiTextFieldTooltip extends TextFieldWidget
|
||||
|
||||
public void setPosition(int x, int y)
|
||||
{
|
||||
this.field_230690_l_ = x;
|
||||
this.field_230691_m_ = y;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public void setText(ITextComponent text)
|
||||
|
||||
@@ -23,20 +23,20 @@ public abstract class Container extends Screen implements IContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_231160_c_()
|
||||
public void init()
|
||||
{
|
||||
super.func_231160_c_();
|
||||
super.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Widget> T add(T button)
|
||||
{
|
||||
return super.func_230480_a_(button);
|
||||
return super.addButton(button);
|
||||
}
|
||||
|
||||
public <T extends TextFieldWidget> T add(T textfield)
|
||||
{
|
||||
return super.func_230481_d_(textfield);
|
||||
return super.addListener(textfield);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package exopandora.worldhandler.gui.container.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
@@ -30,6 +29,7 @@ import exopandora.worldhandler.util.RenderUtils;
|
||||
import exopandora.worldhandler.util.ResourceHelper;
|
||||
import exopandora.worldhandler.util.TextUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.client.gui.widget.Widget;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
@@ -40,7 +40,6 @@ import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class GuiWorldHandler extends Container
|
||||
@@ -77,16 +76,16 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_231160_c_()
|
||||
public void init()
|
||||
{
|
||||
super.func_231160_c_();
|
||||
super.init();
|
||||
|
||||
ActionHelper.tryRun(() ->
|
||||
{
|
||||
this.finalButtons.clear();
|
||||
this.menus.clear();
|
||||
this.field_230710_m_.clear();
|
||||
this.field_230705_e_.clear();
|
||||
this.buttons.clear();
|
||||
this.children.clear();
|
||||
|
||||
//INIT
|
||||
this.content.onPlayerNameChanged(this.getPlayer());
|
||||
@@ -101,7 +100,7 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
//SHORTCUTS
|
||||
|
||||
final int x = this.field_230708_k_ / 2 - 10;
|
||||
final int x = this.width / 2 - 10;
|
||||
final int delta = 21;
|
||||
|
||||
if(Config.getSettings().shortcuts())
|
||||
@@ -127,7 +126,7 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
if(Config.getSettings().commandSyntax())
|
||||
{
|
||||
this.syntaxField = new GuiTextFieldTooltip(x - delta * 7 + 1, this.field_230709_l_ - 22, delta * 15 - 3, 20);
|
||||
this.syntaxField = new GuiTextFieldTooltip(x - delta * 7 + 1, this.height - 22, delta * 15 - 3, 20);
|
||||
this.updateSyntax();
|
||||
}
|
||||
|
||||
@@ -162,7 +161,7 @@ public class GuiWorldHandler extends Container
|
||||
this.finalButtons.add(new GuiButtonTab((int) (backgroundX + xOffset), backgroundY - 20, (int) this.tabWidth + (int) Math.ceil(this.tabEpsilon / this.tabSize), 21, tab.getTabTitle())
|
||||
{
|
||||
@Override
|
||||
public void func_230930_b_() //onPress
|
||||
public void onPress()
|
||||
{
|
||||
ActionHelper.changeTab(GuiWorldHandler.this.content, index);
|
||||
}
|
||||
@@ -172,8 +171,8 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
public void initButtons()
|
||||
{
|
||||
this.field_230710_m_.clear();
|
||||
this.field_230705_e_.clear();
|
||||
this.buttons.clear();
|
||||
this.children.clear();
|
||||
this.content.initButtons(this, this.getContentX(), this.getContentY());
|
||||
|
||||
if(this.finalButtons != null && !this.finalButtons.isEmpty())
|
||||
@@ -195,7 +194,7 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_231023_e_() //tick
|
||||
public void tick()
|
||||
{
|
||||
ActionHelper.tryRun(this::update);
|
||||
}
|
||||
@@ -214,12 +213,12 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
private int getBackgroundX()
|
||||
{
|
||||
return (this.field_230708_k_ - this.bgTextureWidth) / 2 + this.getXOffset();
|
||||
return (this.width - this.bgTextureWidth) / 2 + this.getXOffset();
|
||||
}
|
||||
|
||||
private int getBackgroundY()
|
||||
{
|
||||
return (this.field_230709_l_ - this.bgTextureHeight) / 2 + this.getYOffset();
|
||||
return (this.height - this.bgTextureHeight) / 2 + this.getYOffset();
|
||||
}
|
||||
|
||||
private int getWatchOffset()
|
||||
@@ -242,7 +241,7 @@ public class GuiWorldHandler extends Container
|
||||
{
|
||||
if(Config.getSettings().commandSyntax() && this.syntaxField != null)
|
||||
{
|
||||
if(!this.syntaxField.func_230999_j_()) //isFocused
|
||||
if(!this.syntaxField.isFocused())
|
||||
{
|
||||
this.syntaxField.setValidator(Predicates.alwaysTrue());
|
||||
|
||||
@@ -270,14 +269,14 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
if(GuiWorldHandler.player.isEmpty())
|
||||
{
|
||||
int width = this.field_230712_o_.getStringWidth(I18n.format("gui.worldhandler.generic.edit_username")) + 2;
|
||||
this.nameField.func_230991_b_(width); //setWidth
|
||||
this.nameField.setPosition(backgroundX + this.bgTextureWidth - this.getWatchOffset() - 7 - (this.field_230712_o_.func_238414_a_(this.content.getTitle()) + 2), backgroundY + 6);
|
||||
int width = this.font.getStringWidth(I18n.format("gui.worldhandler.generic.edit_username")) + 2;
|
||||
this.nameField.setWidth(width);
|
||||
this.nameField.setPosition(backgroundX + this.bgTextureWidth - this.getWatchOffset() - 7 - (this.font.func_238414_a_(this.content.getTitle()) + 2), backgroundY + 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
int width = this.field_230712_o_.getStringWidth(GuiWorldHandler.player) + 2;
|
||||
this.nameField.func_230991_b_(width); //setWidth
|
||||
int width = this.font.getStringWidth(GuiWorldHandler.player) + 2;
|
||||
this.nameField.setWidth(width);
|
||||
this.nameField.setPosition(backgroundX + this.bgTextureWidth - this.getWatchOffset() - 7 - width, backgroundY + 6);
|
||||
}
|
||||
|
||||
@@ -285,7 +284,7 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_230430_a_(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) //render
|
||||
public void render(MatrixStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
ActionHelper.tryRun(() ->
|
||||
{
|
||||
@@ -296,8 +295,8 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
if(Config.getSkin().drawBackground())
|
||||
{
|
||||
this.func_230926_e_(-1); //setBlitOffset
|
||||
super.func_230446_a_(matrix); //renderBackground
|
||||
this.setBlitOffset(-1);
|
||||
super.renderBackground(matrix);
|
||||
}
|
||||
|
||||
//COLOR
|
||||
@@ -307,11 +306,11 @@ public class GuiWorldHandler extends Container
|
||||
//BACKGROUND
|
||||
|
||||
this.bindBackground();
|
||||
this.func_238474_b_(matrix, backgroundX, backgroundY, 0, 0, this.bgTextureWidth, this.bgTextureHeight); //blit
|
||||
this.blit(matrix, backgroundX, backgroundY, 0, 0, this.bgTextureWidth, this.bgTextureHeight);
|
||||
|
||||
//TABS
|
||||
|
||||
this.func_230926_e_(0); //setBlitOffset
|
||||
this.setBlitOffset(0);
|
||||
this.forEachTab((index, xOffset) -> this.drawTab(matrix, index, xOffset));
|
||||
this.defaultColor();
|
||||
|
||||
@@ -320,20 +319,20 @@ public class GuiWorldHandler extends Container
|
||||
final String label = Main.MC_VERSION + "-" + Main.MOD_VERSION;
|
||||
final int hexAlpha = (int) (0xFF * 0.2) << 24;
|
||||
final int color = Config.getSkin().getLabelColor() + hexAlpha;
|
||||
final int versionWidth = this.field_230708_k_ - this.field_230712_o_.getStringWidth(label) - 2;
|
||||
final int versionHeight = this.field_230709_l_ - 10;
|
||||
final int versionWidth = this.width - this.font.getStringWidth(label) - 2;
|
||||
final int versionHeight = this.height - 10;
|
||||
|
||||
this.field_230712_o_.func_238421_b_(matrix, label, versionWidth, versionHeight, color);
|
||||
this.font.drawString(matrix, label, versionWidth, versionHeight, color);
|
||||
|
||||
//TITLE
|
||||
|
||||
final int maxWidth = this.bgTextureWidth - 7 - 2 - this.field_230712_o_.getStringWidth(GuiWorldHandler.player) - 2 - this.getWatchOffset() - 7;
|
||||
this.field_230712_o_.func_238422_b_(matrix, TextUtils.stripText(this.content.getTitle(), maxWidth, this.field_230712_o_), backgroundX + 7, backgroundY + 7, Config.getSkin().getLabelColor());
|
||||
final int maxWidth = this.bgTextureWidth - 7 - 2 - this.font.getStringWidth(GuiWorldHandler.player) - 2 - this.getWatchOffset() - 7;
|
||||
this.font.func_243248_b(matrix, TextUtils.stripText(this.content.getTitle(), maxWidth, this.font), backgroundX + 7, backgroundY + 7, Config.getSkin().getLabelColor());
|
||||
|
||||
//NAME FIELD
|
||||
|
||||
final String username = GuiWorldHandler.player.isEmpty() && !this.nameField.func_230999_j_() ? I18n.format("gui.worldhandler.generic.edit_username") : GuiWorldHandler.player; //isFocused
|
||||
this.field_230712_o_.func_238421_b_(matrix, username, backgroundX + this.bgTextureWidth - this.getWatchOffset() - 7 - this.field_230712_o_.getStringWidth(username), backgroundY + 7, Config.getSkin().getLabelColor());
|
||||
final String username = GuiWorldHandler.player.isEmpty() && !this.nameField.isFocused() ? I18n.format("gui.worldhandler.generic.edit_username") : GuiWorldHandler.player;
|
||||
this.font.drawString(matrix, username, backgroundX + this.bgTextureWidth - this.getWatchOffset() - 7 - this.font.getStringWidth(username), backgroundY + 7, Config.getSkin().getLabelColor());
|
||||
|
||||
//WATCH
|
||||
|
||||
@@ -348,7 +347,7 @@ public class GuiWorldHandler extends Container
|
||||
{
|
||||
if(mouseX >= watchX && mouseX <= watchX + 9 && mouseY >= watchY && mouseY <= watchY + 9)
|
||||
{
|
||||
GuiUtils.drawHoveringText(matrix, Arrays.asList(new StringTextComponent(TextUtils.formatWorldTime(Minecraft.getInstance().world.getDayTime()))), mouseX, mouseY + 9, this.field_230708_k_, this.field_230709_l_, this.field_230708_k_, this.field_230712_o_);
|
||||
this.renderTooltip(matrix, new StringTextComponent(TextUtils.formatWorldTime(Minecraft.getInstance().world.getDayTime())), mouseX, mouseY + 9);
|
||||
RenderUtils.disableLighting();
|
||||
}
|
||||
}
|
||||
@@ -356,9 +355,9 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
//BUTTONS
|
||||
|
||||
for(int x = 0; x < this.field_230710_m_.size(); x++)
|
||||
for(int x = 0; x < this.buttons.size(); x++)
|
||||
{
|
||||
this.field_230710_m_.get(x).func_230430_a_(matrix, mouseX, mouseY, partialTicks); //render
|
||||
this.buttons.get(x).render(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
//CONTAINER
|
||||
@@ -376,7 +375,7 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
if(Config.getSettings().commandSyntax() && this.syntaxField != null)
|
||||
{
|
||||
this.syntaxField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.syntaxField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
//SPLASHTEXT
|
||||
@@ -391,10 +390,10 @@ public class GuiWorldHandler extends Container
|
||||
matrix.rotate(new Quaternion(17.0F, 0.0F, 0.0F, 1.0F));
|
||||
|
||||
float scale = 1.1F - MathHelper.abs(MathHelper.sin((float) (System.currentTimeMillis() % 1000L) / 1000.0F * (float) Math.PI * 2.0F) * 0.1F);
|
||||
scale = scale * 100.0F / this.field_230712_o_.getStringWidth(this.splash);
|
||||
scale = scale * 100.0F / this.font.getStringWidth(this.splash);
|
||||
matrix.scale(scale, scale, scale);
|
||||
|
||||
this.func_238471_a_(matrix, this.field_230712_o_, this.splash, 0, (int) scale, 0xFFFF00);
|
||||
AbstractGui.drawCenteredString(matrix, this.font, this.splash, 0, (int) scale, 0xFFFF00);
|
||||
|
||||
matrix.pop();
|
||||
}
|
||||
@@ -403,11 +402,11 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
if(Config.getSettings().tooltips())
|
||||
{
|
||||
for(Widget button : this.field_230710_m_)
|
||||
for(Widget button : this.buttons)
|
||||
{
|
||||
if(button instanceof GuiButtonTooltip)
|
||||
{
|
||||
((GuiButtonTooltip) button).renderTooltip(matrix, mouseX, mouseY);
|
||||
((GuiButtonTooltip) button).renderTooltip(this, matrix, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -416,7 +415,12 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
if(mouseX >= versionWidth && mouseY >= versionHeight)
|
||||
{
|
||||
GuiUtils.drawHoveringText(matrix, Arrays.asList(new StringTextComponent(label)), versionWidth - 12, versionHeight + 12, this.field_230708_k_ + this.field_230712_o_.getStringWidth(label), this.field_230709_l_ + 10, this.field_230708_k_, this.field_230712_o_);
|
||||
matrix.push();
|
||||
matrix.translate(versionWidth - 12, versionHeight + 12, 0);
|
||||
|
||||
this.renderTooltip(matrix, new StringTextComponent(label), 0, 0);
|
||||
|
||||
matrix.pop();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -448,9 +452,9 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
|
||||
this.bindBackground();
|
||||
this.func_230926_e_(-1); //setBlitOffset
|
||||
this.func_238474_b_(matrix, (int) (backgroundX + xOffset), (int) (backgroundY + yOffset), 0, 0, (int) Math.ceil(this.tabHalf), fHeight);
|
||||
this.func_238474_b_(matrix, (int) (backgroundX + this.tabHalf + xOffset), (int) (backgroundY + yOffset), this.bgTextureWidth - (int) Math.floor(this.tabHalf + 1), 0, (int) Math.floor(this.tabHalf + 1), fHeight);
|
||||
this.setBlitOffset(-1);
|
||||
this.blit(matrix, (int) (backgroundX + xOffset), (int) (backgroundY + yOffset), 0, 0, (int) Math.ceil(this.tabHalf), fHeight);
|
||||
this.blit(matrix, (int) (backgroundX + this.tabHalf + xOffset), (int) (backgroundY + yOffset), this.bgTextureWidth - (int) Math.floor(this.tabHalf + 1), 0, (int) Math.floor(this.tabHalf + 1), fHeight);
|
||||
|
||||
if(!Config.getSkin().sharpEdges())
|
||||
{
|
||||
@@ -464,7 +468,7 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
for(int x = 0; x < factor; x++)
|
||||
{
|
||||
this.func_238474_b_(matrix, (int) (backgroundX + xOffset - x - 1 + Math.floor(this.tabHalf + 1) + this.tabHalf), (int) (backgroundY + x + 1), (int) (this.tabWidth - x - 1), x + 1, x + 1, 1);
|
||||
this.blit(matrix, (int) (backgroundX + xOffset - x - 1 + Math.floor(this.tabHalf + 1) + this.tabHalf), (int) (backgroundY + x + 1), (int) (this.tabWidth - x - 1), x + 1, x + 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,7 +480,7 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
for(int x = 0; x < factor; x++)
|
||||
{
|
||||
this.func_238474_b_(matrix, (int) (backgroundX + xOffset), (int) (backgroundY + x + 1), (int) xOffset, x + 1, x + 1, 1);
|
||||
this.blit(matrix, (int) (backgroundX + xOffset), (int) (backgroundY + x + 1), (int) xOffset, x + 1, x + 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,7 +494,7 @@ public class GuiWorldHandler extends Container
|
||||
for(int x = 0; x < width; x += interval)
|
||||
{
|
||||
this.defaultColor(1.0F - (x / (width + 5.0F * interval)));
|
||||
this.func_238474_b_(matrix, (int) (backgroundX + xOffset), (int) (backgroundY + yOffset + fHeight + x / interval), 0, fHeight, width - x, 1);
|
||||
this.blit(matrix, (int) (backgroundX + xOffset), (int) (backgroundY + yOffset + fHeight + x / interval), 0, fHeight, width - x, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -503,7 +507,7 @@ public class GuiWorldHandler extends Container
|
||||
for(int x = 0; x < width; x += interval)
|
||||
{
|
||||
this.defaultColor(1.0F - (x / (width + 5.0F * interval)));
|
||||
this.func_238474_b_(matrix, (int) (backgroundX + Math.ceil(xOffset) + x + offset), (int) (backgroundY + yOffset + fHeight + x / interval), this.bgTextureWidth - width + x, fHeight, width - x, 1);
|
||||
this.blit(matrix, (int) (backgroundX + Math.ceil(xOffset) + x + offset), (int) (backgroundY + yOffset + fHeight + x / interval), this.bgTextureWidth - width + x, fHeight, width - x, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -517,7 +521,7 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
for(int x = 0; x < factor; x++)
|
||||
{
|
||||
this.func_238474_b_(matrix, backgroundX, backgroundY + x, 0, fHeight, factor - x, 1);
|
||||
this.blit(matrix, backgroundX, backgroundY + x, 0, fHeight, factor - x, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,14 +533,14 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
for(int x = 0; x < factor + 1; x++)
|
||||
{
|
||||
this.func_238474_b_(matrix, backgroundX + this.bgTextureWidth - x, backgroundY + factor - x, this.bgTextureWidth - x, fHeight, x, 1);
|
||||
this.blit(matrix, backgroundX + this.bgTextureWidth - x, backgroundY + factor - x, this.bgTextureWidth - x, fHeight, x, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.func_230926_e_(0); //setBlitOffset
|
||||
this.func_238472_a_(matrix, this.field_230712_o_, TextUtils.stripText(tab.getTabTitle().func_240699_a_(TextFormatting.UNDERLINE), (int) this.tabWidth, this.field_230712_o_), (int) (backgroundX + this.tabHalf + xOffset), (int) (backgroundY - 13), color); //drawCenteredString
|
||||
this.setBlitOffset(0);
|
||||
AbstractGui.drawCenteredString(matrix, this.font, TextUtils.stripText(tab.getTabTitle().mergeStyle(TextFormatting.UNDERLINE), (int) this.tabWidth, this.font), (int) (backgroundX + this.tabHalf + xOffset), (int) (backgroundY - 13), color);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -546,76 +550,76 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231044_a_(double mouseX, double mouseY, int keyCode) //mouseClicked
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int keyCode)
|
||||
{
|
||||
if(this.nameField.func_230999_j_()) //isFocused
|
||||
if(this.nameField.isFocused())
|
||||
{
|
||||
this.nameField.setCursorPositionEnd();
|
||||
}
|
||||
|
||||
if(this.content.func_231044_a_(mouseX, mouseY, keyCode))
|
||||
if(this.content.mouseClicked(mouseX, mouseY, keyCode))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.func_231044_a_(mouseX, mouseY, keyCode);
|
||||
return super.mouseClicked(mouseX, mouseY, keyCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231048_c_(double mouseX, double mouseY, int keyCode) //mouseReleased
|
||||
public boolean mouseReleased(double mouseX, double mouseY, int keyCode)
|
||||
{
|
||||
if(this.content.func_231048_c_(mouseX, mouseY, keyCode))
|
||||
if(this.content.mouseReleased(mouseX, mouseY, keyCode))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.func_231048_c_(mouseX, mouseY, keyCode);
|
||||
return super.mouseReleased(mouseX, mouseY, keyCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231045_a_(double mouseX, double mouseY, int keyCode, double deltaX, double deltaY) //mouseDragged
|
||||
public boolean mouseDragged(double mouseX, double mouseY, int keyCode, double deltaX, double deltaY)
|
||||
{
|
||||
if(this.content.func_231045_a_(mouseX, mouseY, keyCode, deltaX, deltaY))
|
||||
if(this.content.mouseDragged(mouseX, mouseY, keyCode, deltaX, deltaY))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.func_231045_a_(mouseX, mouseY, keyCode, deltaX, deltaY);
|
||||
return super.mouseDragged(mouseX, mouseY, keyCode, deltaX, deltaY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231043_a_(double mouseX, double mouseY, double distance) //mouseScrolled
|
||||
public boolean mouseScrolled(double mouseX, double mouseY, double distance)
|
||||
{
|
||||
if(this.content.func_231043_a_(mouseX, mouseY, distance))
|
||||
if(this.content.mouseScrolled(mouseX, mouseY, distance))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.func_231043_a_(mouseX, mouseY, distance);
|
||||
return super.mouseScrolled(mouseX, mouseY, distance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231046_a_(int keyCode, int scanCode, int modifiers) //keyPressed
|
||||
public boolean keyPressed(int keyCode, int scanCode, int modifiers)
|
||||
{
|
||||
boolean focused = this.func_241217_q_() != null;
|
||||
boolean focused = this.getListener() != null;
|
||||
|
||||
if(focused && this.func_241217_q_() instanceof Widget)
|
||||
if(focused && this.getListener() instanceof Widget)
|
||||
{
|
||||
focused = ((Widget) this.func_241217_q_()).func_230999_j_(); //getFocused().isFocused()
|
||||
focused = ((Widget) this.getListener()).isFocused();
|
||||
}
|
||||
|
||||
if(!focused && KeyHandler.isPressed(KeyHandler.KEY_WORLD_HANDLER, keyCode))
|
||||
{
|
||||
this.func_231175_as__();
|
||||
this.onClose();
|
||||
return true;
|
||||
}
|
||||
|
||||
if(this.content.func_231046_a_(keyCode, scanCode, modifiers))
|
||||
if(this.content.keyPressed(keyCode, scanCode, modifiers))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.func_231046_a_(keyCode, scanCode, modifiers);
|
||||
return super.keyPressed(keyCode, scanCode, modifiers);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -630,41 +634,41 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231042_a_(char charTyped, int keyCode) //charTyped
|
||||
public boolean charTyped(char charTyped, int keyCode)
|
||||
{
|
||||
if(this.nameField.func_230999_j_()) //isFocused
|
||||
if(this.nameField.isFocused())
|
||||
{
|
||||
this.nameField.setCursorPositionEnd();
|
||||
}
|
||||
|
||||
if(this.content.func_231042_a_(charTyped, keyCode))
|
||||
if(this.content.charTyped(charTyped, keyCode))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.func_231042_a_(charTyped, keyCode);
|
||||
return super.charTyped(charTyped, keyCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231049_c__(boolean focus) //changeFocus
|
||||
public boolean changeFocus(boolean focus)
|
||||
{
|
||||
if(this.content.func_231049_c__(focus))
|
||||
if(this.content.changeFocus(focus))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.func_231049_c__(focus);
|
||||
return super.changeFocus(focus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231047_b_(double mouseX, double mouseY) //isMouseOver
|
||||
public boolean isMouseOver(double mouseX, double mouseY)
|
||||
{
|
||||
if(this.content.func_231047_b_(mouseX, mouseY))
|
||||
if(this.content.isMouseOver(mouseX, mouseY))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.func_231047_b_(mouseX, mouseY);
|
||||
return super.isMouseOver(mouseX, mouseY);
|
||||
}
|
||||
|
||||
private void defaultColor()
|
||||
@@ -737,14 +741,14 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_231175_as__() //onClose
|
||||
public void onClose()
|
||||
{
|
||||
ActionHelper.tryRun(this.content::onGuiClosed);
|
||||
super.func_231175_as__();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231177_au__() //isPauseScreen
|
||||
public boolean isPauseScreen()
|
||||
{
|
||||
return Config.getSettings().pause();
|
||||
}
|
||||
@@ -762,7 +766,7 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_231178_ax__() //shouldCloseOnEsc
|
||||
public boolean shouldCloseOnEsc()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class ContentAdvancements extends Content
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderAdvancement.getBuilderForAction(EnumActionType.REVOKE));
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.reset").func_240699_a_(TextFormatting.RED), () ->
|
||||
container.add(new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.reset").mergeStyle(TextFormatting.RED), () ->
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(Contents.CONTINUE.withBuilder(this.builderAdvancement.getBuilder(EnumActionType.REVOKE, EnumMode.EVERYTHING)).withParent(Contents.ADVANCEMENTS)));
|
||||
}));
|
||||
|
||||
@@ -106,18 +106,18 @@ public class ContentButcher extends Content
|
||||
{
|
||||
ContentButcher.slaughter(container.getPlayer(), Config.getButcher().getEntities().stream().map(ForgeRegistries.ENTITIES::getValue).filter(Predicates.notNull()).collect(Collectors.toList()), Integer.parseInt(this.radius));
|
||||
}));
|
||||
slaughter.field_230693_o_ = enabled && !Config.getButcher().getEntities().isEmpty();
|
||||
slaughter.active = enabled && !Config.getButcher().getEntities().isEmpty();
|
||||
|
||||
container.add(slaughter = new GuiButtonBase(x + 58, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.butcher.presets"), () ->
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(Contents.BUTCHER_PRESETS.withBuilder(this.builderButcher).withRadius(Integer.parseInt(this.radius)).withParent(Contents.BUTCHER)));
|
||||
}));
|
||||
slaughter.field_230693_o_ = enabled;
|
||||
slaughter.active = enabled;
|
||||
}
|
||||
|
||||
public static void slaughter(String player, Collection<EntityType<?>> entities, int radius)
|
||||
{
|
||||
AxisAlignedBB aabb = new AxisAlignedBB(Minecraft.getInstance().player.func_233580_cy_()).grow(radius);
|
||||
AxisAlignedBB aabb = new AxisAlignedBB(Minecraft.getInstance().player.getPosition()).grow(radius);
|
||||
|
||||
for(EntityType<?> entity : entities)
|
||||
{
|
||||
@@ -140,7 +140,7 @@ public class ContentButcher extends Content
|
||||
@Override
|
||||
public void drawScreen(MatrixStack stack, Container container, int x, int y, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
this.radiusField.func_230431_b_(stack, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.radiusField.renderButton(stack, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,7 +89,7 @@ public class ContentButcherSettings extends ContentChild
|
||||
|
||||
boolean contains = Config.CLIENT.getButcher().containsEntity(this.entity);
|
||||
|
||||
button1.field_230693_o_ = !contains;
|
||||
button2.field_230693_o_ = contains;
|
||||
button1.active = !contains;
|
||||
button2.active = contains;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ import net.minecraft.client.gui.screen.MultiplayerWarningScreen;
|
||||
import net.minecraft.client.gui.screen.WorldSelectionScreen;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraft.realms.RealmsBridgeScreen;
|
||||
import net.minecraft.server.IDynamicRegistries;
|
||||
import net.minecraft.server.integrated.IntegratedServer;
|
||||
import net.minecraft.util.registry.DynamicRegistries;
|
||||
import net.minecraft.util.text.IFormattableTextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
@@ -66,7 +66,7 @@ public class ContentChangeWorld extends ContentChild
|
||||
{
|
||||
IntegratedServer integrated = Minecraft.getInstance().getIntegratedServer();
|
||||
String folder = integrated.anvilConverterForAnvilFile.func_237282_a_();
|
||||
DimensionGeneratorSettings dimensionGeneratorSettings = integrated.func_240793_aU_().func_230418_z_();
|
||||
DimensionGeneratorSettings dimensionGeneratorSettings = integrated.func_240793_aU_().getDimensionGeneratorSettings();
|
||||
WorldSettings worldSettings = integrated.func_240793_aU_().func_230408_H_();
|
||||
|
||||
Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
|
||||
@@ -96,7 +96,7 @@ public class ContentChangeWorld extends ContentChild
|
||||
else if(connection instanceof IntegratedConnection)
|
||||
{
|
||||
IntegratedConnection integrated = (IntegratedConnection) connection;
|
||||
Minecraft.getInstance().func_238192_a_(integrated.getFolder(), integrated.getWorldSettings(), IDynamicRegistries.func_239770_b_(), integrated.getDimensionGeneratorSettings()); //launchIntegratedServer
|
||||
Minecraft.getInstance().func_238192_a_(integrated.getFolder(), integrated.getWorldSettings(), DynamicRegistries.func_239770_b_(), integrated.getDimensionGeneratorSettings()); //launchIntegratedServer
|
||||
Minecraft.getInstance().mouseHelper.grabMouse();
|
||||
}
|
||||
else if(connection instanceof DedicatedConnection)
|
||||
|
||||
@@ -127,12 +127,12 @@ public class ContentCommandStack extends ContentChild
|
||||
container.add(buttonUp = new GuiButtonIcon(x + 232 - 20 - 24, y + index * 24 - 1, 20, 10, EnumIcon.ARROW_UP, new TranslationTextComponent("gui.worldhandler.actions.move_up"), () ->
|
||||
{
|
||||
this.swapCommands(index + this.scroll, index + this.scroll - 1);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(buttonDown = new GuiButtonIcon(x + 232 - 20 - 24, y + index * 24 + 11, 20, 10, EnumIcon.ARROW_DOWN, new TranslationTextComponent("gui.worldhandler.actions.move_down"), () ->
|
||||
{
|
||||
this.swapCommands(index + this.scroll, index + this.scroll + 1);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(buttonRemove = new GuiButtonTooltip(x + 232 - 20, y + index * 24 - 1, 20, 10, MINUS, new TranslationTextComponent("gui.worldhandler.command_stack.remove_command"), () ->
|
||||
{
|
||||
@@ -144,7 +144,7 @@ public class ContentCommandStack extends ContentChild
|
||||
this.scrollUp();
|
||||
}
|
||||
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(new GuiButtonTooltip(x + 232 - 20, y + index * 24 + 11, 20, 10, PLUS, new TranslationTextComponent("gui.worldhandler.command_stack.insert_command"), () ->
|
||||
{
|
||||
@@ -156,13 +156,13 @@ public class ContentCommandStack extends ContentChild
|
||||
this.scrollDown();
|
||||
}
|
||||
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(this.textfields.get(index));
|
||||
|
||||
buttonRemove.field_230693_o_ = this.getCommandCount() > 1;
|
||||
buttonUp.field_230693_o_ = index + this.scroll > 0;
|
||||
buttonDown.field_230693_o_ = index + this.scroll + 1 < this.getCommandCount();
|
||||
buttonRemove.active = this.getCommandCount() > 1;
|
||||
buttonUp.active = index + this.scroll > 0;
|
||||
buttonDown.active = index + this.scroll + 1 < this.getCommandCount();
|
||||
});
|
||||
|
||||
container.add(this.buttonCopy = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.command_stack.copy_command"), () ->
|
||||
@@ -172,17 +172,17 @@ public class ContentCommandStack extends ContentChild
|
||||
container.add(buttonScrollUp = new GuiButtonIcon(x + 118, y + 72, 56, 20, EnumIcon.ARROW_UP, new TranslationTextComponent("gui.worldhandler.actions.move_up"), () ->
|
||||
{
|
||||
this.scrollUp();
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(buttonScrollDown = new GuiButtonIcon(x + 118 + 60, y + 72, 54, 20, EnumIcon.ARROW_DOWN, new TranslationTextComponent("gui.worldhandler.actions.move_down"), () ->
|
||||
{
|
||||
this.scrollDown();
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
this.updateCopyButton();
|
||||
buttonScrollUp.field_230693_o_ = this.scroll > 0;
|
||||
buttonScrollDown.field_230693_o_ = this.scroll < this.getCommandCount() - 3;
|
||||
buttonScrollUp.active = this.scroll > 0;
|
||||
buttonScrollDown.active = this.scroll < this.getCommandCount() - 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -199,7 +199,7 @@ public class ContentCommandStack extends ContentChild
|
||||
{
|
||||
this.iterate(index ->
|
||||
{
|
||||
this.textfields.get(index).func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.textfields.get(index).renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -213,12 +213,12 @@ public class ContentCommandStack extends ContentChild
|
||||
|
||||
private void scrollUp()
|
||||
{
|
||||
this.scroll = Math.max(0, this.scroll - (Screen.func_231173_s_() ? 10 : 1));
|
||||
this.scroll = Math.max(0, this.scroll - (Screen.hasShiftDown() ? 10 : 1));
|
||||
}
|
||||
|
||||
private void scrollDown()
|
||||
{
|
||||
this.scroll = Math.min(this.getCommandCount() - 3, this.scroll + (Screen.func_231173_s_() ? 10 : 1));
|
||||
this.scroll = Math.min(this.getCommandCount() - 3, this.scroll + (Screen.hasShiftDown() ? 10 : 1));
|
||||
}
|
||||
|
||||
private void updateCopyButton()
|
||||
@@ -235,7 +235,7 @@ public class ContentCommandStack extends ContentChild
|
||||
}
|
||||
}
|
||||
|
||||
this.buttonCopy.field_230693_o_ = active;
|
||||
this.buttonCopy.active = active;
|
||||
}
|
||||
|
||||
private void setCommand(int index, String command)
|
||||
|
||||
@@ -32,22 +32,22 @@ public class ContentContainers extends Content
|
||||
{
|
||||
container.add(new GuiButtonBase(x, y + 96, 232, 20, new TranslationTextComponent("gui.worldhandler.generic.backToGame"), ActionHelper::backToGame));
|
||||
|
||||
container.add(new GuiButtonBase(x + 24, y, 208, 20, Blocks.CRAFTING_TABLE.func_235333_g_(), () ->
|
||||
container.add(new GuiButtonBase(x + 24, y, 208, 20, Blocks.CRAFTING_TABLE.getTranslatedName(), () ->
|
||||
{
|
||||
BlockHelper.setBlockNearPlayer(container.getPlayer(), Blocks.CRAFTING_TABLE);
|
||||
ActionHelper.backToGame();
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 24, y + 24, 208, 20, Blocks.ENDER_CHEST.func_235333_g_(), () ->
|
||||
container.add(new GuiButtonBase(x + 24, y + 24, 208, 20, Blocks.ENDER_CHEST.getTranslatedName(), () ->
|
||||
{
|
||||
BlockHelper.setBlockNearPlayer(container.getPlayer(), Blocks.ENDER_CHEST);
|
||||
ActionHelper.backToGame();
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 24, y + 48, 208, 20, Blocks.ANVIL.func_235333_g_(), () ->
|
||||
container.add(new GuiButtonBase(x + 24, y + 48, 208, 20, Blocks.ANVIL.getTranslatedName(), () ->
|
||||
{
|
||||
BlockHelper.setBlockNearPlayer(container.getPlayer(), Blocks.ANVIL);
|
||||
ActionHelper.backToGame();
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 24, y + 72, 208, 20, Blocks.ENCHANTING_TABLE.func_235333_g_(), () ->
|
||||
container.add(new GuiButtonBase(x + 24, y + 72, 208, 20, Blocks.ENCHANTING_TABLE.getTranslatedName(), () ->
|
||||
{
|
||||
double angle = Minecraft.getInstance().player.getHorizontalFacing().getHorizontalIndex() * Math.PI / 2;
|
||||
double sin = Math.sin(angle);
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ContentContinue extends ContentChild
|
||||
container.add(new GuiButtonBase(x + 118, y + 96, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.backToGame"), ActionHelper::backToGame));
|
||||
|
||||
container.add(this.commandField);
|
||||
container.add(new GuiButtonBase(x + 116 / 2, y + 36, 116, 20, new TranslationTextComponent("gui.worldhandler.generic.yes").func_240699_a_(TextFormatting.RED), () ->
|
||||
container.add(new GuiButtonBase(x + 116 / 2, y + 36, 116, 20, new TranslationTextComponent("gui.worldhandler.generic.yes").mergeStyle(TextFormatting.RED), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builder, this.special);
|
||||
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(this.getParentContent()));
|
||||
@@ -78,6 +78,6 @@ public class ContentContinue extends ContentChild
|
||||
@Override
|
||||
public void drawScreen(MatrixStack matrix, Container container, int x, int y, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
this.commandField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.commandField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,53 +227,53 @@ public class ContentCustomItem extends Content
|
||||
container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.items.custom_item.start"), () ->
|
||||
{
|
||||
this.page = Page.START;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.items.custom_item.enchantment"), () ->
|
||||
{
|
||||
this.page = Page.ENCHANT;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.items.custom_item.attributes"), () ->
|
||||
{
|
||||
this.page = Page.ATTRIBUTES;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
if(Page.START.equals(this.page))
|
||||
{
|
||||
button1.field_230693_o_ = false;
|
||||
button1.active = false;
|
||||
|
||||
container.add(button5 = new GuiButtonBase(x + 118, y + 72, 56, 20, TextUtils.ARROW_LEFT, () ->
|
||||
{
|
||||
this.startPage--;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button6 = new GuiButtonBase(x + 118 + 60, y + 72, 55, 20, TextUtils.ARROW_RIGHT, () ->
|
||||
{
|
||||
this.startPage++;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
if(this.startPage == 0)
|
||||
{
|
||||
button5.field_230693_o_ = false;
|
||||
button5.active = false;
|
||||
container.add(this.itemField);
|
||||
container.add(this.itemLore1Field);
|
||||
container.add(this.itemLore2Field);
|
||||
}
|
||||
else if(this.startPage == 1)
|
||||
{
|
||||
button6.field_230693_o_ = false;
|
||||
button6.active = false;
|
||||
}
|
||||
}
|
||||
else if(Page.ENCHANT.equals(this.page))
|
||||
{
|
||||
button2.field_230693_o_ = false;
|
||||
button2.active = false;
|
||||
}
|
||||
else if(Page.ATTRIBUTES.equals(this.page))
|
||||
{
|
||||
button3.field_230693_o_ = false;
|
||||
button3.active = false;
|
||||
}
|
||||
|
||||
if(!this.builderCutomItem.needsCommandBlock() && !this.builderCutomItem.getName().isSpecial())
|
||||
@@ -285,7 +285,7 @@ public class ContentCustomItem extends Content
|
||||
container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.place_command_block"), () -> this.send(container.getPlayer())));
|
||||
}
|
||||
|
||||
button4.field_230693_o_ = ResourceHelper.isRegistered(ResourceHelper.stringToResourceLocation(this.item), ForgeRegistries.ITEMS);
|
||||
button4.active = ResourceHelper.isRegistered(ResourceHelper.stringToResourceLocation(this.item), ForgeRegistries.ITEMS);
|
||||
}
|
||||
|
||||
private void send(String player)
|
||||
@@ -309,9 +309,9 @@ public class ContentCustomItem extends Content
|
||||
{
|
||||
if(Page.START.equals(this.page) && this.startPage == 0)
|
||||
{
|
||||
this.itemField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.itemLore1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.itemLore2Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.itemField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.itemLore1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.itemLore2Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,22 +174,22 @@ public class ContentEditBlocks extends Content
|
||||
container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.coordinates"), () ->
|
||||
{
|
||||
this.page = Page.COORDINATES;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.fill"), () ->
|
||||
{
|
||||
this.page = Page.FILL;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.replace"), () ->
|
||||
{
|
||||
this.page = Page.REPLACE;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.clone"), () ->
|
||||
{
|
||||
this.page = Page.CLONE;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
int yOffset1 = 0;
|
||||
@@ -200,7 +200,7 @@ public class ContentEditBlocks extends Content
|
||||
|
||||
if(Page.COORDINATES.equals(this.page))
|
||||
{
|
||||
button1.field_230693_o_ = false;
|
||||
button1.active = false;
|
||||
|
||||
yOffset1 = 72;
|
||||
yOffset2 = 72;
|
||||
@@ -217,7 +217,7 @@ public class ContentEditBlocks extends Content
|
||||
}
|
||||
else if(Page.FILL.equals(this.page))
|
||||
{
|
||||
button2.field_230693_o_ = false;
|
||||
button2.active = false;
|
||||
|
||||
yOffset1 = 24;
|
||||
yOffset2 = 48;
|
||||
@@ -230,11 +230,11 @@ public class ContentEditBlocks extends Content
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderFill.getBuilderForFill());
|
||||
}));
|
||||
button1.field_230693_o_ = ResourceHelper.isRegistered(this.builderFill.getBlock1(), ForgeRegistries.BLOCKS);
|
||||
button1.active = ResourceHelper.isRegistered(this.builderFill.getBlock1(), ForgeRegistries.BLOCKS);
|
||||
}
|
||||
else if(Page.REPLACE.equals(this.page))
|
||||
{
|
||||
button3.field_230693_o_ = false;
|
||||
button3.active = false;
|
||||
|
||||
yOffset1 = 48;
|
||||
yOffset2 = 48;
|
||||
@@ -248,11 +248,11 @@ public class ContentEditBlocks extends Content
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderFill.getBuilderForReplace());
|
||||
}));
|
||||
button1.field_230693_o_ = ResourceHelper.isRegistered(this.builderFill.getBlock1(), ForgeRegistries.BLOCKS) && ResourceHelper.isRegistered(this.builderFill.getBlock2(), ForgeRegistries.BLOCKS);
|
||||
button1.active = ResourceHelper.isRegistered(this.builderFill.getBlock1(), ForgeRegistries.BLOCKS) && ResourceHelper.isRegistered(this.builderFill.getBlock2(), ForgeRegistries.BLOCKS);
|
||||
}
|
||||
else if(Page.CLONE.equals(this.page))
|
||||
{
|
||||
button4.field_230693_o_ = false;
|
||||
button4.active = false;
|
||||
|
||||
yOffset1 = 48;
|
||||
yOffset2 = 48;
|
||||
@@ -268,8 +268,8 @@ public class ContentEditBlocks extends Content
|
||||
else
|
||||
{
|
||||
this.builderClone.setFilter(null);
|
||||
container.add(button1 = new GuiButtonBase(x + 118, y + 24, 114, 20, StringTextComponent.field_240750_d_, null));
|
||||
button1.field_230693_o_ = false;
|
||||
container.add(button1 = new GuiButtonBase(x + 118, y + 24, 114, 20, StringTextComponent.EMPTY, null));
|
||||
button1.active = false;
|
||||
}
|
||||
|
||||
container.add(new GuiButtonList<EnumMask>(x + 118, y, Arrays.asList(EnumMask.values()), 114, 20, container, new ILogicMapped<EnumMask>()
|
||||
@@ -290,7 +290,7 @@ public class ContentEditBlocks extends Content
|
||||
public void onClick(EnumMask item)
|
||||
{
|
||||
ContentEditBlocks.this.builderClone.setMask(item);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -314,19 +314,19 @@ public class ContentEditBlocks extends Content
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
button2.field_230693_o_ = false;
|
||||
button2.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
container.add(new GuiButtonBase(x + 118, y + yOffset1, width1, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.pos.set_pos_1"), () ->
|
||||
{
|
||||
BlockHelper.setPos1(BlockHelper.getFocusedBlockPos());
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 118 + xOffset2, y + yOffset2, width2, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.pos.set_pos_2"), () ->
|
||||
{
|
||||
BlockHelper.setPos2(BlockHelper.getFocusedBlockPos());
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -366,28 +366,28 @@ public class ContentEditBlocks extends Content
|
||||
{
|
||||
if(Page.COORDINATES.equals(this.page))
|
||||
{
|
||||
this.x1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.y1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.z1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.x1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.y1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.z1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
|
||||
this.x2Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.y2Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.z2Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.x2Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.y2Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.z2Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
else if(Page.FILL.equals(this.page))
|
||||
{
|
||||
this.block1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.block1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
else if(Page.REPLACE.equals(this.page))
|
||||
{
|
||||
this.block1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.block2Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.block1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.block2Field.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
else if(Page.CLONE.equals(this.page))
|
||||
{
|
||||
if(EnumMask.FILTERED.equals(this.builderClone.getMask()))
|
||||
{
|
||||
this.filterField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.filterField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ContentExperience extends Content
|
||||
container.add(this.buttonAdd = new GuiButtonBase(x + 116 / 2, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.add"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderExperience.getBuilderForAddLevels());
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(this.buttonRemove = new GuiButtonBase(x + 116 / 2, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.remove"), () ->
|
||||
{
|
||||
@@ -65,13 +65,13 @@ public class ContentExperience extends Content
|
||||
container.add(new GuiButtonTooltip(x + 116 / 2, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.reset"), new TranslationTextComponent("gui.worldhandler.actions.set_to_0"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderExperience.getBuilderForResetLevels());
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
boolean enabled = this.builderExperience.getLevel() > 0;
|
||||
|
||||
this.buttonAdd.field_230693_o_ = enabled;
|
||||
this.buttonRemove.field_230693_o_ = enabled;
|
||||
this.buttonAdd.active = enabled;
|
||||
this.buttonRemove.active = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,8 +79,8 @@ public class ContentExperience extends Content
|
||||
{
|
||||
boolean enabled = this.builderExperience.getLevel() > 0;
|
||||
|
||||
this.buttonAdd.field_230693_o_ = enabled;
|
||||
this.buttonRemove.field_230693_o_ = enabled;
|
||||
this.buttonAdd.active = enabled;
|
||||
this.buttonRemove.active = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -164,7 +164,7 @@ public class ContentGamerules extends Content
|
||||
{
|
||||
if(!this.booleanValue)
|
||||
{
|
||||
this.valueField.func_230431_b_(matrix, mouseX, mouseY, partialTicks);
|
||||
this.valueField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import exopandora.worldhandler.gui.content.Contents;
|
||||
import exopandora.worldhandler.util.ActionHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screen.OptionsScreen;
|
||||
import net.minecraft.client.gui.screen.ResourcePacksScreen;
|
||||
import net.minecraft.client.gui.screen.PackScreen;
|
||||
import net.minecraft.util.text.IFormattableTextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
@@ -89,12 +89,12 @@ public class ContentMain extends Content
|
||||
container.add(new GuiButtonBase(x + 78, y + 96, 76, 20, new TranslationTextComponent("gui.worldhandler.resourcepack"), () ->
|
||||
{
|
||||
Minecraft.getInstance().gameSettings.saveOptions();
|
||||
Minecraft.getInstance().displayGuiScreen(new ResourcePacksScreen(container, Minecraft.getInstance().getResourcePackList(), resourcePackList ->
|
||||
Minecraft.getInstance().displayGuiScreen(new PackScreen(container, Minecraft.getInstance().getResourcePackList(), resourcePackList ->
|
||||
{
|
||||
OptionsScreen optionsScreen = new OptionsScreen(container, Minecraft.getInstance().gameSettings);
|
||||
optionsScreen.func_231158_b_(Minecraft.getInstance(), 0, 0);
|
||||
optionsScreen.init(Minecraft.getInstance(), 0, 0);
|
||||
optionsScreen.func_241584_a_(resourcePackList);
|
||||
}, Minecraft.getInstance().getFileResourcePacks()));
|
||||
}, Minecraft.getInstance().getFileResourcePacks(), new TranslationTextComponent("resourcePack.title")));
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 158, y + 96, 74, 20, new TranslationTextComponent("gui.worldhandler.generic.backToGame"), ActionHelper::backToGame));
|
||||
}
|
||||
|
||||
@@ -123,27 +123,27 @@ public class ContentMultiplayer extends Content
|
||||
container.add(button1 = new GuiButtonBase(x, y, 114, 20, new StringTextComponent(I18n.format("gui.worldhandler.multiplayer.kick") + " / " + I18n.format("gui.worldhandler.multiplayer.ban")), () ->
|
||||
{
|
||||
this.page = Page.KICK_AND_BAN;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.pardon"), () ->
|
||||
{
|
||||
this.page = Page.PARDON;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.permissions"), () ->
|
||||
{
|
||||
this.page = Page.PERMISSIONS;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.runtime"), () ->
|
||||
{
|
||||
this.page = Page.RUNTIME;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button5 = new GuiButtonBase(x, y + 96, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.whitelist"), () ->
|
||||
{
|
||||
this.page = Page.WHITELIST;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
if(Page.KICK_AND_BAN.equals(this.page))
|
||||
@@ -161,11 +161,11 @@ public class ContentMultiplayer extends Content
|
||||
|
||||
if(this.playerField.getText().isEmpty())
|
||||
{
|
||||
button6.field_230693_o_ = false;
|
||||
button7.field_230693_o_ = false;
|
||||
button6.active = false;
|
||||
button7.active = false;
|
||||
}
|
||||
|
||||
button1.field_230693_o_ = false;
|
||||
button1.active = false;
|
||||
}
|
||||
else if(Page.PARDON.equals(this.page))
|
||||
{
|
||||
@@ -177,10 +177,10 @@ public class ContentMultiplayer extends Content
|
||||
|
||||
if(this.playerField.getText().isEmpty())
|
||||
{
|
||||
button6.field_230693_o_ = false;
|
||||
button6.active = false;
|
||||
}
|
||||
|
||||
button2.field_230693_o_ = false;
|
||||
button2.active = false;
|
||||
}
|
||||
else if(Page.PERMISSIONS.equals(this.page))
|
||||
{
|
||||
@@ -196,11 +196,11 @@ public class ContentMultiplayer extends Content
|
||||
|
||||
if(this.playerField.getText().isEmpty())
|
||||
{
|
||||
button6.field_230693_o_ = false;
|
||||
button7.field_230693_o_ = false;
|
||||
button6.active = false;
|
||||
button7.active = false;
|
||||
}
|
||||
|
||||
button3.field_230693_o_ = false;
|
||||
button3.active = false;
|
||||
}
|
||||
else if(Page.RUNTIME.equals(this.page))
|
||||
{
|
||||
@@ -212,16 +212,16 @@ public class ContentMultiplayer extends Content
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderSaveOn);
|
||||
}));
|
||||
container.add(new GuiButtonTooltip(x + 118, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.runtime.autosave", new TranslationTextComponent("gui.worldhandler.generic.off")).func_240699_a_(TextFormatting.RED), new StringTextComponent(this.builderSaveOff.toActualCommand()), () ->
|
||||
container.add(new GuiButtonTooltip(x + 118, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.runtime.autosave", new TranslationTextComponent("gui.worldhandler.generic.off")).mergeStyle(TextFormatting.RED), new StringTextComponent(this.builderSaveOff.toActualCommand()), () ->
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(Contents.CONTINUE.withBuilder(this.builderSaveOff).withParent(Contents.MULTIPLAYER)));
|
||||
}));
|
||||
container.add(new GuiButtonTooltip(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.runtime.stop_server").func_240699_a_(TextFormatting.RED), new StringTextComponent(this.builderStop.toActualCommand()), () ->
|
||||
container.add(new GuiButtonTooltip(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.runtime.stop_server").mergeStyle(TextFormatting.RED), new StringTextComponent(this.builderStop.toActualCommand()), () ->
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(Contents.CONTINUE.withBuilder(this.builderStop).withParent(Contents.MULTIPLAYER)));
|
||||
}));
|
||||
|
||||
button4.field_230693_o_ = false;
|
||||
button4.active = false;
|
||||
}
|
||||
else if(Page.WHITELIST.equals(this.page))
|
||||
{
|
||||
@@ -251,11 +251,11 @@ public class ContentMultiplayer extends Content
|
||||
|
||||
if(this.playerField.getText().isEmpty())
|
||||
{
|
||||
button6.field_230693_o_ = false;
|
||||
button7.field_230693_o_ = false;
|
||||
button6.active = false;
|
||||
button7.active = false;
|
||||
}
|
||||
|
||||
button5.field_230693_o_ = false;
|
||||
button5.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,12 +278,12 @@ public class ContentMultiplayer extends Content
|
||||
{
|
||||
if(Page.KICK_AND_BAN.equals(this.page))
|
||||
{
|
||||
this.reasonField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.reasonField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
if(!Page.RUNTIME.equals(this.page))
|
||||
{
|
||||
this.playerField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.playerField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,21 +183,21 @@ public class ContentNoteEditor extends Content
|
||||
RenderUtils.color(1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(NOTE);
|
||||
|
||||
container.func_238474_b_(matrix, x - 1, y - 1, 0, 0, 8, 59); //blit
|
||||
container.func_238474_b_(matrix, x - 1, y - 1 + 59, 0, 59, 13, 35); //blit
|
||||
container.blit(matrix, x - 1, y - 1, 0, 0, 8, 59);
|
||||
container.blit(matrix, x - 1, y - 1 + 59, 0, 59, 13, 35);
|
||||
|
||||
container.func_238474_b_(matrix, x - 1 + 232 - 5, y - 1, 18, 0, 7, 59); //blit
|
||||
container.func_238474_b_(matrix, x - 1 + 232 - 10, y - 1 + 59, 13, 59, 12, 35); //blit
|
||||
container.blit(matrix, x - 1 + 232 - 5, y - 1, 18, 0, 7, 59);
|
||||
container.blit(matrix, x - 1 + 232 - 10, y - 1 + 59, 13, 59, 12, 35);
|
||||
|
||||
container.func_238474_b_(matrix, x - 1 + 8, y - 1, 0, 94, 219, 1); //blit
|
||||
container.func_238474_b_(matrix, x - 1 + 13, y - 1 + 93, 0, 94, 209, 1); //blit
|
||||
container.blit(matrix, x - 1 + 8, y - 1, 0, 94, 219, 1);
|
||||
container.blit(matrix, x - 1 + 13, y - 1 + 93, 0, 94, 209, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
float scale = 4;
|
||||
|
||||
matrix.push();
|
||||
matrix.translate(container.field_230708_k_ / 2 - 8 * scale, container.field_230709_l_ / 2 - 15 - 8 * scale, 0);
|
||||
matrix.translate(container.width / 2 - 8 * scale, container.height / 2 - 15 - 8 * scale, 0);
|
||||
matrix.scale(scale, scale, scale);
|
||||
|
||||
RenderUtils.renderItemIntoGUI(matrix, new ItemStack(Blocks.NOTE_BLOCK), 0, 0);
|
||||
@@ -205,7 +205,7 @@ public class ContentNoteEditor extends Content
|
||||
|
||||
TranslationTextComponent text = new TranslationTextComponent("gui.worldhandler.blocks.note_block_editor.look_at_note_block", KeyHandler.KEY_WORLD_HANDLER.func_238171_j_());
|
||||
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
|
||||
fontRenderer.func_238422_b_(matrix, text, x + 116 - fontRenderer.func_238414_a_(text) / 2, y + 70, Config.getSkin().getLabelColor());
|
||||
fontRenderer.func_243248_b(matrix, text, x + 116 - fontRenderer.func_238414_a_(text) / 2, y + 70, Config.getSkin().getLabelColor());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,35 +87,35 @@ public class ContentPlayer extends Content
|
||||
container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.start"), () ->
|
||||
{
|
||||
this.page = Page.START;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.score"), () ->
|
||||
{
|
||||
this.page = Page.SCORE;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.position"), () ->
|
||||
{
|
||||
this.page = Page.POSITION;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.miscellaneous"), () ->
|
||||
{
|
||||
this.page = Page.MISC;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
if(Page.START.equals(this.page))
|
||||
{
|
||||
button1.field_230693_o_ = false;
|
||||
button1.active = false;
|
||||
}
|
||||
else if(Page.SCORE.equals(this.page))
|
||||
{
|
||||
button2.field_230693_o_ = false;
|
||||
button2.active = false;
|
||||
}
|
||||
else if(Page.POSITION.equals(this.page))
|
||||
{
|
||||
button3.field_230693_o_ = false;
|
||||
button3.active = false;
|
||||
|
||||
container.add(new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.position.copy_position"), () ->
|
||||
{
|
||||
@@ -128,21 +128,21 @@ public class ContentPlayer extends Content
|
||||
}
|
||||
else if(Page.MISC.equals(this.page))
|
||||
{
|
||||
button4.field_230693_o_ = false;
|
||||
button4.active = false;
|
||||
|
||||
container.add(new GuiButtonBase(x + 118, y, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.miscellaneous.set_spawn").func_240699_a_(TextFormatting.RED), () ->
|
||||
container.add(new GuiButtonBase(x + 118, y, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.miscellaneous.set_spawn").mergeStyle(TextFormatting.RED), () ->
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(Contents.CONTINUE.withBuilder(this.builderSpawnpoint).withParent(Contents.PLAYER)));
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 118, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.miscellaneous.set_global_spawn").func_240699_a_(TextFormatting.RED), () ->
|
||||
container.add(new GuiButtonBase(x + 118, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.miscellaneous.set_global_spawn").mergeStyle(TextFormatting.RED), () ->
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(Contents.CONTINUE.withBuilder(this.builderSetworldspawn).withParent(Contents.PLAYER)));
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 118, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.miscellaneous.kill").func_240699_a_(TextFormatting.RED), () ->
|
||||
container.add(new GuiButtonBase(x + 118, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.miscellaneous.kill").mergeStyle(TextFormatting.RED), () ->
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(Contents.CONTINUE.withBuilder(this.builderKill).withParent(Contents.PLAYER)));
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.miscellaneous.clear_inventory").func_240699_a_(TextFormatting.RED), () ->
|
||||
container.add(new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.miscellaneous.clear_inventory").mergeStyle(TextFormatting.RED), () ->
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(Contents.CONTINUE.withBuilder(this.builderClear).withParent(Contents.PLAYER)));
|
||||
}));
|
||||
@@ -169,8 +169,8 @@ public class ContentPlayer extends Content
|
||||
int yPos = y + 82;
|
||||
int playerNameWidth = Minecraft.getInstance().fontRenderer.func_238414_a_(Minecraft.getInstance().player.getName()) / 2;
|
||||
|
||||
AbstractGui.func_238467_a_(matrix, container.field_230708_k_ / 2 - playerNameWidth - 1 + 59, yPos - 74, container.field_230708_k_ / 2 + playerNameWidth + 1 + 59, yPos - 65, 0x3F000000);
|
||||
Minecraft.getInstance().fontRenderer.func_238422_b_(matrix, Minecraft.getInstance().player.getName(), container.field_230708_k_ / 2 - playerNameWidth + 59, yPos - 73, 0xE0E0E0);
|
||||
AbstractGui.fill(matrix, container.width / 2 - playerNameWidth - 1 + 59, yPos - 74, container.width / 2 + playerNameWidth + 1 + 59, yPos - 65, 0x3F000000);
|
||||
Minecraft.getInstance().fontRenderer.func_243248_b(matrix, Minecraft.getInstance().player.getName(), container.width / 2 - playerNameWidth + 59, yPos - 73, 0xE0E0E0);
|
||||
|
||||
RenderUtils.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
InventoryScreen.drawEntityOnScreen(xPos, yPos, 30, xPos - mouseX, yPos - mouseY - 44, Minecraft.getInstance().player);
|
||||
@@ -178,15 +178,15 @@ public class ContentPlayer extends Content
|
||||
}
|
||||
else if(Page.SCORE.equals(this.page))
|
||||
{
|
||||
this.scoreField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.xpField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.coinsField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.scoreField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.xpField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.coinsField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
else if(Page.POSITION.equals(this.page))
|
||||
{
|
||||
this.posXField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.posYField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.posZField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.posXField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.posYField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.posZField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,12 +121,12 @@ public class ContentPotions extends ContentChild
|
||||
container.add(new GuiButtonBase(x + 118, y + 36, 114, 20, new TranslationTextComponent("gui.worldhandler.potions.effect.remove"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPotion.getRemoveCommand());
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 118, y + 60, 114, 20, new TranslationTextComponent("gui.worldhandler.potions.effect.remove_all"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPotion.getClearCommand());
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
}
|
||||
else if(this.potionPage == 1)
|
||||
@@ -136,13 +136,13 @@ public class ContentPotions extends ContentChild
|
||||
container.add(new GuiButtonBase(x + 118, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.potions.effect.ambient", this.builderPotionItem.getAmbient(potion) ? new TranslationTextComponent("gui.worldhandler.generic.on") : new TranslationTextComponent("gui.worldhandler.generic.off")), () ->
|
||||
{
|
||||
this.builderPotionItem.setAmbient(potion, !this.builderPotionItem.getAmbient(potion));
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 118, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.potions.effect.particles", this.builderPotion.getHideParticles() ? new TranslationTextComponent("gui.worldhandler.generic.off") : new TranslationTextComponent("gui.worldhandler.generic.on")), () ->
|
||||
{
|
||||
this.builderPotion.setHideParticles(!this.builderPotion.getHideParticles());
|
||||
this.builderPotionItem.setShowParticles(potion, !this.builderPotionItem.getShowParticles(potion));
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(new GuiSlider(x + 118, y, 114, 20, 0, Config.getSliders().getMaxPotionAmplifier(), 0, container, new LogicSliderSimple("amplifier" + potion.getRegistryName(), new TranslationTextComponent("gui.worldhandler.potions.effect.amplifier"), value ->
|
||||
{
|
||||
@@ -176,40 +176,40 @@ public class ContentPotions extends ContentChild
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPotion.getGiveCommand());
|
||||
this.potionPage = 0;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x + 118, y + 24, 56, 20, new TranslationTextComponent("gui.worldhandler.potions.effect.tipped_arrow"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPotionItem.getBuilderForPotion(Items.TIPPED_ARROW));
|
||||
this.potionPage = 0;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button3 = new GuiButtonTooltip(x + 178, y + 24, 55, 20, new TranslationTextComponent("gui.worldhandler.potions.effect.bottle"), new TranslationTextComponent("gui.worldhandler.actions.place_command_block"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPotionItem.getBuilderForPotion(Items.POTION));
|
||||
this.potionPage = 0;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button4 = new GuiButtonTooltip(x + 118, y + 48, 56, 20, new TranslationTextComponent("gui.worldhandler.potions.effect.splash"), new TranslationTextComponent("gui.worldhandler.actions.place_command_block"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPotionItem.getBuilderForPotion(Items.SPLASH_POTION));
|
||||
this.potionPage = 0;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button5 = new GuiButtonTooltip(x + 178, y + 48, 55, 20, new TranslationTextComponent("gui.worldhandler.potions.effect.lingering"), new TranslationTextComponent("gui.worldhandler.actions.place_command_block"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPotionItem.getBuilderForPotion(Items.LINGERING_POTION));
|
||||
this.potionPage = 0;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
boolean enabled = this.builderPotion.getAmplifier() >= 0 && this.builderPotion.getDuration() > 0;
|
||||
|
||||
button1.field_230693_o_ = enabled;
|
||||
button2.field_230693_o_ = enabled;
|
||||
button3.field_230693_o_ = enabled;
|
||||
button4.field_230693_o_ = enabled;
|
||||
button5.field_230693_o_ = enabled;
|
||||
button1.active = enabled;
|
||||
button2.active = enabled;
|
||||
button3.active = enabled;
|
||||
button4.active = enabled;
|
||||
button5.active = enabled;
|
||||
}
|
||||
|
||||
if(this.potionPage > 0)
|
||||
@@ -217,21 +217,21 @@ public class ContentPotions extends ContentChild
|
||||
container.add(new GuiButtonBase(x + 118, y + 72, 56, 20, TextUtils.ARROW_LEFT, () ->
|
||||
{
|
||||
this.potionPage--;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button1 = new GuiButtonBase(x + 118 + 60, y + 72, 55, 20, TextUtils.ARROW_RIGHT, () ->
|
||||
{
|
||||
this.next(container);
|
||||
}));
|
||||
|
||||
button1.field_230693_o_ = this.potionPage < 3;
|
||||
button1.active = this.potionPage < 3;
|
||||
}
|
||||
}
|
||||
|
||||
private void next(Container container)
|
||||
{
|
||||
this.potionPage++;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -219,28 +219,28 @@ public class ContentScoreboardObjectives extends ContentScoreboard
|
||||
container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.objectives.create"), () ->
|
||||
{
|
||||
this.page = Page.CREATE;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.objectives.display"), () ->
|
||||
{
|
||||
this.page = Page.DISPLAY;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.objectives.undisplay"), () ->
|
||||
{
|
||||
this.page = Page.UNDISPLAY;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.objectives.remove"), () ->
|
||||
{
|
||||
this.page = Page.REMOVE;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
button1.field_230693_o_ = !Page.CREATE.equals(this.page);
|
||||
button2.field_230693_o_ = !Page.DISPLAY.equals(this.page);
|
||||
button3.field_230693_o_ = !Page.UNDISPLAY.equals(this.page);
|
||||
button4.field_230693_o_ = !Page.REMOVE.equals(this.page);
|
||||
button1.active = !Page.CREATE.equals(this.page);
|
||||
button2.active = !Page.DISPLAY.equals(this.page);
|
||||
button3.active = !Page.UNDISPLAY.equals(this.page);
|
||||
button4.active = !Page.REMOVE.equals(this.page);
|
||||
|
||||
if(Page.UNDISPLAY.equals(this.page))
|
||||
{
|
||||
@@ -260,9 +260,9 @@ public class ContentScoreboardObjectives extends ContentScoreboard
|
||||
container.add(button1 = new GuiButtonBase(x + 118, y + 72 - this.page.getShift(), 114, 20, new TranslationTextComponent("gui.worldhandler.actions.perform"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderObjectives);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
button1.field_230693_o_ = Page.UNDISPLAY.equals(this.page) || ContentScoreboard.isObjectiveValid();
|
||||
button1.active = Page.UNDISPLAY.equals(this.page) || ContentScoreboard.isObjectiveValid();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -279,7 +279,7 @@ public class ContentScoreboardObjectives extends ContentScoreboard
|
||||
{
|
||||
if(!Page.UNDISPLAY.equals(this.page))
|
||||
{
|
||||
this.objectField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.objectField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,22 +114,22 @@ public class ContentScoreboardPlayers extends ContentScoreboard
|
||||
container.add(button1 = new GuiButtonBase(x, y + 12, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.players.points"), () ->
|
||||
{
|
||||
this.page = Page.ADD_SET_REMOVE;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x, y + 36, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.players.tag"), () ->
|
||||
{
|
||||
this.page = Page.TAG;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button3 = new GuiButtonBase(x, y + 60, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.players.trigger"), () ->
|
||||
{
|
||||
this.page = Page.ENABLE;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
button1.field_230693_o_ = !Page.ADD_SET_REMOVE.equals(this.page);
|
||||
button2.field_230693_o_ = !Page.TAG.equals(this.page);
|
||||
button3.field_230693_o_ = !Page.ENABLE.equals(this.page);
|
||||
button1.active = !Page.ADD_SET_REMOVE.equals(this.page);
|
||||
button2.active = !Page.TAG.equals(this.page);
|
||||
button3.active = !Page.ENABLE.equals(this.page);
|
||||
|
||||
boolean enabled = ContentScoreboard.isObjectiveValid();
|
||||
this.builderPlayers.setMode(this.page.getMode());
|
||||
@@ -143,42 +143,42 @@ public class ContentScoreboardPlayers extends ContentScoreboard
|
||||
container.add(this.addButton = new GuiButtonBase(x + 118, y + 48, 56, 20, new TranslationTextComponent("gui.worldhandler.actions.add"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPlayers.getBuilderForPoints(EnumMode.ADD));
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(this.removeButton = new GuiButtonBase(x + 118 + 114 / 2 + 1, y + 48, 56, 20, new TranslationTextComponent("gui.worldhandler.actions.remove"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPlayers.getBuilderForPoints(EnumMode.REMOVE));
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button1 = new GuiButtonTooltip(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.reset"), new TranslationTextComponent("gui.worldhandler.actions.set_to_0"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPlayers.getBuilderForPoints(EnumMode.SET, 0));
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
boolean points = enabled && this.builderPlayers.getPoints() > 0;
|
||||
|
||||
this.addButton.field_230693_o_ = points;
|
||||
this.removeButton.field_230693_o_ = points;
|
||||
button1.field_230693_o_ = enabled;
|
||||
this.addButton.active = points;
|
||||
this.removeButton.active = points;
|
||||
button1.active = enabled;
|
||||
}
|
||||
else if(Page.TAG.equals(this.page))
|
||||
{
|
||||
container.add(button1 = new GuiButtonBase(x + 118, y + 36, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.add"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderTag.getBuilderForMode(BuilderTag.EnumMode.ADD));
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x + 118, y + 60, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.remove"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderTag.getBuilderForMode(BuilderTag.EnumMode.REMOVE));
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
boolean tag = this.tag != null && !this.tag.isEmpty();
|
||||
|
||||
button1.field_230693_o_ = tag;
|
||||
button2.field_230693_o_ = tag;
|
||||
button1.active = tag;
|
||||
button2.active = tag;
|
||||
}
|
||||
else if(Page.ENABLE.equals(this.page))
|
||||
{
|
||||
@@ -189,22 +189,22 @@ public class ContentScoreboardPlayers extends ContentScoreboard
|
||||
container.add(this.addButton = new GuiButtonBase(x + 118, y + 48, 56, 20, new TranslationTextComponent("gui.worldhandler.actions.add"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderTrigger.getBuilderForMode(BuilderTrigger.EnumMode.ADD));
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(this.removeButton = new GuiButtonBase(x + 118 + 114 / 2 + 1, y + 48, 56, 20, new TranslationTextComponent("gui.worldhandler.actions.set"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderTrigger.getBuilderForMode(BuilderTrigger.EnumMode.SET));
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button1 = new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.enable"), () ->
|
||||
{
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderPlayers.getBuilderForEnable());
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
this.addButton.field_230693_o_ = enabled && this.builderTrigger.getValue() > 0;
|
||||
this.removeButton.field_230693_o_ = enabled;
|
||||
button1.field_230693_o_ = enabled;
|
||||
this.addButton.active = enabled && this.builderTrigger.getValue() > 0;
|
||||
this.removeButton.active = enabled;
|
||||
button1.active = enabled;
|
||||
}
|
||||
|
||||
if(Page.TAG.equals(this.page))
|
||||
@@ -234,13 +234,13 @@ public class ContentScoreboardPlayers extends ContentScoreboard
|
||||
{
|
||||
boolean points = enabled && this.builderPlayers.getPoints() > 0;
|
||||
|
||||
this.addButton.field_230693_o_ = points;
|
||||
this.removeButton.field_230693_o_ = points;
|
||||
this.addButton.active = points;
|
||||
this.removeButton.active = points;
|
||||
}
|
||||
else if(Page.ENABLE.equals(this.page))
|
||||
{
|
||||
this.addButton.field_230693_o_ = enabled && this.builderTrigger.getValue() > 0;
|
||||
this.removeButton.field_230693_o_ = enabled;
|
||||
this.addButton.active = enabled && this.builderTrigger.getValue() > 0;
|
||||
this.removeButton.active = enabled;
|
||||
}
|
||||
|
||||
this.objectField.tick();
|
||||
@@ -252,11 +252,11 @@ public class ContentScoreboardPlayers extends ContentScoreboard
|
||||
{
|
||||
if(Page.TAG.equals(this.page))
|
||||
{
|
||||
this.tagField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.tagField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.objectField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.objectField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,28 +123,28 @@ public class ContentScoreboardTeams extends ContentScoreboard
|
||||
container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.team.create"), () ->
|
||||
{
|
||||
this.page = Page.ADD;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new StringTextComponent(I18n.format("gui.worldhandler.scoreboard.team.join") + " / " + I18n.format("gui.worldhandler.scoreboard.team.leave")), () ->
|
||||
{
|
||||
this.page = Page.JOIN_OR_LEAVE;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new StringTextComponent(I18n.format("gui.worldhandler.scoreboard.team.remove") + " / " + I18n.format("gui.worldhandler.scoreboard.team.empty")), () ->
|
||||
{
|
||||
this.page = Page.REMOVE_OR_EMPTY;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.team.options"), () ->
|
||||
{
|
||||
this.page = Page.OPTION;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
button1.field_230693_o_ = !Page.ADD.equals(this.page);
|
||||
button2.field_230693_o_ = !Page.JOIN_OR_LEAVE.equals(this.page);
|
||||
button3.field_230693_o_ = !Page.REMOVE_OR_EMPTY.equals(this.page);
|
||||
button4.field_230693_o_ = !Page.OPTION.equals(this.page);
|
||||
button1.active = !Page.ADD.equals(this.page);
|
||||
button2.active = !Page.JOIN_OR_LEAVE.equals(this.page);
|
||||
button3.active = !Page.REMOVE_OR_EMPTY.equals(this.page);
|
||||
button4.active = !Page.OPTION.equals(this.page);
|
||||
|
||||
this.builderTeams.setMode(this.page.getMode());
|
||||
|
||||
@@ -169,7 +169,7 @@ public class ContentScoreboardTeams extends ContentScoreboard
|
||||
container.initButtons();
|
||||
}));
|
||||
|
||||
button1.field_230693_o_ = enabled;
|
||||
button1.active = enabled;
|
||||
}
|
||||
else if(Page.REMOVE_OR_EMPTY.equals(this.page))
|
||||
{
|
||||
@@ -184,8 +184,8 @@ public class ContentScoreboardTeams extends ContentScoreboard
|
||||
container.initButtons();
|
||||
}));
|
||||
|
||||
button1.field_230693_o_ = enabled;
|
||||
button2.field_230693_o_ = enabled;
|
||||
button1.active = enabled;
|
||||
button2.active = enabled;
|
||||
}
|
||||
|
||||
if(Page.ADD.equals(this.page) || Page.OPTION.equals(this.page))
|
||||
@@ -195,7 +195,7 @@ public class ContentScoreboardTeams extends ContentScoreboard
|
||||
CommandHelper.sendCommand(container.getPlayer(), this.builderTeams);
|
||||
container.initButtons();
|
||||
}));
|
||||
button1.field_230693_o_ = enabled;
|
||||
button1.active = enabled;
|
||||
}
|
||||
|
||||
container.add(this.teamField);
|
||||
@@ -210,7 +210,7 @@ public class ContentScoreboardTeams extends ContentScoreboard
|
||||
@Override
|
||||
public void drawScreen(MatrixStack matrix, Container container, int x, int y, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
this.teamField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.teamField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -128,18 +128,18 @@ public class ContentSettings extends ContentChild
|
||||
container.add(button1 = new GuiButtonBase(x + 118, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.enable"), () ->
|
||||
{
|
||||
setting.set(true);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x + 118, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.disable"), () ->
|
||||
{
|
||||
setting.set(false);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
boolean enabled = setting.get();
|
||||
|
||||
button1.field_230693_o_ = !enabled;
|
||||
button2.field_230693_o_ = enabled;
|
||||
button1.active = !enabled;
|
||||
button2.active = enabled;
|
||||
}
|
||||
else if(this.setting instanceof IntegerSetting)
|
||||
{
|
||||
@@ -160,7 +160,7 @@ public class ContentSettings extends ContentChild
|
||||
setting.set(Integer.parseInt(text));
|
||||
}
|
||||
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public class ContentSettings extends ContentChild
|
||||
{
|
||||
if(this.setting instanceof IntegerSetting)
|
||||
{
|
||||
this.valueField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.valueField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,22 +112,22 @@ public class ContentSignEditor extends Content
|
||||
container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.text_line_1"), () ->
|
||||
{
|
||||
this.selectedLine = 0;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.text_line_2"), () ->
|
||||
{
|
||||
this.selectedLine = 1;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.text_line_3"), () ->
|
||||
{
|
||||
this.selectedLine = 2;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.text_line_4"), () ->
|
||||
{
|
||||
this.selectedLine = 3;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
if(this.editColor)
|
||||
@@ -144,10 +144,10 @@ public class ContentSignEditor extends Content
|
||||
}));
|
||||
}
|
||||
|
||||
button1.field_230693_o_ = this.selectedLine != 0;
|
||||
button2.field_230693_o_ = this.selectedLine != 1;
|
||||
button3.field_230693_o_ = this.selectedLine != 2;
|
||||
button4.field_230693_o_ = this.selectedLine != 3;
|
||||
button1.active = this.selectedLine != 0;
|
||||
button2.active = this.selectedLine != 1;
|
||||
button3.active = this.selectedLine != 2;
|
||||
button4.active = this.selectedLine != 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ public class ContentSignEditor extends Content
|
||||
private void toggleEditColor(Container container)
|
||||
{
|
||||
this.editColor = !this.editColor;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -173,7 +173,7 @@ public class ContentSignEditor extends Content
|
||||
{
|
||||
if(!this.editColor)
|
||||
{
|
||||
this.commandField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.commandField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -181,7 +181,7 @@ public class ContentSignEditor extends Content
|
||||
float scale = 4;
|
||||
|
||||
matrix.push();
|
||||
matrix.translate(container.field_230708_k_ / 2 - 8.5F * scale, container.field_230709_l_ / 2 - 15 - 8.5F * scale, 0);
|
||||
matrix.translate(container.width / 2 - 8.5F * scale, container.height / 2 - 15 - 8.5F * scale, 0);
|
||||
matrix.scale(scale, scale, scale);
|
||||
|
||||
RenderUtils.renderItemIntoGUI(matrix, new ItemStack(Items.OAK_SIGN), 0, 0);
|
||||
@@ -189,7 +189,7 @@ public class ContentSignEditor extends Content
|
||||
|
||||
TranslationTextComponent text = new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.look_at_sign", KeyHandler.KEY_WORLD_HANDLER.func_238171_j_());
|
||||
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
|
||||
fontRenderer.func_238422_b_(matrix, text, x + 116 - fontRenderer.func_238414_a_(text) / 2, y + 70, Config.getSkin().getLabelColor());
|
||||
fontRenderer.func_243248_b(matrix, text, x + 116 - fontRenderer.func_238414_a_(text) / 2, y + 70, Config.getSkin().getLabelColor());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ContentSummon extends Content
|
||||
Items.CHAINMAIL_HELMET.getRegistryName(),
|
||||
Items.GOLDEN_HELMET.getRegistryName(),
|
||||
Items.DIAMOND_HELMET.getRegistryName(),
|
||||
Items.field_234763_ls_.getRegistryName() // netherite_helmet
|
||||
Items.NETHERITE_HELMET.getRegistryName()
|
||||
};
|
||||
private final ResourceLocation[] chestplates =
|
||||
{
|
||||
@@ -82,7 +82,7 @@ public class ContentSummon extends Content
|
||||
Items.CHAINMAIL_CHESTPLATE.getRegistryName(),
|
||||
Items.GOLDEN_CHESTPLATE.getRegistryName(),
|
||||
Items.DIAMOND_CHESTPLATE.getRegistryName(),
|
||||
Items.field_234764_lt_.getRegistryName() // netherite_chestplate
|
||||
Items.NETHERITE_CHESTPLATE.getRegistryName()
|
||||
};
|
||||
private final ResourceLocation[] leggings =
|
||||
{
|
||||
@@ -92,7 +92,7 @@ public class ContentSummon extends Content
|
||||
Items.CHAINMAIL_LEGGINGS.getRegistryName(),
|
||||
Items.GOLDEN_LEGGINGS.getRegistryName(),
|
||||
Items.DIAMOND_LEGGINGS.getRegistryName(),
|
||||
Items.field_234765_lu_.getRegistryName() // netherite_leggings
|
||||
Items.NETHERITE_LEGGINGS.getRegistryName()
|
||||
};
|
||||
private final ResourceLocation[] boots =
|
||||
{
|
||||
@@ -102,7 +102,7 @@ public class ContentSummon extends Content
|
||||
Items.CHAINMAIL_BOOTS.getRegistryName(),
|
||||
Items.GOLDEN_BOOTS.getRegistryName(),
|
||||
Items.DIAMOND_BOOTS.getRegistryName(),
|
||||
Items.field_234766_lv_.getRegistryName() // netherite_boots
|
||||
Items.NETHERITE_BOOTS.getRegistryName()
|
||||
};
|
||||
private final ResourceLocation[] swords =
|
||||
{
|
||||
@@ -112,7 +112,7 @@ public class ContentSummon extends Content
|
||||
Items.IRON_SWORD.getRegistryName(),
|
||||
Items.GOLDEN_SWORD.getRegistryName(),
|
||||
Items.DIAMOND_SWORD.getRegistryName(),
|
||||
Items.field_234754_kI_.getRegistryName() // netherite_sword
|
||||
Items.NETHERITE_SWORD.getRegistryName()
|
||||
};
|
||||
private final ResourceLocation[][] armor = {this.helmets, this.chestplates, this.leggings, this.boots};
|
||||
private final ResourceLocation[][] hands = {this.swords, this.swords};
|
||||
@@ -252,27 +252,27 @@ public class ContentSummon extends Content
|
||||
container.add(button4 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.start"), () ->
|
||||
{
|
||||
this.page = Page.START;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button5 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.potion_effects"), () ->
|
||||
{
|
||||
this.page = Page.POTIONS;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button6 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.attributes"), () ->
|
||||
{
|
||||
this.page = Page.ATTRIBUTES;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button7 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.equipment"), () ->
|
||||
{
|
||||
this.page = Page.EQUIPMENT;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
if(Page.START.equals(this.page))
|
||||
{
|
||||
button4.field_230693_o_ = false;
|
||||
button4.active = false;
|
||||
|
||||
container.add(this.mobField);
|
||||
container.add(this.customNameField);
|
||||
@@ -287,21 +287,21 @@ public class ContentSummon extends Content
|
||||
container.add(button3 = new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.place_command_block"), () -> this.send(container.getPlayer())));
|
||||
}
|
||||
|
||||
button3.field_230693_o_ = ForgeRegistries.ENTITIES.containsKey(this.builderSummon.getEntity());
|
||||
button3.active = ForgeRegistries.ENTITIES.containsKey(this.builderSummon.getEntity());
|
||||
}
|
||||
else if(Page.POTIONS.equals(this.page))
|
||||
{
|
||||
button5.field_230693_o_ = false;
|
||||
button5.active = false;
|
||||
|
||||
container.add(button1 = new GuiButtonBase(x + 118, y + 72, 56, 20, TextUtils.ARROW_LEFT, () ->
|
||||
{
|
||||
this.potionPage--;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button2 = new GuiButtonBase(x + 118 + 60, y + 72, 55, 20, TextUtils.ARROW_RIGHT, () ->
|
||||
{
|
||||
this.potionPage++;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
int count = 0;
|
||||
@@ -314,12 +314,12 @@ public class ContentSummon extends Content
|
||||
{
|
||||
if(this.potionPage == 0)
|
||||
{
|
||||
button1.field_230693_o_ = false;
|
||||
button1.active = false;
|
||||
}
|
||||
|
||||
if(this.potionPage == ForgeRegistries.POTIONS.getKeys().size() - 3)
|
||||
{
|
||||
button2.field_230693_o_ = false;
|
||||
button2.active = false;
|
||||
}
|
||||
|
||||
if(count == this.potionPage)
|
||||
@@ -335,7 +335,7 @@ public class ContentSummon extends Content
|
||||
container.add(new GuiButtonBase(x + 118, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.potions.effect.particles", this.builderSummon.getShowParticles(potion) ? new TranslationTextComponent("gui.worldhandler.generic.on") : new TranslationTextComponent("gui.worldhandler.generic.off")), () ->
|
||||
{
|
||||
this.builderSummon.setShowParticles(potion, !this.builderSummon.getShowParticles(potion));
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
break;
|
||||
}
|
||||
@@ -346,7 +346,7 @@ public class ContentSummon extends Content
|
||||
}
|
||||
else if(Page.ATTRIBUTES.equals(this.page))
|
||||
{
|
||||
button6.field_230693_o_ = false;
|
||||
button6.active = false;
|
||||
}
|
||||
else if(Page.EQUIPMENT.equals(this.page))
|
||||
{
|
||||
@@ -357,16 +357,16 @@ public class ContentSummon extends Content
|
||||
container.add(new GuiButtonBase(x + 118, y + 24 * i, 20, 20, TextUtils.ARROW_LEFT, () ->
|
||||
{
|
||||
this.builderSummon.setArmorItem(3 - index, this.armor[index][Math.floorMod(ArrayUtils.indexOf(this.armor[index], this.builderSummon.getArmorItem(3 - index)) - 1, this.armor[index].length)]);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button1 = new GuiButtonItem(x + 118 + 24, y + 24 * i, 20, 20, ForgeRegistries.ITEMS.getValue(this.builderSummon.getArmorItem(3 - i)), null));
|
||||
container.add(new GuiButtonBase(x + 118 + 47, y + 24 * i, 20, 20, TextUtils.ARROW_RIGHT, () ->
|
||||
{
|
||||
this.builderSummon.setArmorItem(3 - index, this.armor[index][Math.floorMod(ArrayUtils.indexOf(this.armor[index], this.builderSummon.getArmorItem(3 - index)) + 1, this.armor[index].length)]);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
button1.field_230693_o_ = false;
|
||||
button1.active = false;
|
||||
}
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
@@ -376,19 +376,19 @@ public class ContentSummon extends Content
|
||||
container.add(new GuiButtonIcon(x + 118 + 70 + 24 * i, y + 12, 20, 20, EnumIcon.ARROW_UP, null, () ->
|
||||
{
|
||||
this.builderSummon.setHandItem(index, this.hands[index][Math.floorMod(ArrayUtils.indexOf(this.hands[index], this.builderSummon.getHandItem(index)) - 1, this.hands[index].length)]);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(button1 = new GuiButtonItem(x + 118 + 70 + 24 * i, y + 36, 20, 20, ForgeRegistries.ITEMS.getValue(this.builderSummon.getHandItem(i)), null));
|
||||
container.add(new GuiButtonIcon(x + 118 + 70 + 24 * i, y + 60, 20, 20, EnumIcon.ARROW_DOWN, null, () ->
|
||||
{
|
||||
this.builderSummon.setHandItem(index, this.hands[index][Math.floorMod(ArrayUtils.indexOf(this.hands[index], this.builderSummon.getHandItem(index)) + 1, this.hands[index].length)]);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
button1.field_230693_o_ = false;
|
||||
button1.active = false;
|
||||
}
|
||||
|
||||
button7.field_230693_o_ = false;
|
||||
button7.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,25 +413,25 @@ public class ContentSummon extends Content
|
||||
{
|
||||
if(Page.START.equals(this.page))
|
||||
{
|
||||
this.mobField.func_230431_b_(matrix, mouseX, mouseY, partialTicks);
|
||||
this.customNameField.func_230431_b_(matrix, mouseX, mouseY, partialTicks);
|
||||
this.passengerField.func_230431_b_(matrix, mouseX, mouseY, partialTicks);
|
||||
this.mobField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.customNameField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.passengerField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
else if(Page.POTIONS.equals(this.page))
|
||||
{
|
||||
Minecraft.getInstance().fontRenderer.func_238421_b_(matrix, (this.potionPage + 1) + "/" + (ForgeRegistries.POTIONS.getKeys().size() - 2), x + 118, y - 11, Config.getSkin().getHeadlineColor());
|
||||
Minecraft.getInstance().fontRenderer.drawString(matrix, (this.potionPage + 1) + "/" + (ForgeRegistries.POTIONS.getKeys().size() - 2), x + 118, y - 11, Config.getSkin().getHeadlineColor());
|
||||
}
|
||||
else if(Page.EQUIPMENT.equals(this.page))
|
||||
{
|
||||
RenderUtils.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/beacon.png"));
|
||||
container.func_230926_e_(0); //setBlitOffset
|
||||
container.setBlitOffset(0);
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
if(this.builderSummon.getArmorItem(3 - i).equals(Items.AIR.getRegistryName()))
|
||||
{
|
||||
container.func_238474_b_(matrix, x + 118 + 24 + 2, y + 2 + 24 * i, 112, 221, 16, 16); //blit
|
||||
container.blit(matrix, x + 118 + 24 + 2, y + 2 + 24 * i, 112, 221, 16, 16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ public class ContentSummon extends Content
|
||||
{
|
||||
if(this.builderSummon.getHandItem(i).equals(Items.AIR.getRegistryName()))
|
||||
{
|
||||
container.func_238474_b_(matrix, x + 118 + 70 + 2 + 24 * i, y + 2 + 36, 112, 221, 16, 16); //blit
|
||||
container.blit(matrix, x + 118 + 70 + 2 + 24 * i, y + 2 + 36, 112, 221, 16, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,9 +141,9 @@ public class ContentUsercontent extends Content
|
||||
{
|
||||
for(VisibleObject<TextFieldWidget> textfield : this.textfields.values())
|
||||
{
|
||||
if(textfield.getObject().field_230694_p_)
|
||||
if(textfield.getObject().visible)
|
||||
{
|
||||
textfield.getObject().func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
textfield.getObject().renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public class ContentUsercontent extends Content
|
||||
{
|
||||
if(text.getVisible() == null || text.getVisible().eval(this.engineAdapter))
|
||||
{
|
||||
container.getMinecraft().fontRenderer.func_238422_b_(matrix, TextUtils.formatNonnull(text.getText()), text.getX() + x, text.getY() + y, text.getColor());
|
||||
container.getMinecraft().fontRenderer.func_243248_b(matrix, TextUtils.formatNonnull(text.getText()), text.getX() + x, text.getY() + y, text.getColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,7 +257,7 @@ public class ContentUsercontent extends Content
|
||||
private void printError(String type, int index, Throwable e)
|
||||
{
|
||||
ITextComponent message = new StringTextComponent(TextFormatting.RED + "<" + Main.NAME + ":" + this.id + ":" + type + ":" + index + "> " + e.getMessage());
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.CHAT, message, Util.field_240973_b_);
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.CHAT, message, Util.DUMMY_UUID);
|
||||
}
|
||||
|
||||
private void updateTextfields()
|
||||
@@ -265,7 +265,7 @@ public class ContentUsercontent extends Content
|
||||
for(VisibleActiveObject<TextFieldWidget> visObj : this.textfields.values())
|
||||
{
|
||||
visObj.getObject().setEnabled(visObj.isEnabled(this.engineAdapter));
|
||||
visObj.getObject().field_230694_p_ = visObj.isVisible(this.engineAdapter);
|
||||
visObj.getObject().setVisible(visObj.isVisible(this.engineAdapter));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,8 +273,8 @@ public class ContentUsercontent extends Content
|
||||
{
|
||||
for(VisibleActiveObject<Widget> visObj : this.buttons)
|
||||
{
|
||||
visObj.getObject().field_230693_o_ = visObj.isEnabled(this.engineAdapter);
|
||||
visObj.getObject().field_230694_p_ = visObj.isVisible(this.engineAdapter);
|
||||
visObj.getObject().active = visObj.isEnabled(this.engineAdapter);
|
||||
visObj.getObject().visible = visObj.isVisible(this.engineAdapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,39 +80,39 @@ public class ContentWorldInfo extends Content
|
||||
container.add(start = new GuiButtonBase(x, y + 12, 114, 20, new TranslationTextComponent("gui.worldhandler.world_info.start"), () ->
|
||||
{
|
||||
this.page = Page.START;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(world = new GuiButtonBase(x, y + 36, 114, 20, new TranslationTextComponent("gui.worldhandler.world_info.world"), () ->
|
||||
{
|
||||
this.page = Page.WORLD;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
container.add(stats = new GuiButtonBase(x, y + 60, 114, 20, new TranslationTextComponent("gui.worldhandler.world_info.statistics"), () ->
|
||||
{
|
||||
this.page = Page.STATS;
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}));
|
||||
|
||||
if(Page.START.equals(this.page))
|
||||
{
|
||||
start.field_230693_o_ = false;
|
||||
start.active = false;
|
||||
}
|
||||
else if(Page.WORLD.equals(this.page))
|
||||
{
|
||||
GuiButtonBase seed;
|
||||
IntegratedServer server = Minecraft.getInstance().getIntegratedServer();
|
||||
|
||||
world.field_230693_o_ = false;
|
||||
world.active = false;
|
||||
container.add(seed = new GuiButtonBase(x + 118, y + 60, 114, 20, new TranslationTextComponent("gui.worldhandler.world_info.world.copy_seed"), () ->
|
||||
{
|
||||
Minecraft.getInstance().keyboardListener.setClipboardString(String.valueOf(server.func_241755_D_().getSeed()));
|
||||
}));
|
||||
|
||||
seed.field_230693_o_ = server != null;
|
||||
seed.active = server != null;
|
||||
}
|
||||
else if(Page.STATS.equals(this.page))
|
||||
{
|
||||
stats.field_230693_o_ = false;
|
||||
stats.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,19 +129,19 @@ public class ContentWorldInfo extends Content
|
||||
{
|
||||
if(Page.START.equals(this.page))
|
||||
{
|
||||
this.posXField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.posYField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.posZField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.posXField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.posYField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.posZField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
else if(Page.WORLD.equals(this.page))
|
||||
{
|
||||
this.worldField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.seedField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.worldField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.seedField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
else if(Page.STATS.equals(this.page))
|
||||
{
|
||||
this.totalTimeField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.currentTimeField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.totalTimeField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
this.currentTimeField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ public interface ILogicMapped<T> extends ILogic
|
||||
|
||||
if(tooltip != null)
|
||||
{
|
||||
return tooltip.func_240702_b_(String.format(" (%d/%d)", index, max));
|
||||
return tooltip.appendString(String.format(" (%d/%d)", index, max));
|
||||
}
|
||||
|
||||
return (IFormattableTextComponent) StringTextComponent.field_240750_d_;
|
||||
return (IFormattableTextComponent) StringTextComponent.EMPTY;
|
||||
}
|
||||
|
||||
void onClick(T item);
|
||||
|
||||
@@ -77,7 +77,7 @@ public class MenuButtonList extends Menu
|
||||
public void onClick(Node item)
|
||||
{
|
||||
MenuButtonList.this.getPersistence(container, 1).setIndex(0);
|
||||
container.func_231160_c_();
|
||||
container.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,8 +99,8 @@ public class MenuButtonList extends Menu
|
||||
{
|
||||
for(int x = this.getDepth() + 1; x < this.maxDepth; x++)
|
||||
{
|
||||
GuiButtonBase button = new GuiButtonBase(this.x, this.y + 24 * x, 114, 20, StringTextComponent.field_240750_d_, null);
|
||||
button.field_230693_o_ = false;
|
||||
GuiButtonBase button = new GuiButtonBase(this.x, this.y + 24 * x, 114, 20, StringTextComponent.EMPTY, null);
|
||||
button.active = false;
|
||||
container.add(button);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class MenuColorField extends Menu
|
||||
@Override
|
||||
public IFormattableTextComponent translate(TextFormatting item)
|
||||
{
|
||||
return new TranslationTextComponent("gui.worldhandler.color").func_240699_a_(item).func_240702_b_(": ").func_230529_a_(new TranslationTextComponent("gui.worldhandler.color." + item.getFriendlyName()));
|
||||
return new TranslationTextComponent("gui.worldhandler.color").mergeStyle(item).appendString(": ").append(new TranslationTextComponent("gui.worldhandler.color." + item.getFriendlyName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,7 +106,7 @@ public class MenuColorField extends Menu
|
||||
@Override
|
||||
public void onClick(TextFormatting item)
|
||||
{
|
||||
MenuColorField.this.string.func_240699_a_(item);
|
||||
MenuColorField.this.string.mergeStyle(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,30 +116,30 @@ public class MenuColorField extends Menu
|
||||
}
|
||||
}));
|
||||
|
||||
container.add(new GuiButtonBase(this.x + 118, this.y + 48, 20, 20, new StringTextComponent("I").func_240703_c_(Style.field_240709_b_.func_240722_b_(this.string.getStyle().getItalic())), () ->
|
||||
container.add(new GuiButtonBase(this.x + 118, this.y + 48, 20, 20, new StringTextComponent("I").setStyle(Style.EMPTY.setItalic(this.string.getStyle().getItalic())), () ->
|
||||
{
|
||||
this.string.func_240703_c_(this.string.getStyle().func_240722_b_(!this.string.getStyle().getItalic()));
|
||||
container.func_231160_c_();
|
||||
this.string.setStyle(this.string.getStyle().setItalic(!this.string.getStyle().getItalic()));
|
||||
container.init();
|
||||
}));
|
||||
container.add(new GuiButtonBase(this.x + 118 + 24 - 1, this.y + 48, 20, 20, new StringTextComponent("B").func_240703_c_(Style.field_240709_b_.func_240713_a_(this.string.getStyle().getBold())), () ->
|
||||
container.add(new GuiButtonBase(this.x + 118 + 24 - 1, this.y + 48, 20, 20, new StringTextComponent("B").setStyle(Style.EMPTY.setBold(this.string.getStyle().getBold())), () ->
|
||||
{
|
||||
this.string.func_240703_c_(this.string.getStyle().func_240713_a_(!this.string.getStyle().getBold()));
|
||||
container.func_231160_c_();
|
||||
this.string.setStyle(this.string.getStyle().setItalic(!this.string.getStyle().getBold()));
|
||||
container.init();
|
||||
}));
|
||||
container.add(new GuiButtonBase(this.x + 118 + 24 * 2 - 1, this.y + 48, 20, 20, new StringTextComponent("U").func_240703_c_(Style.field_240709_b_.setUnderlined(this.string.getStyle().getUnderlined())), () ->
|
||||
container.add(new GuiButtonBase(this.x + 118 + 24 * 2 - 1, this.y + 48, 20, 20, new StringTextComponent("U").setStyle(Style.EMPTY.setUnderlined(this.string.getStyle().getUnderlined())), () ->
|
||||
{
|
||||
this.string.func_240703_c_(this.string.getStyle().setUnderlined(!this.string.getStyle().getUnderlined()));
|
||||
container.func_231160_c_();
|
||||
this.string.setStyle(this.string.getStyle().setUnderlined(!this.string.getStyle().getUnderlined()));
|
||||
container.init();
|
||||
}));
|
||||
container.add(new GuiButtonBase(this.x + 118 + 24 * 3 - 1, this.y + 48, 20, 20, new StringTextComponent("S").func_240703_c_(Style.field_240709_b_.setStrikethrough(this.string.getStyle().getStrikethrough())), () ->
|
||||
container.add(new GuiButtonBase(this.x + 118 + 24 * 3 - 1, this.y + 48, 20, 20, new StringTextComponent("S").setStyle(Style.EMPTY.setStrikethrough(this.string.getStyle().getStrikethrough())), () ->
|
||||
{
|
||||
this.string.func_240703_c_(this.string.getStyle().setStrikethrough(!this.string.getStyle().getStrikethrough()));
|
||||
container.func_231160_c_();
|
||||
this.string.setStyle(this.string.getStyle().setStrikethrough(!this.string.getStyle().getStrikethrough()));
|
||||
container.init();
|
||||
}));
|
||||
container.add(new GuiButtonBase(this.x + 118 + 24 * 4 - 2, this.y + 48, 20, 20, new StringTextComponent("O").func_240703_c_(Style.field_240709_b_.setObfuscated(this.string.getStyle().getObfuscated())), () ->
|
||||
container.add(new GuiButtonBase(this.x + 118 + 24 * 4 - 2, this.y + 48, 20, 20, new StringTextComponent("O").setStyle(Style.EMPTY.setObfuscated(this.string.getStyle().getObfuscated())), () ->
|
||||
{
|
||||
this.string.func_240703_c_(this.string.getStyle().setObfuscated(!this.string.getStyle().getObfuscated()));
|
||||
container.func_231160_c_();
|
||||
this.string.setStyle(this.string.getStyle().setObfuscated(!this.string.getStyle().getObfuscated()));
|
||||
container.init();
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -153,6 +153,6 @@ public class MenuColorField extends Menu
|
||||
@Override
|
||||
public void draw(MatrixStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
this.textField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton
|
||||
this.textField.renderButton(matrix, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,11 +60,11 @@ public class MenuPageList<T> extends Menu
|
||||
int buttonWidth = (this.width - 4) / 2;
|
||||
|
||||
GuiButtonBase left = new GuiButtonBase(this.x, this.y + (this.height + 4) * this.length, buttonWidth + 1, this.height, TextUtils.ARROW_LEFT, () -> this.goLeft(container));
|
||||
left.field_230693_o_ = this.persistence.getPage() > 0;
|
||||
left.active = this.persistence.getPage() > 0;
|
||||
container.add(left);
|
||||
|
||||
GuiButtonBase right = new GuiButtonBase(this.x + 5 + buttonWidth, this.y + (this.height + 4) * this.length, buttonWidth, this.height, TextUtils.ARROW_RIGHT, () -> this.goRight(container));
|
||||
right.field_230693_o_ = this.persistence.getPage() < this.getTotalPages() - 1;
|
||||
right.active = this.persistence.getPage() < this.getTotalPages() - 1;
|
||||
container.add(right);
|
||||
}
|
||||
|
||||
@@ -87,13 +87,13 @@ public class MenuPageList<T> extends Menu
|
||||
|
||||
if(this.logic.doDisable())
|
||||
{
|
||||
button.field_230693_o_ = this.persistence.getSelectedIndex() != index;
|
||||
button.active = this.persistence.getSelectedIndex() != index;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
button = new GuiButtonBase(this.x, this.y + (this.height + 4) * x, this.width, this.height, StringTextComponent.field_240750_d_, null);
|
||||
button.field_230693_o_ = false;
|
||||
button = new GuiButtonBase(this.x, this.y + (this.height + 4) * x, this.width, this.height, StringTextComponent.EMPTY, null);
|
||||
button.active = false;
|
||||
}
|
||||
|
||||
container.add(button);
|
||||
@@ -109,14 +109,14 @@ public class MenuPageList<T> extends Menu
|
||||
@Override
|
||||
public void draw(MatrixStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
Minecraft.getInstance().fontRenderer.func_238421_b_(matrix, String.format("%d/%d", this.persistence.getPage() + 1, this.getTotalPages()), this.x, this.y - 11, Config.getSkin().getHeadlineColor());
|
||||
Minecraft.getInstance().fontRenderer.drawString(matrix, String.format("%d/%d", this.persistence.getPage() + 1, this.getTotalPages()), this.x, this.y - 11, Config.getSkin().getHeadlineColor());
|
||||
}
|
||||
|
||||
private void goLeft(Container container)
|
||||
{
|
||||
int page = this.persistence.getPage();
|
||||
|
||||
if(Screen.func_231173_s_())
|
||||
if(Screen.hasShiftDown())
|
||||
{
|
||||
this.persistence.setPage(page - Math.min(10, page));
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public class MenuPageList<T> extends Menu
|
||||
{
|
||||
int page = this.persistence.getPage();
|
||||
|
||||
if(Screen.func_231173_s_())
|
||||
if(Screen.hasShiftDown())
|
||||
{
|
||||
this.persistence.setPage(page + Math.min(10, this.getTotalPages() - 1 - page));
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package exopandora.worldhandler.render;
|
||||
|
||||
import java.util.OptionalDouble;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.RenderState;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public abstract class CustomRenderType extends RenderType
|
||||
{
|
||||
public static final RenderType LINES2 = RenderType.makeType("lines2",
|
||||
DefaultVertexFormats.POSITION_COLOR,
|
||||
GL11.GL_LINES,
|
||||
256,
|
||||
RenderType.State.getBuilder()
|
||||
.line(new RenderState.LineState(OptionalDouble.empty()))
|
||||
.layer(field_239235_M_)
|
||||
.transparency(TRANSLUCENT_TRANSPARENCY)
|
||||
.writeMask(COLOR_DEPTH_WRITE)
|
||||
.build(false));
|
||||
|
||||
public CustomRenderType(String nameIn, VertexFormat formatIn, int drawModeIn, int bufferSizeIn, boolean useDelegateIn, boolean needsSortingIn, Runnable setupTaskIn, Runnable clearTaskIn)
|
||||
{
|
||||
super(nameIn, formatIn, drawModeIn, bufferSizeIn, useDelegateIn, needsSortingIn, setupTaskIn, clearTaskIn);
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class UsercontentAPI
|
||||
{
|
||||
if(object != null)
|
||||
{
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.CHAT, new StringTextComponent(object.toString()), Util.field_240973_b_);
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.CHAT, new StringTextComponent(object.toString()), Util.DUMMY_UUID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -163,11 +163,11 @@ public class ActionHelper
|
||||
Minecraft.getInstance().displayGuiScreen(null);
|
||||
Minecraft.getInstance().mouseHelper.grabMouse();
|
||||
|
||||
ITextComponent message = new TranslationTextComponent("<" + Main.NAME + "> %s", new TranslationTextComponent("worldhandler.error.gui")).func_240699_a_(TextFormatting.RED);
|
||||
ITextComponent cause = new StringTextComponent(" " + e.getClass().getCanonicalName() + ": " + e.getMessage()).func_240699_a_(TextFormatting.RED);
|
||||
ITextComponent message = new TranslationTextComponent("<" + Main.NAME + "> %s", new TranslationTextComponent("worldhandler.error.gui")).mergeStyle(TextFormatting.RED);
|
||||
ITextComponent cause = new StringTextComponent(" " + e.getClass().getCanonicalName() + ": " + e.getMessage()).mergeStyle(TextFormatting.RED);
|
||||
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.SYSTEM, message, Util.field_240973_b_);
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.SYSTEM, cause, Util.field_240973_b_);
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.SYSTEM, message, Util.DUMMY_UUID);
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.SYSTEM, cause, Util.DUMMY_UUID);
|
||||
|
||||
WorldHandler.LOGGER.throwing(e);
|
||||
}
|
||||
@@ -177,8 +177,8 @@ public class ActionHelper
|
||||
{
|
||||
if(!CommandHelper.canPlayerIssueCommand() && Config.getSettings().permissionQuery())
|
||||
{
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.SYSTEM, new StringTextComponent(TextFormatting.RED + I18n.format("worldhandler.permission.refused")), Util.field_240973_b_);
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.SYSTEM, new StringTextComponent(TextFormatting.RED + I18n.format("worldhandler.permission.refused.change", I18n.format("gui.worldhandler.config.settings.permission_query"))), Util.field_240973_b_);
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.SYSTEM, new StringTextComponent(TextFormatting.RED + I18n.format("worldhandler.permission.refused")), Util.DUMMY_UUID);
|
||||
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.SYSTEM, new StringTextComponent(TextFormatting.RED + I18n.format("worldhandler.permission.refused.change", I18n.format("gui.worldhandler.config.settings.permission_query"))), Util.DUMMY_UUID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ public class BlockHelper
|
||||
}
|
||||
}
|
||||
|
||||
return Minecraft.getInstance().player.func_233580_cy_();
|
||||
return Minecraft.getInstance().player.getPosition();
|
||||
}
|
||||
|
||||
public static Block getFocusedBlock()
|
||||
@@ -150,7 +150,7 @@ public class BlockHelper
|
||||
{
|
||||
if(CommandHelper.canPlayerIssueCommand() && Minecraft.getInstance().getConnection() != null)
|
||||
{
|
||||
BlockPos pos = Minecraft.getInstance().player.func_233580_cy_().add(0, 3, 0);
|
||||
BlockPos pos = Minecraft.getInstance().player.getPosition().add(0, 3, 0);
|
||||
|
||||
BuilderFill placeFill = new BuilderFill();
|
||||
placeFill.setPosition1(pos);
|
||||
|
||||
@@ -4,9 +4,9 @@ package exopandora.worldhandler.util;
|
||||
import exopandora.worldhandler.builder.INBTWritable;
|
||||
import net.minecraft.nbt.INBT;
|
||||
import net.minecraft.nbt.StringNBT;
|
||||
import net.minecraft.util.IReorderingProcessor;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.Style;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -73,51 +73,9 @@ public class MutableStringTextComponent extends StringTextComponent implements I
|
||||
return result;
|
||||
}
|
||||
|
||||
public String formatter(String string, Integer index)
|
||||
public IReorderingProcessor formatter(String string, Integer index)
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
if(this.getStyle() != null)
|
||||
{
|
||||
Style style = this.getStyle();
|
||||
|
||||
if(style.func_240711_a_() != null)
|
||||
{
|
||||
TextFormatting color = TextFormatting.getValueByName(style.func_240711_a_().func_240747_b_());
|
||||
|
||||
if(color != null)
|
||||
{
|
||||
builder.append(color);
|
||||
}
|
||||
}
|
||||
|
||||
if(style.getBold())
|
||||
{
|
||||
builder.append(TextFormatting.BOLD);
|
||||
}
|
||||
|
||||
if(style.getItalic())
|
||||
{
|
||||
builder.append(TextFormatting.ITALIC);
|
||||
}
|
||||
|
||||
if(style.getUnderlined())
|
||||
{
|
||||
builder.append(TextFormatting.UNDERLINE);
|
||||
}
|
||||
|
||||
if(style.getObfuscated())
|
||||
{
|
||||
builder.append(TextFormatting.OBFUSCATED);
|
||||
}
|
||||
|
||||
if(style.getStrikethrough())
|
||||
{
|
||||
builder.append(TextFormatting.STRIKETHROUGH);
|
||||
}
|
||||
}
|
||||
|
||||
return builder.toString() + string;
|
||||
return IReorderingProcessor.func_242239_a(string, this.getStyle());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,13 +92,13 @@ public class MutableStringTextComponent extends StringTextComponent implements I
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
MutableStringTextComponent serial = (MutableStringTextComponent) this.func_230532_e_(); //deepCopy
|
||||
MutableStringTextComponent serial = (MutableStringTextComponent) this.deepCopy();
|
||||
serial.setText(MutableStringTextComponent.getSpecialFormattedText(this.getUnformattedComponentText()));
|
||||
return ITextComponent.Serializer.toJson(serial);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MutableStringTextComponent func_230531_f_() //shallowCopy
|
||||
public MutableStringTextComponent copyRaw()
|
||||
{
|
||||
return new MutableStringTextComponent(this.text);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,10 @@ import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.potion.Effect;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.DynamicRegistries;
|
||||
import net.minecraft.util.registry.MutableRegistry;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.text.LanguageMap;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -31,7 +35,14 @@ public class RegistryHelper
|
||||
registerRegistry(ForgeRegistries.BLOCKS, Block::getTranslationKey);
|
||||
registerRegistry(ForgeRegistries.ITEMS, Item::getTranslationKey);
|
||||
registerRegistry(ForgeRegistries.POTIONS, Effect::getName);
|
||||
registerRegistry(ForgeRegistries.BIOMES, Biome::getTranslationKey);
|
||||
registerRegistry(ForgeRegistries.BIOMES, biome ->
|
||||
{
|
||||
MutableRegistry<Biome> registry = DynamicRegistries.func_239770_b_().func_243612_b(Registry.BIOME_KEY);
|
||||
ResourceLocation resource = registry.getKey(biome);
|
||||
String key = "biome." + biome.getRegistryName().getNamespace() + "." + resource.getPath();
|
||||
|
||||
return LanguageMap.getInstance().func_230506_b_(key) ? key : resource.toString();
|
||||
});
|
||||
registerRegistry(ForgeRegistries.ENCHANTMENTS, Enchantment::getName);
|
||||
registerRegistry(ForgeRegistries.ENTITIES, EntityType::getTranslationKey);
|
||||
registerRegistry(ForgeRegistries.STAT_TYPES, stat -> "stat." + stat.toString().replace(':', '.'));
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import exopandora.worldhandler.config.Config;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
@@ -45,11 +44,11 @@ public class RenderUtils
|
||||
matrix.scale(0.25F, 0.25F, 0.25F);
|
||||
|
||||
matrix.rotate(Vector3f.ZP.rotationDegrees(rotationHour));
|
||||
AbstractGui.func_238467_a_(matrix, -1, -1, 1, 11, 0xFF383838);
|
||||
AbstractGui.fill(matrix, -1, -1, 1, 11, 0xFF383838);
|
||||
matrix.rotate(Vector3f.ZN.rotationDegrees(rotationHour));
|
||||
|
||||
matrix.rotate(Vector3f.ZP.rotationDegrees(rotationMinute));
|
||||
AbstractGui.func_238467_a_(matrix, -1, -1, 1, 15, 0xFF6F6F6F);
|
||||
AbstractGui.fill(matrix, -1, -1, 1, 15, 0xFF6F6F6F);
|
||||
matrix.rotate(Vector3f.ZN.rotationDegrees(rotationMinute));
|
||||
|
||||
matrix.pop();
|
||||
@@ -57,11 +56,11 @@ public class RenderUtils
|
||||
RenderUtils.color(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF());
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getIconTexture());
|
||||
|
||||
gui.func_238474_b_(matrix, width + 0, height, 48, 0, 10, 10);
|
||||
gui.blit(matrix, width + 0, height, 48, 0, 10, 10);
|
||||
|
||||
matrix.push();
|
||||
matrix.scale(0.5F, 0.5F, 0.5F);
|
||||
Screen.func_238467_a_(matrix, (width + 5) * 2 - 1, (height + 4) * 2 + 1, (width + 6) * 2 - 1, (height + 5) * 2 + 1, 0xFF000000);
|
||||
AbstractGui.fill(matrix, (width + 5) * 2 - 1, (height + 4) * 2 + 1, (width + 6) * 2 - 1, (height + 5) * 2 + 1, 0xFF000000);
|
||||
matrix.pop();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ public class SignText implements INBTWritable
|
||||
{
|
||||
if(command != null && !command.isEmpty())
|
||||
{
|
||||
this.text.getStyle().func_240715_a_(new ClickEvent(Action.RUN_COMMAND, command));
|
||||
this.text.getStyle().setClickEvent(new ClickEvent(Action.RUN_COMMAND, command));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.text.getStyle().func_240715_a_(null);
|
||||
this.text.getStyle().setClickEvent(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,36 +15,36 @@ public class TextUtils
|
||||
{
|
||||
public static final StringTextComponent ARROW_LEFT = new StringTextComponent("<");
|
||||
public static final StringTextComponent ARROW_RIGHT = new StringTextComponent(">");
|
||||
public static final IFormattableTextComponent ARROW_LEFT_BOLD = new StringTextComponent("<").func_240699_a_(net.minecraft.util.text.TextFormatting.BOLD);
|
||||
public static final IFormattableTextComponent ARROW_RIGHT_BOLD = new StringTextComponent(">").func_240699_a_(net.minecraft.util.text.TextFormatting.BOLD);
|
||||
public static final IFormattableTextComponent ARROW_LEFT_BOLD = new StringTextComponent("<").mergeStyle(net.minecraft.util.text.TextFormatting.BOLD);
|
||||
public static final IFormattableTextComponent ARROW_RIGHT_BOLD = new StringTextComponent(">").mergeStyle(net.minecraft.util.text.TextFormatting.BOLD);
|
||||
|
||||
public static IFormattableTextComponent stripText(IFormattableTextComponent string, int maxWidth, FontRenderer fontRenderer)
|
||||
{
|
||||
return TextUtils.stripText(string, (IFormattableTextComponent) StringTextComponent.field_240750_d_, maxWidth, fontRenderer);
|
||||
return TextUtils.stripText(string, (IFormattableTextComponent) StringTextComponent.EMPTY, maxWidth, fontRenderer);
|
||||
}
|
||||
|
||||
public static IFormattableTextComponent stripText(IFormattableTextComponent string, IFormattableTextComponent prefix, int maxWidth, FontRenderer fontRenderer)
|
||||
{
|
||||
if(fontRenderer.func_238414_a_(prefix) + fontRenderer.func_238414_a_(string) > (maxWidth - fontRenderer.func_238414_a_(prefix)))
|
||||
{
|
||||
IFormattableTextComponent result = new StringTextComponent("").func_240703_c_(string.getStyle());
|
||||
IFormattableTextComponent result = new StringTextComponent("").setStyle(string.getStyle());
|
||||
|
||||
for(char c : string.getString().toCharArray())
|
||||
{
|
||||
IFormattableTextComponent extension = new StringTextComponent(result.getString() + c + "...").func_240703_c_(string.getStyle());
|
||||
IFormattableTextComponent extension = new StringTextComponent(result.getString() + c + "...").setStyle(string.getStyle());
|
||||
|
||||
if(fontRenderer.func_238414_a_(extension) < maxWidth)
|
||||
{
|
||||
result = new StringTextComponent(result.getString() + c).func_240703_c_(string.getStyle());
|
||||
result = new StringTextComponent(result.getString() + c).setStyle(string.getStyle());
|
||||
}
|
||||
else
|
||||
{
|
||||
return new StringTextComponent(result.getString() + "...").func_240703_c_(string.getStyle());
|
||||
return new StringTextComponent(result.getString() + "...").setStyle(string.getStyle());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return prefix.func_230531_f_().func_230529_a_(string);
|
||||
return prefix.copyRaw().append(string);
|
||||
}
|
||||
|
||||
public static String formatTotalTime(long tick)
|
||||
@@ -108,7 +108,7 @@ public class TextUtils
|
||||
{
|
||||
if(text == null)
|
||||
{
|
||||
return (IFormattableTextComponent) StringTextComponent.field_240750_d_;
|
||||
return (IFormattableTextComponent) StringTextComponent.EMPTY;
|
||||
}
|
||||
|
||||
return new TranslationTextComponent(text, parameters);
|
||||
|
||||
Reference in New Issue
Block a user