Update to 1.16.2

This commit is contained in:
Marcel Konrad
2020-08-29 20:33:33 +02:00
parent 8d6a4b8a38
commit b1db1a78f4
57 changed files with 589 additions and 617 deletions

View File

@@ -1,3 +1,5 @@
import org.gradle.plugins.ide.eclipse.model.AccessRule
buildscript { buildscript {
repositories { repositories {
maven { url = 'https://files.minecraftforge.net/maven' } maven { url = 'https://files.minecraftforge.net/maven' }
@@ -13,7 +15,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
version = '1.16.1-2.11.1' version = '1.16.2-2.11.1'
group = 'exopandora.worldhandler' // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = 'exopandora.worldhandler' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'WorldHandler' archivesBaseName = 'WorldHandler'
@@ -25,7 +27,7 @@ minecraft {
// stable_# Stables are built at the discretion of the MCP team. // stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work. // Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace. // Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'snapshot', version: '20200514-1.16' mappings channel: 'snapshot', version: '20200723-1.16.1'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
@@ -89,7 +91,7 @@ dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it. // The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.16.1-32.0.106' minecraft 'net.minecraftforge:forge:1.16.2-33.0.22'
// You may put jars on which you depend on in ./libs or you may define them like so.. // You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier" // compile "some.group:artifact:version:classifier"
@@ -111,6 +113,17 @@ dependencies {
} }
eclipse {
classpath {
file {
whenMerged {
def jre = entries.find { it.path.contains 'org.eclipse.jdt.launching.JRE_CONTAINER' }
jre.accessRules.add(new AccessRule('accessible', 'jdk/nashorn/**'))
}
}
}
}
// Example for how to get properties into the manifest for reading by the runtime.. // Example for how to get properties into the manifest for reading by the runtime..
jar { jar {
manifest { manifest {

View File

@@ -12,7 +12,7 @@ public class Main
{ {
public static final String NAME = "World Handler"; public static final String NAME = "World Handler";
public static final String MODID = "worldhandler"; 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 MOD_VERSION = "2.11.1";
public static final String URL = "https://minecraft.curseforge.com/projects/world-handler-command-gui"; public static final String URL = "https://minecraft.curseforge.com/projects/world-handler-command-gui";

View File

@@ -492,7 +492,7 @@ public class BuilderSummon extends CommandBuilderNBT
} }
else if(entity.equalsIgnoreCase("Pigman") || entity.equalsIgnoreCase("ZombiePig") || entity.equalsIgnoreCase("ZombiePigman")) 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")) else if(entity.equalsIgnoreCase("Wither"))
{ {

View File

@@ -72,7 +72,7 @@ public class BlockResourceLocation extends ItemResourceLocation
public <T extends Comparable<T>> void setProperty(Property<T> property, T value) 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); this.state = this.state.with(property, value);
} }

View File

@@ -69,7 +69,7 @@ public class ConfigCategorySettings
.define("permission_query", true); .define("permission_query", true);
this.highlightBlocks = builder this.highlightBlocks = builder
.translation("gui.worldhandler.config.settings.highlight_blocks") .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); .define("highlight_blocks", true);
this.dawn = builder this.dawn = builder

View File

@@ -8,11 +8,11 @@ import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.CommandSyntaxException;
import exopandora.worldhandler.config.Config; import exopandora.worldhandler.config.Config;
import exopandora.worldhandler.render.CustomRenderType;
import exopandora.worldhandler.util.BlockHelper; import exopandora.worldhandler.util.BlockHelper;
import exopandora.worldhandler.util.CommandHelper; import exopandora.worldhandler.util.CommandHelper;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
@@ -50,11 +50,36 @@ public class ClientEventHandler
matrix.translate(-projected.getX(), -projected.getY(), -projected.getZ()); matrix.translate(-projected.getX(), -projected.getY(), -projected.getZ());
IRenderTypeBuffer.Impl buffer = Minecraft.getInstance().getRenderTypeBuffers().getBufferSource(); 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); 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(); matrix.pop();
} }
} }

View File

@@ -17,7 +17,7 @@ public class DummyScreen extends Screen
} }
@Override @Override
protected void func_231160_c_() protected void init()
{ {
this.runnable.run(); this.runnable.run();
} }

View File

@@ -9,6 +9,7 @@ import exopandora.worldhandler.util.ActionHelper;
import exopandora.worldhandler.util.RenderUtils; import exopandora.worldhandler.util.RenderUtils;
import exopandora.worldhandler.util.ResourceHelper; import exopandora.worldhandler.util.ResourceHelper;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.gui.widget.button.Button; import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
@@ -23,41 +24,41 @@ public class GuiButtonBase extends Button
} }
@Override @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.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 AbstractGui.drawCenteredString(matrix, Minecraft.getInstance().fontRenderer, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, this.getFGColor());
} }
@Override @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(); RenderSystem.enableBlend();
RenderUtils.color(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF()); 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()); Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getButtonTexture());
int hWidth = this.field_230688_j_ / 2; int hWidth = this.width / 2;
int hHeight = this.field_230689_k_ / 2; int hHeight = this.height / 2;
if(Config.getSkin().getTextureType().equals("resourcepack")) if(Config.getSkin().getTextureType().equals("resourcepack"))
{ {
int textureOffset = 46 + hovered * 20; int textureOffset = 46 + hovered * 20;
this.func_238474_b_(matrix, this.field_230690_l_, this.field_230691_m_, 0, textureOffset, hWidth, hHeight); //blit this.blit(matrix, this.x, this.y, 0, textureOffset, hWidth, hHeight);
this.func_238474_b_(matrix, this.field_230690_l_, this.field_230691_m_ + hHeight, 0, textureOffset + 20 - hHeight, hWidth, hHeight); //blit this.blit(matrix, this.x, this.y + hHeight, 0, textureOffset + 20 - hHeight, hWidth, hHeight);
this.func_238474_b_(matrix, this.field_230690_l_ + hWidth, this.field_230691_m_, 200 - hWidth, textureOffset, hWidth, hHeight); //blit this.blit(matrix, this.x + hWidth, this.y, 200 - hWidth, textureOffset, hWidth, hHeight);
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 + hWidth, this.y + hHeight, 200 - hWidth, textureOffset + 20 - hHeight, hWidth, hHeight);
} }
else else
{ {
int textureOffset = hovered * 20; int textureOffset = hovered * 20;
this.func_238474_b_(matrix, this.field_230690_l_, this.field_230691_m_, 0, textureOffset, hWidth, hHeight); //blit this.blit(matrix, this.x, this.y, 0, textureOffset, hWidth, hHeight);
this.func_238474_b_(matrix, this.field_230690_l_, this.field_230691_m_ + hHeight, 0, textureOffset + 20 - hHeight, hWidth, hHeight); //blit this.blit(matrix, this.x, this.y + hHeight, 0, textureOffset + 20 - hHeight, hWidth, hHeight);
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.blit(matrix, this.x + hWidth, this.y, 200 - hWidth, textureOffset, this.width / 2, hHeight);
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 + hWidth, this.y + hHeight, 200 - hWidth, textureOffset + 20 - hHeight, hWidth, hHeight);
} }
RenderSystem.disableBlend(); RenderSystem.disableBlend();

View File

@@ -22,9 +22,9 @@ public class GuiButtonIcon extends GuiButtonTooltip
} }
@Override @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) if(this.icon != null)
{ {
@@ -36,7 +36,7 @@ public class GuiButtonIcon extends GuiButtonTooltip
{ {
Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getIconTexture()); Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getIconTexture());
if(this.field_230693_o_) if(this.active)
{ {
RenderUtils.color(1.0F, 1.0F, 1.0F, 1.0F); 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); 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);
} }
} }

View File

@@ -26,9 +26,9 @@ public class GuiButtonItem extends GuiButtonBase
} }
@Override @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);
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(this.stack, this.field_230690_l_ + this.field_230688_j_ / 2 - 8, this.field_230691_m_ + 2); Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(this.stack, this.x + this.width / 2 - 8, this.y + 2);
} }
} }

View File

@@ -8,6 +8,7 @@ import exopandora.worldhandler.gui.container.Container;
import exopandora.worldhandler.gui.menu.impl.ILogicMapped; import exopandora.worldhandler.gui.menu.impl.ILogicMapped;
import exopandora.worldhandler.util.TextUtils; import exopandora.worldhandler.util.TextUtils;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.util.text.IFormattableTextComponent; 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) 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.items = items;
this.logic = logic; this.logic = logic;
this.persistence = container.getContent().getPersistence(this.logic.getId(), Persistence::new); this.persistence = container.getContent().getPersistence(this.logic.getId(), Persistence::new);
@@ -39,46 +40,46 @@ public class GuiButtonList<T> extends GuiButtonTooltip
} }
@Override @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(); this.updateMessage();
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer; 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 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; 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(" "); int spaceWidth = fontRenderer.getStringWidth(" ");
ITextComponent display = TextUtils.stripText((IFormattableTextComponent) this.func_230458_i_(), maxWidth, fontRenderer); ITextComponent display = TextUtils.stripText((IFormattableTextComponent) this.getMessage(), maxWidth, fontRenderer);
int yPos = this.field_230691_m_ + (this.field_230689_k_ - 8) / 2; 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()); AbstractGui.drawCenteredString(matrix, fontRenderer, display, this.x + this.width / 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()); AbstractGui.drawCenteredString(matrix, fontRenderer, leftArrow, this.x + this.width / 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, rightArrow, this.x + this.width / 2 + maxWidth / 2 + spaceWidth, yPos, this.getFGColor());
} }
} }
@Override @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()); 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 @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 max = this.items.size() - 1;
int index = this.persistence.getIndex(); int index = this.persistence.getIndex();
if(this.isHoveringLeft(mouseX, mouseY)) if(this.isHoveringLeft(mouseX, mouseY))
{ {
if(Screen.func_231173_s_()) if(Screen.hasShiftDown())
{ {
if(index < 10) if(index < 10)
{ {
@@ -103,7 +104,7 @@ public class GuiButtonList<T> extends GuiButtonTooltip
} }
else if(this.isHoveringRight(mouseX, mouseY)) else if(this.isHoveringRight(mouseX, mouseY))
{ {
if(Screen.func_231173_s_()) if(Screen.hasShiftDown())
{ {
if(index > max - 10) if(index > max - 10)
{ {
@@ -132,22 +133,22 @@ public class GuiButtonList<T> extends GuiButtonTooltip
private void updateMessage() 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) 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) 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) 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) @OnlyIn(Dist.CLIENT)

View File

@@ -33,27 +33,27 @@ public class GuiButtonPiano extends GuiButtonBase
} }
@Override @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) switch(this.type)
{ {
case LEFT: case LEFT:
this.field_230692_n_ = this.isHoveringLeft(mouseX, mouseY); this.isHovered = this.isHoveringLeft(mouseX, mouseY);
break; break;
case NORMAL: case NORMAL:
this.field_230692_n_ = this.isHoveringNormal(mouseX, mouseY); this.isHovered = this.isHoveringNormal(mouseX, mouseY);
break; break;
case RIGHT: case RIGHT:
this.field_230692_n_ = this.isHoveringRight(mouseX, mouseY); this.isHovered = this.isHoveringRight(mouseX, mouseY);
break; break;
case BLACK: case BLACK:
this.field_230692_n_ = this.isHoveringBlack(mouseX, mouseY); this.isHovered = this.isHoveringBlack(mouseX, mouseY);
break; break;
default: default:
break; 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()); RenderUtils.color(1.0F, 1.0F, 1.0F, Config.getSkin().getButtonAlphaF());
Minecraft.getInstance().getTextureManager().bindTexture(NOTE); Minecraft.getInstance().getTextureManager().bindTexture(NOTE);
@@ -77,13 +77,13 @@ public class GuiButtonPiano extends GuiButtonBase
int textColor = this.getFGColor(); int textColor = this.getFGColor();
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer; 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); this.blit(matrix, this.x, this.y, 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 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) 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 @Override
@@ -91,11 +91,11 @@ public class GuiButtonPiano extends GuiButtonBase
{ {
int textColor = 0x000000; int textColor = 0x000000;
if(!this.field_230693_o_) if(!this.active)
{ {
textColor = 0xA0A0A0; textColor = 0xA0A0A0;
} }
else if (this.func_230449_g_()) else if(this.isHovered())
{ {
textColor = 0x8B8B8B; textColor = 0x8B8B8B;
} }
@@ -104,53 +104,53 @@ public class GuiButtonPiano extends GuiButtonBase
} }
@Override @Override
public void func_230988_a_(SoundHandler soundHandler) //playDownSound public void playDownSound(SoundHandler soundHandler)
{ {
soundHandler.play(SimpleSound.master(this.sound, this.pitch)); soundHandler.play(SimpleSound.master(this.sound, this.pitch));
} }
private boolean isHoveringBlack(double mouseX, double mouseY) 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) 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) 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) 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 @Override
public boolean func_231047_b_(double mouseX, double mouseY) //isMouseOver public boolean isMouseOver(double mouseX, double mouseY)
{ {
switch(this.type) switch(this.type)
{ {
case LEFT: 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: 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: 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: 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: default:
return false; return false;
} }
} }
@Override @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) @OnlyIn(Dist.CLIENT)

View File

@@ -17,13 +17,13 @@ public abstract class GuiButtonTab extends AbstractButton
} }
@Override @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 @Override
public void func_230988_a_(SoundHandler soundHandler) //playDownSound public void playDownSound(SoundHandler soundHandler)
{ {
} }

View File

@@ -1,16 +1,12 @@
package exopandora.worldhandler.gui.button; package exopandora.worldhandler.gui.button;
import java.util.Arrays;
import java.util.List;
import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.matrix.MatrixStack;
import exopandora.worldhandler.util.ActionHandler; 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.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.gui.GuiUtils;
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public class GuiButtonTooltip extends GuiButtonBase public class GuiButtonTooltip extends GuiButtonBase
@@ -23,20 +19,11 @@ public class GuiButtonTooltip extends GuiButtonBase
this.tooltip = tooltip; 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); screen.renderTooltip(matrix, this.tooltip, mouseX, mouseY);
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);
}
} }
} }
} }

View File

@@ -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) 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.logic = Objects.requireNonNull(logic);
this.container = Objects.requireNonNull(container); 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)))); 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 @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; int textureOffset = (Config.getSkin().getTextureType().equals("resourcepack") ? 46 : 0) + hovered * 20;
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderUtils.color(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF()); 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.blit(matrix, this.x + (int) (this.persistence.getValue() * (float) (this.width - 8)), this.y, 0, textureOffset, 4, 20);
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)) + 4, this.y, 196, textureOffset, 4, 20);
RenderSystem.disableBlend(); RenderSystem.disableBlend();
} }
@Override @Override
public void func_230982_a_(double mouseX, double mouseY) //onClick public void onClick(double mouseX, double mouseY)
{ {
this.updateSlider(mouseX); this.updateSlider(mouseX);
} }
@Override @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); this.updateSlider(mouseX);
super.func_230983_a_(mouseX, mouseY, deltaX, deltaY); //onDrag super.onDrag(mouseX, mouseY, deltaX, deltaY);
} }
protected void updateSlider(double mouseX) 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) if(this.persistence.getValue() < 0.0F)
{ {
@@ -84,7 +84,7 @@ public class GuiSlider extends GuiButtonBase
} }
@Override @Override
protected int func_230989_a_(boolean mouseOver) //getYImage protected int getYImage(boolean mouseOver)
{ {
return 0; return 0;
} }
@@ -92,10 +92,10 @@ public class GuiSlider extends GuiButtonBase
private void updateDisplayString() private void updateDisplayString()
{ {
int value = this.persistence.getValueInt(); 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; 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); IFormattableTextComponent text = TextUtils.stripText(this.logic.formatPrefix(value), this.width - fontRenderer.func_238414_a_(suffix), fontRenderer).append(suffix);
this.func_238482_a_(text); //setMessage this.setMessage(text);
} }
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)

View File

@@ -27,17 +27,22 @@ public class GuiTextFieldTooltip extends TextFieldWidget
} }
@Override @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 x = this.x;
int tx = enableBackgroundDrawing ? this.field_230690_l_ + 4 : this.field_230690_l_; int y = this.y;
int ty = enableBackgroundDrawing ? this.field_230691_m_ + (this.field_230689_k_ - 8) / 2 : this.field_230691_m_;
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) public void setPosition(int x, int y)
{ {
this.field_230690_l_ = x; this.x = x;
this.field_230691_m_ = y; this.y = y;
} }
public void setText(ITextComponent text) public void setText(ITextComponent text)

View File

@@ -23,20 +23,20 @@ public abstract class Container extends Screen implements IContainer
} }
@Override @Override
public void func_231160_c_() public void init()
{ {
super.func_231160_c_(); super.init();
} }
@Override @Override
public <T extends Widget> T add(T button) 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) public <T extends TextFieldWidget> T add(T textfield)
{ {
return super.func_230481_d_(textfield); return super.addListener(textfield);
} }
@Override @Override

View File

@@ -1,7 +1,6 @@
package exopandora.worldhandler.gui.container.impl; package exopandora.worldhandler.gui.container.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
@@ -30,6 +29,7 @@ import exopandora.worldhandler.util.RenderUtils;
import exopandora.worldhandler.util.ResourceHelper; import exopandora.worldhandler.util.ResourceHelper;
import exopandora.worldhandler.util.TextUtils; import exopandora.worldhandler.util.TextUtils;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.gui.widget.Widget; import net.minecraft.client.gui.widget.Widget;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
@@ -40,7 +40,6 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.gui.GuiUtils;
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public class GuiWorldHandler extends Container public class GuiWorldHandler extends Container
@@ -77,16 +76,16 @@ public class GuiWorldHandler extends Container
} }
@Override @Override
public void func_231160_c_() public void init()
{ {
super.func_231160_c_(); super.init();
ActionHelper.tryRun(() -> ActionHelper.tryRun(() ->
{ {
this.finalButtons.clear(); this.finalButtons.clear();
this.menus.clear(); this.menus.clear();
this.field_230710_m_.clear(); this.buttons.clear();
this.field_230705_e_.clear(); this.children.clear();
//INIT //INIT
this.content.onPlayerNameChanged(this.getPlayer()); this.content.onPlayerNameChanged(this.getPlayer());
@@ -101,7 +100,7 @@ public class GuiWorldHandler extends Container
//SHORTCUTS //SHORTCUTS
final int x = this.field_230708_k_ / 2 - 10; final int x = this.width / 2 - 10;
final int delta = 21; final int delta = 21;
if(Config.getSettings().shortcuts()) if(Config.getSettings().shortcuts())
@@ -127,7 +126,7 @@ public class GuiWorldHandler extends Container
if(Config.getSettings().commandSyntax()) 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(); 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()) this.finalButtons.add(new GuiButtonTab((int) (backgroundX + xOffset), backgroundY - 20, (int) this.tabWidth + (int) Math.ceil(this.tabEpsilon / this.tabSize), 21, tab.getTabTitle())
{ {
@Override @Override
public void func_230930_b_() //onPress public void onPress()
{ {
ActionHelper.changeTab(GuiWorldHandler.this.content, index); ActionHelper.changeTab(GuiWorldHandler.this.content, index);
} }
@@ -172,8 +171,8 @@ public class GuiWorldHandler extends Container
public void initButtons() public void initButtons()
{ {
this.field_230710_m_.clear(); this.buttons.clear();
this.field_230705_e_.clear(); this.children.clear();
this.content.initButtons(this, this.getContentX(), this.getContentY()); this.content.initButtons(this, this.getContentX(), this.getContentY());
if(this.finalButtons != null && !this.finalButtons.isEmpty()) if(this.finalButtons != null && !this.finalButtons.isEmpty())
@@ -195,7 +194,7 @@ public class GuiWorldHandler extends Container
} }
@Override @Override
public void func_231023_e_() //tick public void tick()
{ {
ActionHelper.tryRun(this::update); ActionHelper.tryRun(this::update);
} }
@@ -214,12 +213,12 @@ public class GuiWorldHandler extends Container
private int getBackgroundX() private int getBackgroundX()
{ {
return (this.field_230708_k_ - this.bgTextureWidth) / 2 + this.getXOffset(); return (this.width - this.bgTextureWidth) / 2 + this.getXOffset();
} }
private int getBackgroundY() private int getBackgroundY()
{ {
return (this.field_230709_l_ - this.bgTextureHeight) / 2 + this.getYOffset(); return (this.height - this.bgTextureHeight) / 2 + this.getYOffset();
} }
private int getWatchOffset() private int getWatchOffset()
@@ -242,7 +241,7 @@ public class GuiWorldHandler extends Container
{ {
if(Config.getSettings().commandSyntax() && this.syntaxField != null) if(Config.getSettings().commandSyntax() && this.syntaxField != null)
{ {
if(!this.syntaxField.func_230999_j_()) //isFocused if(!this.syntaxField.isFocused())
{ {
this.syntaxField.setValidator(Predicates.alwaysTrue()); this.syntaxField.setValidator(Predicates.alwaysTrue());
@@ -270,14 +269,14 @@ public class GuiWorldHandler extends Container
if(GuiWorldHandler.player.isEmpty()) if(GuiWorldHandler.player.isEmpty())
{ {
int width = this.field_230712_o_.getStringWidth(I18n.format("gui.worldhandler.generic.edit_username")) + 2; int width = this.font.getStringWidth(I18n.format("gui.worldhandler.generic.edit_username")) + 2;
this.nameField.func_230991_b_(width); //setWidth this.nameField.setWidth(width);
this.nameField.setPosition(backgroundX + this.bgTextureWidth - this.getWatchOffset() - 7 - (this.field_230712_o_.func_238414_a_(this.content.getTitle()) + 2), backgroundY + 6); this.nameField.setPosition(backgroundX + this.bgTextureWidth - this.getWatchOffset() - 7 - (this.font.func_238414_a_(this.content.getTitle()) + 2), backgroundY + 6);
} }
else else
{ {
int width = this.field_230712_o_.getStringWidth(GuiWorldHandler.player) + 2; int width = this.font.getStringWidth(GuiWorldHandler.player) + 2;
this.nameField.func_230991_b_(width); //setWidth this.nameField.setWidth(width);
this.nameField.setPosition(backgroundX + this.bgTextureWidth - this.getWatchOffset() - 7 - width, backgroundY + 6); this.nameField.setPosition(backgroundX + this.bgTextureWidth - this.getWatchOffset() - 7 - width, backgroundY + 6);
} }
@@ -285,7 +284,7 @@ public class GuiWorldHandler extends Container
} }
@Override @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(() -> ActionHelper.tryRun(() ->
{ {
@@ -296,8 +295,8 @@ public class GuiWorldHandler extends Container
if(Config.getSkin().drawBackground()) if(Config.getSkin().drawBackground())
{ {
this.func_230926_e_(-1); //setBlitOffset this.setBlitOffset(-1);
super.func_230446_a_(matrix); //renderBackground super.renderBackground(matrix);
} }
//COLOR //COLOR
@@ -307,11 +306,11 @@ public class GuiWorldHandler extends Container
//BACKGROUND //BACKGROUND
this.bindBackground(); 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 //TABS
this.func_230926_e_(0); //setBlitOffset this.setBlitOffset(0);
this.forEachTab((index, xOffset) -> this.drawTab(matrix, index, xOffset)); this.forEachTab((index, xOffset) -> this.drawTab(matrix, index, xOffset));
this.defaultColor(); this.defaultColor();
@@ -320,20 +319,20 @@ public class GuiWorldHandler extends Container
final String label = Main.MC_VERSION + "-" + Main.MOD_VERSION; final String label = Main.MC_VERSION + "-" + Main.MOD_VERSION;
final int hexAlpha = (int) (0xFF * 0.2) << 24; final int hexAlpha = (int) (0xFF * 0.2) << 24;
final int color = Config.getSkin().getLabelColor() + hexAlpha; final int color = Config.getSkin().getLabelColor() + hexAlpha;
final int versionWidth = this.field_230708_k_ - this.field_230712_o_.getStringWidth(label) - 2; final int versionWidth = this.width - this.font.getStringWidth(label) - 2;
final int versionHeight = this.field_230709_l_ - 10; 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 //TITLE
final int maxWidth = this.bgTextureWidth - 7 - 2 - this.field_230712_o_.getStringWidth(GuiWorldHandler.player) - 2 - this.getWatchOffset() - 7; final int maxWidth = this.bgTextureWidth - 7 - 2 - this.font.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()); this.font.func_243248_b(matrix, TextUtils.stripText(this.content.getTitle(), maxWidth, this.font), backgroundX + 7, backgroundY + 7, Config.getSkin().getLabelColor());
//NAME FIELD //NAME FIELD
final String username = GuiWorldHandler.player.isEmpty() && !this.nameField.func_230999_j_() ? I18n.format("gui.worldhandler.generic.edit_username") : GuiWorldHandler.player; //isFocused final String username = GuiWorldHandler.player.isEmpty() && !this.nameField.isFocused() ? I18n.format("gui.worldhandler.generic.edit_username") : GuiWorldHandler.player;
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()); this.font.drawString(matrix, username, backgroundX + this.bgTextureWidth - this.getWatchOffset() - 7 - this.font.getStringWidth(username), backgroundY + 7, Config.getSkin().getLabelColor());
//WATCH //WATCH
@@ -348,7 +347,7 @@ public class GuiWorldHandler extends Container
{ {
if(mouseX >= watchX && mouseX <= watchX + 9 && mouseY >= watchY && mouseY <= watchY + 9) 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(); RenderUtils.disableLighting();
} }
} }
@@ -356,9 +355,9 @@ public class GuiWorldHandler extends Container
//BUTTONS //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 //CONTAINER
@@ -376,7 +375,7 @@ public class GuiWorldHandler extends Container
if(Config.getSettings().commandSyntax() && this.syntaxField != null) 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 //SPLASHTEXT
@@ -391,10 +390,10 @@ public class GuiWorldHandler extends Container
matrix.rotate(new Quaternion(17.0F, 0.0F, 0.0F, 1.0F)); 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); 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); 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(); matrix.pop();
} }
@@ -403,11 +402,11 @@ public class GuiWorldHandler extends Container
if(Config.getSettings().tooltips()) if(Config.getSettings().tooltips())
{ {
for(Widget button : this.field_230710_m_) for(Widget button : this.buttons)
{ {
if(button instanceof GuiButtonTooltip) 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) 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.bindBackground();
this.func_230926_e_(-1); //setBlitOffset this.setBlitOffset(-1);
this.func_238474_b_(matrix, (int) (backgroundX + xOffset), (int) (backgroundY + yOffset), 0, 0, (int) Math.ceil(this.tabHalf), fHeight); this.blit(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.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()) if(!Config.getSkin().sharpEdges())
{ {
@@ -464,7 +468,7 @@ public class GuiWorldHandler extends Container
for(int x = 0; x < factor; x++) 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++) 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) for(int x = 0; x < width; x += interval)
{ {
this.defaultColor(1.0F - (x / (width + 5.0F * 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) for(int x = 0; x < width; x += interval)
{ {
this.defaultColor(1.0F - (x / (width + 5.0F * 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++) 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++) 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.setBlitOffset(0);
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 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 @Override
@@ -546,76 +550,76 @@ public class GuiWorldHandler extends Container
} }
@Override @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(); this.nameField.setCursorPositionEnd();
} }
if(this.content.func_231044_a_(mouseX, mouseY, keyCode)) if(this.content.mouseClicked(mouseX, mouseY, keyCode))
{ {
return true; return true;
} }
return super.func_231044_a_(mouseX, mouseY, keyCode); return super.mouseClicked(mouseX, mouseY, keyCode);
} }
@Override @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 true;
} }
return super.func_231048_c_(mouseX, mouseY, keyCode); return super.mouseReleased(mouseX, mouseY, keyCode);
} }
@Override @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 true;
} }
return super.func_231045_a_(mouseX, mouseY, keyCode, deltaX, deltaY); return super.mouseDragged(mouseX, mouseY, keyCode, deltaX, deltaY);
} }
@Override @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 true;
} }
return super.func_231043_a_(mouseX, mouseY, distance); return super.mouseScrolled(mouseX, mouseY, distance);
} }
@Override @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)) if(!focused && KeyHandler.isPressed(KeyHandler.KEY_WORLD_HANDLER, keyCode))
{ {
this.func_231175_as__(); this.onClose();
return true; return true;
} }
if(this.content.func_231046_a_(keyCode, scanCode, modifiers)) if(this.content.keyPressed(keyCode, scanCode, modifiers))
{ {
return true; return true;
} }
return super.func_231046_a_(keyCode, scanCode, modifiers); return super.keyPressed(keyCode, scanCode, modifiers);
} }
@Override @Override
@@ -630,41 +634,41 @@ public class GuiWorldHandler extends Container
} }
@Override @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(); this.nameField.setCursorPositionEnd();
} }
if(this.content.func_231042_a_(charTyped, keyCode)) if(this.content.charTyped(charTyped, keyCode))
{ {
return true; return true;
} }
return super.func_231042_a_(charTyped, keyCode); return super.charTyped(charTyped, keyCode);
} }
@Override @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 true;
} }
return super.func_231049_c__(focus); return super.changeFocus(focus);
} }
@Override @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 true;
} }
return super.func_231047_b_(mouseX, mouseY); return super.isMouseOver(mouseX, mouseY);
} }
private void defaultColor() private void defaultColor()
@@ -737,14 +741,14 @@ public class GuiWorldHandler extends Container
} }
@Override @Override
public void func_231175_as__() //onClose public void onClose()
{ {
ActionHelper.tryRun(this.content::onGuiClosed); ActionHelper.tryRun(this.content::onGuiClosed);
super.func_231175_as__(); super.onClose();
} }
@Override @Override
public boolean func_231177_au__() //isPauseScreen public boolean isPauseScreen()
{ {
return Config.getSettings().pause(); return Config.getSettings().pause();
} }
@@ -762,7 +766,7 @@ public class GuiWorldHandler extends Container
} }
@Override @Override
public boolean func_231178_ax__() //shouldCloseOnEsc public boolean shouldCloseOnEsc()
{ {
return true; return true;
} }

View File

@@ -130,7 +130,7 @@ public class ContentAdvancements extends Content
{ {
CommandHelper.sendCommand(container.getPlayer(), this.builderAdvancement.getBuilderForAction(EnumActionType.REVOKE)); 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))); Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(Contents.CONTINUE.withBuilder(this.builderAdvancement.getBuilder(EnumActionType.REVOKE, EnumMode.EVERYTHING)).withParent(Contents.ADVANCEMENTS)));
})); }));

View File

@@ -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)); 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"), () -> 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))); 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) 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) for(EntityType<?> entity : entities)
{ {
@@ -140,7 +140,7 @@ public class ContentButcher extends Content
@Override @Override
public void drawScreen(MatrixStack stack, Container container, int x, int y, int mouseX, int mouseY, float partialTicks) 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 @Override

View File

@@ -89,7 +89,7 @@ public class ContentButcherSettings extends ContentChild
boolean contains = Config.CLIENT.getButcher().containsEntity(this.entity); boolean contains = Config.CLIENT.getButcher().containsEntity(this.entity);
button1.field_230693_o_ = !contains; button1.active = !contains;
button2.field_230693_o_ = contains; button2.active = contains;
} }
} }

View File

@@ -16,8 +16,8 @@ import net.minecraft.client.gui.screen.MultiplayerWarningScreen;
import net.minecraft.client.gui.screen.WorldSelectionScreen; import net.minecraft.client.gui.screen.WorldSelectionScreen;
import net.minecraft.client.multiplayer.ServerData; import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.realms.RealmsBridgeScreen; import net.minecraft.realms.RealmsBridgeScreen;
import net.minecraft.server.IDynamicRegistries;
import net.minecraft.server.integrated.IntegratedServer; import net.minecraft.server.integrated.IntegratedServer;
import net.minecraft.util.registry.DynamicRegistries;
import net.minecraft.util.text.IFormattableTextComponent; import net.minecraft.util.text.IFormattableTextComponent;
import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.WorldSettings; import net.minecraft.world.WorldSettings;
@@ -66,7 +66,7 @@ public class ContentChangeWorld extends ContentChild
{ {
IntegratedServer integrated = Minecraft.getInstance().getIntegratedServer(); IntegratedServer integrated = Minecraft.getInstance().getIntegratedServer();
String folder = integrated.anvilConverterForAnvilFile.func_237282_a_(); 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_(); WorldSettings worldSettings = integrated.func_240793_aU_().func_230408_H_();
Minecraft.getInstance().world.sendQuittingDisconnectingPacket(); Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
@@ -96,7 +96,7 @@ public class ContentChangeWorld extends ContentChild
else if(connection instanceof IntegratedConnection) else if(connection instanceof IntegratedConnection)
{ {
IntegratedConnection integrated = (IntegratedConnection) connection; 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(); Minecraft.getInstance().mouseHelper.grabMouse();
} }
else if(connection instanceof DedicatedConnection) else if(connection instanceof DedicatedConnection)

View File

@@ -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"), () -> 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); 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"), () -> 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); 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"), () -> 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(); 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"), () -> 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(); this.scrollDown();
} }
container.func_231160_c_(); container.init();
})); }));
container.add(this.textfields.get(index)); container.add(this.textfields.get(index));
buttonRemove.field_230693_o_ = this.getCommandCount() > 1; buttonRemove.active = this.getCommandCount() > 1;
buttonUp.field_230693_o_ = index + this.scroll > 0; buttonUp.active = index + this.scroll > 0;
buttonDown.field_230693_o_ = index + this.scroll + 1 < this.getCommandCount(); 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"), () -> 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"), () -> container.add(buttonScrollUp = new GuiButtonIcon(x + 118, y + 72, 56, 20, EnumIcon.ARROW_UP, new TranslationTextComponent("gui.worldhandler.actions.move_up"), () ->
{ {
this.scrollUp(); 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"), () -> container.add(buttonScrollDown = new GuiButtonIcon(x + 118 + 60, y + 72, 54, 20, EnumIcon.ARROW_DOWN, new TranslationTextComponent("gui.worldhandler.actions.move_down"), () ->
{ {
this.scrollDown(); this.scrollDown();
container.func_231160_c_(); container.init();
})); }));
this.updateCopyButton(); this.updateCopyButton();
buttonScrollUp.field_230693_o_ = this.scroll > 0; buttonScrollUp.active = this.scroll > 0;
buttonScrollDown.field_230693_o_ = this.scroll < this.getCommandCount() - 3; buttonScrollDown.active = this.scroll < this.getCommandCount() - 3;
} }
@Override @Override
@@ -199,7 +199,7 @@ public class ContentCommandStack extends ContentChild
{ {
this.iterate(index -> 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() 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() 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() 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) private void setCommand(int index, String command)

View File

@@ -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, 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); BlockHelper.setBlockNearPlayer(container.getPlayer(), Blocks.CRAFTING_TABLE);
ActionHelper.backToGame(); 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); BlockHelper.setBlockNearPlayer(container.getPlayer(), Blocks.ENDER_CHEST);
ActionHelper.backToGame(); 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); BlockHelper.setBlockNearPlayer(container.getPlayer(), Blocks.ANVIL);
ActionHelper.backToGame(); 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 angle = Minecraft.getInstance().player.getHorizontalFacing().getHorizontalIndex() * Math.PI / 2;
double sin = Math.sin(angle); double sin = Math.sin(angle);

View File

@@ -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(new GuiButtonBase(x + 118, y + 96, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.backToGame"), ActionHelper::backToGame));
container.add(this.commandField); 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); CommandHelper.sendCommand(container.getPlayer(), this.builder, this.special);
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(this.getParentContent())); Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(this.getParentContent()));
@@ -78,6 +78,6 @@ public class ContentContinue extends ContentChild
@Override @Override
public void drawScreen(MatrixStack matrix, Container container, int x, int y, int mouseX, int mouseY, float partialTicks) 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);
} }
} }

View File

@@ -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"), () -> container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.items.custom_item.start"), () ->
{ {
this.page = Page.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"), () -> container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.items.custom_item.enchantment"), () ->
{ {
this.page = Page.ENCHANT; 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"), () -> container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.items.custom_item.attributes"), () ->
{ {
this.page = Page.ATTRIBUTES; this.page = Page.ATTRIBUTES;
container.func_231160_c_(); container.init();
})); }));
if(Page.START.equals(this.page)) 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, () -> container.add(button5 = new GuiButtonBase(x + 118, y + 72, 56, 20, TextUtils.ARROW_LEFT, () ->
{ {
this.startPage--; this.startPage--;
container.func_231160_c_(); container.init();
})); }));
container.add(button6 = new GuiButtonBase(x + 118 + 60, y + 72, 55, 20, TextUtils.ARROW_RIGHT, () -> container.add(button6 = new GuiButtonBase(x + 118 + 60, y + 72, 55, 20, TextUtils.ARROW_RIGHT, () ->
{ {
this.startPage++; this.startPage++;
container.func_231160_c_(); container.init();
})); }));
if(this.startPage == 0) if(this.startPage == 0)
{ {
button5.field_230693_o_ = false; button5.active = false;
container.add(this.itemField); container.add(this.itemField);
container.add(this.itemLore1Field); container.add(this.itemLore1Field);
container.add(this.itemLore2Field); container.add(this.itemLore2Field);
} }
else if(this.startPage == 1) else if(this.startPage == 1)
{ {
button6.field_230693_o_ = false; button6.active = false;
} }
} }
else if(Page.ENCHANT.equals(this.page)) else if(Page.ENCHANT.equals(this.page))
{ {
button2.field_230693_o_ = false; button2.active = false;
} }
else if(Page.ATTRIBUTES.equals(this.page)) else if(Page.ATTRIBUTES.equals(this.page))
{ {
button3.field_230693_o_ = false; button3.active = false;
} }
if(!this.builderCutomItem.needsCommandBlock() && !this.builderCutomItem.getName().isSpecial()) 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()))); 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) private void send(String player)
@@ -309,9 +309,9 @@ public class ContentCustomItem extends Content
{ {
if(Page.START.equals(this.page) && this.startPage == 0) if(Page.START.equals(this.page) && this.startPage == 0)
{ {
this.itemField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.itemField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.itemLore1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.itemLore1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
this.itemLore2Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.itemLore2Field.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
} }

View File

@@ -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"), () -> container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.coordinates"), () ->
{ {
this.page = Page.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"), () -> container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.fill"), () ->
{ {
this.page = Page.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"), () -> container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.replace"), () ->
{ {
this.page = Page.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"), () -> container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.clone"), () ->
{ {
this.page = Page.CLONE; this.page = Page.CLONE;
container.func_231160_c_(); container.init();
})); }));
int yOffset1 = 0; int yOffset1 = 0;
@@ -200,7 +200,7 @@ public class ContentEditBlocks extends Content
if(Page.COORDINATES.equals(this.page)) if(Page.COORDINATES.equals(this.page))
{ {
button1.field_230693_o_ = false; button1.active = false;
yOffset1 = 72; yOffset1 = 72;
yOffset2 = 72; yOffset2 = 72;
@@ -217,7 +217,7 @@ public class ContentEditBlocks extends Content
} }
else if(Page.FILL.equals(this.page)) else if(Page.FILL.equals(this.page))
{ {
button2.field_230693_o_ = false; button2.active = false;
yOffset1 = 24; yOffset1 = 24;
yOffset2 = 48; yOffset2 = 48;
@@ -230,11 +230,11 @@ public class ContentEditBlocks extends Content
{ {
CommandHelper.sendCommand(container.getPlayer(), this.builderFill.getBuilderForFill()); 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)) else if(Page.REPLACE.equals(this.page))
{ {
button3.field_230693_o_ = false; button3.active = false;
yOffset1 = 48; yOffset1 = 48;
yOffset2 = 48; yOffset2 = 48;
@@ -248,11 +248,11 @@ public class ContentEditBlocks extends Content
{ {
CommandHelper.sendCommand(container.getPlayer(), this.builderFill.getBuilderForReplace()); 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)) else if(Page.CLONE.equals(this.page))
{ {
button4.field_230693_o_ = false; button4.active = false;
yOffset1 = 48; yOffset1 = 48;
yOffset2 = 48; yOffset2 = 48;
@@ -268,8 +268,8 @@ public class ContentEditBlocks extends Content
else else
{ {
this.builderClone.setFilter(null); this.builderClone.setFilter(null);
container.add(button1 = new GuiButtonBase(x + 118, y + 24, 114, 20, StringTextComponent.field_240750_d_, null)); container.add(button1 = new GuiButtonBase(x + 118, y + 24, 114, 20, StringTextComponent.EMPTY, null));
button1.field_230693_o_ = false; button1.active = false;
} }
container.add(new GuiButtonList<EnumMask>(x + 118, y, Arrays.asList(EnumMask.values()), 114, 20, container, new ILogicMapped<EnumMask>() 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) public void onClick(EnumMask item)
{ {
ContentEditBlocks.this.builderClone.setMask(item); ContentEditBlocks.this.builderClone.setMask(item);
container.func_231160_c_(); container.init();
} }
@Override @Override
@@ -314,19 +314,19 @@ public class ContentEditBlocks extends Content
} }
catch(Exception e) 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"), () -> container.add(new GuiButtonBase(x + 118, y + yOffset1, width1, 20, new TranslationTextComponent("gui.worldhandler.edit_blocks.pos.set_pos_1"), () ->
{ {
BlockHelper.setPos1(BlockHelper.getFocusedBlockPos()); 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"), () -> 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()); 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)) if(Page.COORDINATES.equals(this.page))
{ {
this.x1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.x1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
this.y1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.y1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
this.z1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.z1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
this.x2Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.x2Field.renderButton(matrix, mouseX, mouseY, partialTicks);
this.y2Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.y2Field.renderButton(matrix, mouseX, mouseY, partialTicks);
this.z2Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.z2Field.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
else if(Page.FILL.equals(this.page)) 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)) else if(Page.REPLACE.equals(this.page))
{ {
this.block1Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.block1Field.renderButton(matrix, mouseX, mouseY, partialTicks);
this.block2Field.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.block2Field.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
else if(Page.CLONE.equals(this.page)) else if(Page.CLONE.equals(this.page))
{ {
if(EnumMask.FILTERED.equals(this.builderClone.getMask())) if(EnumMask.FILTERED.equals(this.builderClone.getMask()))
{ {
this.filterField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.filterField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
} }
} }

View File

@@ -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"), () -> 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()); 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"), () -> 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"), () -> 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()); CommandHelper.sendCommand(container.getPlayer(), this.builderExperience.getBuilderForResetLevels());
container.func_231160_c_(); container.init();
})); }));
boolean enabled = this.builderExperience.getLevel() > 0; boolean enabled = this.builderExperience.getLevel() > 0;
this.buttonAdd.field_230693_o_ = enabled; this.buttonAdd.active = enabled;
this.buttonRemove.field_230693_o_ = enabled; this.buttonRemove.active = enabled;
} }
@Override @Override
@@ -79,8 +79,8 @@ public class ContentExperience extends Content
{ {
boolean enabled = this.builderExperience.getLevel() > 0; boolean enabled = this.builderExperience.getLevel() > 0;
this.buttonAdd.field_230693_o_ = enabled; this.buttonAdd.active = enabled;
this.buttonRemove.field_230693_o_ = enabled; this.buttonRemove.active = enabled;
} }
@Override @Override

View File

@@ -164,7 +164,7 @@ public class ContentGamerules extends Content
{ {
if(!this.booleanValue) if(!this.booleanValue)
{ {
this.valueField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); this.valueField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
} }

View File

@@ -14,7 +14,7 @@ import exopandora.worldhandler.gui.content.Contents;
import exopandora.worldhandler.util.ActionHelper; import exopandora.worldhandler.util.ActionHelper;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.OptionsScreen; 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.IFormattableTextComponent;
import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TranslationTextComponent; 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"), () -> container.add(new GuiButtonBase(x + 78, y + 96, 76, 20, new TranslationTextComponent("gui.worldhandler.resourcepack"), () ->
{ {
Minecraft.getInstance().gameSettings.saveOptions(); 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 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); 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)); container.add(new GuiButtonBase(x + 158, y + 96, 74, 20, new TranslationTextComponent("gui.worldhandler.generic.backToGame"), ActionHelper::backToGame));
} }

View File

@@ -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")), () -> 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; 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"), () -> container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.pardon"), () ->
{ {
this.page = Page.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"), () -> container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.permissions"), () ->
{ {
this.page = Page.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"), () -> container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.runtime"), () ->
{ {
this.page = Page.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"), () -> container.add(button5 = new GuiButtonBase(x, y + 96, 114, 20, new TranslationTextComponent("gui.worldhandler.multiplayer.whitelist"), () ->
{ {
this.page = Page.WHITELIST; this.page = Page.WHITELIST;
container.func_231160_c_(); container.init();
})); }));
if(Page.KICK_AND_BAN.equals(this.page)) if(Page.KICK_AND_BAN.equals(this.page))
@@ -161,11 +161,11 @@ public class ContentMultiplayer extends Content
if(this.playerField.getText().isEmpty()) if(this.playerField.getText().isEmpty())
{ {
button6.field_230693_o_ = false; button6.active = false;
button7.field_230693_o_ = false; button7.active = false;
} }
button1.field_230693_o_ = false; button1.active = false;
} }
else if(Page.PARDON.equals(this.page)) else if(Page.PARDON.equals(this.page))
{ {
@@ -177,10 +177,10 @@ public class ContentMultiplayer extends Content
if(this.playerField.getText().isEmpty()) 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)) else if(Page.PERMISSIONS.equals(this.page))
{ {
@@ -196,11 +196,11 @@ public class ContentMultiplayer extends Content
if(this.playerField.getText().isEmpty()) if(this.playerField.getText().isEmpty())
{ {
button6.field_230693_o_ = false; button6.active = false;
button7.field_230693_o_ = false; button7.active = false;
} }
button3.field_230693_o_ = false; button3.active = false;
} }
else if(Page.RUNTIME.equals(this.page)) else if(Page.RUNTIME.equals(this.page))
{ {
@@ -212,16 +212,16 @@ public class ContentMultiplayer extends Content
{ {
CommandHelper.sendCommand(container.getPlayer(), this.builderSaveOn); 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))); 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))); 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)) else if(Page.WHITELIST.equals(this.page))
{ {
@@ -251,11 +251,11 @@ public class ContentMultiplayer extends Content
if(this.playerField.getText().isEmpty()) if(this.playerField.getText().isEmpty())
{ {
button6.field_230693_o_ = false; button6.active = false;
button7.field_230693_o_ = 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)) 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)) if(!Page.RUNTIME.equals(this.page))
{ {
this.playerField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.playerField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
} }

View File

@@ -183,21 +183,21 @@ public class ContentNoteEditor extends Content
RenderUtils.color(1.0F, 1.0F, 1.0F); RenderUtils.color(1.0F, 1.0F, 1.0F);
Minecraft.getInstance().getTextureManager().bindTexture(NOTE); Minecraft.getInstance().getTextureManager().bindTexture(NOTE);
container.func_238474_b_(matrix, x - 1, y - 1, 0, 0, 8, 59); //blit container.blit(matrix, x - 1, y - 1, 0, 0, 8, 59);
container.func_238474_b_(matrix, x - 1, y - 1 + 59, 0, 59, 13, 35); //blit 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.blit(matrix, x - 1 + 232 - 5, y - 1, 18, 0, 7, 59);
container.func_238474_b_(matrix, x - 1 + 232 - 10, y - 1 + 59, 13, 59, 12, 35); //blit 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.blit(matrix, x - 1 + 8, y - 1, 0, 94, 219, 1);
container.func_238474_b_(matrix, x - 1 + 13, y - 1 + 93, 0, 94, 209, 1); //blit container.blit(matrix, x - 1 + 13, y - 1 + 93, 0, 94, 209, 1);
} }
else else
{ {
float scale = 4; float scale = 4;
matrix.push(); 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); matrix.scale(scale, scale, scale);
RenderUtils.renderItemIntoGUI(matrix, new ItemStack(Blocks.NOTE_BLOCK), 0, 0); 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_()); 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 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());
} }
} }

View File

@@ -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"), () -> container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.start"), () ->
{ {
this.page = Page.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"), () -> container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.score"), () ->
{ {
this.page = Page.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"), () -> container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.position"), () ->
{ {
this.page = Page.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"), () -> container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.player.miscellaneous"), () ->
{ {
this.page = Page.MISC; this.page = Page.MISC;
container.func_231160_c_(); container.init();
})); }));
if(Page.START.equals(this.page)) if(Page.START.equals(this.page))
{ {
button1.field_230693_o_ = false; button1.active = false;
} }
else if(Page.SCORE.equals(this.page)) else if(Page.SCORE.equals(this.page))
{ {
button2.field_230693_o_ = false; button2.active = false;
} }
else if(Page.POSITION.equals(this.page)) 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"), () -> 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)) 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))); 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))); 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))); 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))); 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 yPos = y + 82;
int playerNameWidth = Minecraft.getInstance().fontRenderer.func_238414_a_(Minecraft.getInstance().player.getName()) / 2; 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); AbstractGui.fill(matrix, container.width / 2 - playerNameWidth - 1 + 59, yPos - 74, container.width / 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); 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); RenderUtils.color(1.0F, 1.0F, 1.0F, 1.0F);
InventoryScreen.drawEntityOnScreen(xPos, yPos, 30, xPos - mouseX, yPos - mouseY - 44, Minecraft.getInstance().player); 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)) else if(Page.SCORE.equals(this.page))
{ {
this.scoreField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.scoreField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.xpField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.xpField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.coinsField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.coinsField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
else if(Page.POSITION.equals(this.page)) else if(Page.POSITION.equals(this.page))
{ {
this.posXField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.posXField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.posYField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.posYField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.posZField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.posZField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
} }

View File

@@ -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"), () -> container.add(new GuiButtonBase(x + 118, y + 36, 114, 20, new TranslationTextComponent("gui.worldhandler.potions.effect.remove"), () ->
{ {
CommandHelper.sendCommand(container.getPlayer(), this.builderPotion.getRemoveCommand()); 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"), () -> 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()); CommandHelper.sendCommand(container.getPlayer(), this.builderPotion.getClearCommand());
container.func_231160_c_(); container.init();
})); }));
} }
else if(this.potionPage == 1) 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")), () -> 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)); 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")), () -> 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.builderPotion.setHideParticles(!this.builderPotion.getHideParticles());
this.builderPotionItem.setShowParticles(potion, !this.builderPotionItem.getShowParticles(potion)); 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 -> 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()); CommandHelper.sendCommand(container.getPlayer(), this.builderPotion.getGiveCommand());
this.potionPage = 0; 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"), () -> 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)); CommandHelper.sendCommand(container.getPlayer(), this.builderPotionItem.getBuilderForPotion(Items.TIPPED_ARROW));
this.potionPage = 0; 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"), () -> 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)); CommandHelper.sendCommand(container.getPlayer(), this.builderPotionItem.getBuilderForPotion(Items.POTION));
this.potionPage = 0; 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"), () -> 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)); CommandHelper.sendCommand(container.getPlayer(), this.builderPotionItem.getBuilderForPotion(Items.SPLASH_POTION));
this.potionPage = 0; 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"), () -> 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)); CommandHelper.sendCommand(container.getPlayer(), this.builderPotionItem.getBuilderForPotion(Items.LINGERING_POTION));
this.potionPage = 0; this.potionPage = 0;
container.func_231160_c_(); container.init();
})); }));
boolean enabled = this.builderPotion.getAmplifier() >= 0 && this.builderPotion.getDuration() > 0; boolean enabled = this.builderPotion.getAmplifier() >= 0 && this.builderPotion.getDuration() > 0;
button1.field_230693_o_ = enabled; button1.active = enabled;
button2.field_230693_o_ = enabled; button2.active = enabled;
button3.field_230693_o_ = enabled; button3.active = enabled;
button4.field_230693_o_ = enabled; button4.active = enabled;
button5.field_230693_o_ = enabled; button5.active = enabled;
} }
if(this.potionPage > 0) 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, () -> container.add(new GuiButtonBase(x + 118, y + 72, 56, 20, TextUtils.ARROW_LEFT, () ->
{ {
this.potionPage--; this.potionPage--;
container.func_231160_c_(); container.init();
})); }));
container.add(button1 = new GuiButtonBase(x + 118 + 60, y + 72, 55, 20, TextUtils.ARROW_RIGHT, () -> container.add(button1 = new GuiButtonBase(x + 118 + 60, y + 72, 55, 20, TextUtils.ARROW_RIGHT, () ->
{ {
this.next(container); this.next(container);
})); }));
button1.field_230693_o_ = this.potionPage < 3; button1.active = this.potionPage < 3;
} }
} }
private void next(Container container) private void next(Container container)
{ {
this.potionPage++; this.potionPage++;
container.func_231160_c_(); container.init();
} }
@Override @Override

View File

@@ -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"), () -> container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.objectives.create"), () ->
{ {
this.page = Page.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"), () -> container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.objectives.display"), () ->
{ {
this.page = Page.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"), () -> container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.objectives.undisplay"), () ->
{ {
this.page = Page.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"), () -> container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.objectives.remove"), () ->
{ {
this.page = Page.REMOVE; this.page = Page.REMOVE;
container.func_231160_c_(); container.init();
})); }));
button1.field_230693_o_ = !Page.CREATE.equals(this.page); button1.active = !Page.CREATE.equals(this.page);
button2.field_230693_o_ = !Page.DISPLAY.equals(this.page); button2.active = !Page.DISPLAY.equals(this.page);
button3.field_230693_o_ = !Page.UNDISPLAY.equals(this.page); button3.active = !Page.UNDISPLAY.equals(this.page);
button4.field_230693_o_ = !Page.REMOVE.equals(this.page); button4.active = !Page.REMOVE.equals(this.page);
if(Page.UNDISPLAY.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"), () -> 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); 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 @Override
@@ -279,7 +279,7 @@ public class ContentScoreboardObjectives extends ContentScoreboard
{ {
if(!Page.UNDISPLAY.equals(this.page)) if(!Page.UNDISPLAY.equals(this.page))
{ {
this.objectField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.objectField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
} }

View File

@@ -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"), () -> container.add(button1 = new GuiButtonBase(x, y + 12, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.players.points"), () ->
{ {
this.page = Page.ADD_SET_REMOVE; 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"), () -> container.add(button2 = new GuiButtonBase(x, y + 36, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.players.tag"), () ->
{ {
this.page = Page.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"), () -> container.add(button3 = new GuiButtonBase(x, y + 60, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.players.trigger"), () ->
{ {
this.page = Page.ENABLE; this.page = Page.ENABLE;
container.func_231160_c_(); container.init();
})); }));
button1.field_230693_o_ = !Page.ADD_SET_REMOVE.equals(this.page); button1.active = !Page.ADD_SET_REMOVE.equals(this.page);
button2.field_230693_o_ = !Page.TAG.equals(this.page); button2.active = !Page.TAG.equals(this.page);
button3.field_230693_o_ = !Page.ENABLE.equals(this.page); button3.active = !Page.ENABLE.equals(this.page);
boolean enabled = ContentScoreboard.isObjectiveValid(); boolean enabled = ContentScoreboard.isObjectiveValid();
this.builderPlayers.setMode(this.page.getMode()); 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"), () -> 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)); 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"), () -> 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)); 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"), () -> 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)); CommandHelper.sendCommand(container.getPlayer(), this.builderPlayers.getBuilderForPoints(EnumMode.SET, 0));
container.func_231160_c_(); container.init();
})); }));
boolean points = enabled && this.builderPlayers.getPoints() > 0; boolean points = enabled && this.builderPlayers.getPoints() > 0;
this.addButton.field_230693_o_ = points; this.addButton.active = points;
this.removeButton.field_230693_o_ = points; this.removeButton.active = points;
button1.field_230693_o_ = enabled; button1.active = enabled;
} }
else if(Page.TAG.equals(this.page)) else if(Page.TAG.equals(this.page))
{ {
container.add(button1 = new GuiButtonBase(x + 118, y + 36, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.add"), () -> 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)); 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"), () -> 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)); CommandHelper.sendCommand(container.getPlayer(), this.builderTag.getBuilderForMode(BuilderTag.EnumMode.REMOVE));
container.func_231160_c_(); container.init();
})); }));
boolean tag = this.tag != null && !this.tag.isEmpty(); boolean tag = this.tag != null && !this.tag.isEmpty();
button1.field_230693_o_ = tag; button1.active = tag;
button2.field_230693_o_ = tag; button2.active = tag;
} }
else if(Page.ENABLE.equals(this.page)) 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"), () -> 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)); 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"), () -> 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)); 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"), () -> container.add(button1 = new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.enable"), () ->
{ {
CommandHelper.sendCommand(container.getPlayer(), this.builderPlayers.getBuilderForEnable()); CommandHelper.sendCommand(container.getPlayer(), this.builderPlayers.getBuilderForEnable());
container.func_231160_c_(); container.init();
})); }));
this.addButton.field_230693_o_ = enabled && this.builderTrigger.getValue() > 0; this.addButton.active = enabled && this.builderTrigger.getValue() > 0;
this.removeButton.field_230693_o_ = enabled; this.removeButton.active = enabled;
button1.field_230693_o_ = enabled; button1.active = enabled;
} }
if(Page.TAG.equals(this.page)) if(Page.TAG.equals(this.page))
@@ -234,13 +234,13 @@ public class ContentScoreboardPlayers extends ContentScoreboard
{ {
boolean points = enabled && this.builderPlayers.getPoints() > 0; boolean points = enabled && this.builderPlayers.getPoints() > 0;
this.addButton.field_230693_o_ = points; this.addButton.active = points;
this.removeButton.field_230693_o_ = points; this.removeButton.active = points;
} }
else if(Page.ENABLE.equals(this.page)) else if(Page.ENABLE.equals(this.page))
{ {
this.addButton.field_230693_o_ = enabled && this.builderTrigger.getValue() > 0; this.addButton.active = enabled && this.builderTrigger.getValue() > 0;
this.removeButton.field_230693_o_ = enabled; this.removeButton.active = enabled;
} }
this.objectField.tick(); this.objectField.tick();
@@ -252,11 +252,11 @@ public class ContentScoreboardPlayers extends ContentScoreboard
{ {
if(Page.TAG.equals(this.page)) if(Page.TAG.equals(this.page))
{ {
this.tagField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.tagField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
else else
{ {
this.objectField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.objectField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
} }

View File

@@ -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"), () -> container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.team.create"), () ->
{ {
this.page = Page.ADD; 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")), () -> 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; 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")), () -> 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; 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"), () -> container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.scoreboard.team.options"), () ->
{ {
this.page = Page.OPTION; this.page = Page.OPTION;
container.func_231160_c_(); container.init();
})); }));
button1.field_230693_o_ = !Page.ADD.equals(this.page); button1.active = !Page.ADD.equals(this.page);
button2.field_230693_o_ = !Page.JOIN_OR_LEAVE.equals(this.page); button2.active = !Page.JOIN_OR_LEAVE.equals(this.page);
button3.field_230693_o_ = !Page.REMOVE_OR_EMPTY.equals(this.page); button3.active = !Page.REMOVE_OR_EMPTY.equals(this.page);
button4.field_230693_o_ = !Page.OPTION.equals(this.page); button4.active = !Page.OPTION.equals(this.page);
this.builderTeams.setMode(this.page.getMode()); this.builderTeams.setMode(this.page.getMode());
@@ -169,7 +169,7 @@ public class ContentScoreboardTeams extends ContentScoreboard
container.initButtons(); container.initButtons();
})); }));
button1.field_230693_o_ = enabled; button1.active = enabled;
} }
else if(Page.REMOVE_OR_EMPTY.equals(this.page)) else if(Page.REMOVE_OR_EMPTY.equals(this.page))
{ {
@@ -184,8 +184,8 @@ public class ContentScoreboardTeams extends ContentScoreboard
container.initButtons(); container.initButtons();
})); }));
button1.field_230693_o_ = enabled; button1.active = enabled;
button2.field_230693_o_ = enabled; button2.active = enabled;
} }
if(Page.ADD.equals(this.page) || Page.OPTION.equals(this.page)) 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); CommandHelper.sendCommand(container.getPlayer(), this.builderTeams);
container.initButtons(); container.initButtons();
})); }));
button1.field_230693_o_ = enabled; button1.active = enabled;
} }
container.add(this.teamField); container.add(this.teamField);
@@ -210,7 +210,7 @@ public class ContentScoreboardTeams extends ContentScoreboard
@Override @Override
public void drawScreen(MatrixStack matrix, Container container, int x, int y, int mouseX, int mouseY, float partialTicks) 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 @Override

View File

@@ -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"), () -> container.add(button1 = new GuiButtonBase(x + 118, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.enable"), () ->
{ {
setting.set(true); 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"), () -> container.add(button2 = new GuiButtonBase(x + 118, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.disable"), () ->
{ {
setting.set(false); setting.set(false);
container.func_231160_c_(); container.init();
})); }));
boolean enabled = setting.get(); boolean enabled = setting.get();
button1.field_230693_o_ = !enabled; button1.active = !enabled;
button2.field_230693_o_ = enabled; button2.active = enabled;
} }
else if(this.setting instanceof IntegerSetting) else if(this.setting instanceof IntegerSetting)
{ {
@@ -160,7 +160,7 @@ public class ContentSettings extends ContentChild
setting.set(Integer.parseInt(text)); 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) if(this.setting instanceof IntegerSetting)
{ {
this.valueField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.valueField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
} }

View File

@@ -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"), () -> container.add(button1 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.text_line_1"), () ->
{ {
this.selectedLine = 0; 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"), () -> container.add(button2 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.text_line_2"), () ->
{ {
this.selectedLine = 1; 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"), () -> container.add(button3 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.text_line_3"), () ->
{ {
this.selectedLine = 2; 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"), () -> container.add(button4 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.text_line_4"), () ->
{ {
this.selectedLine = 3; this.selectedLine = 3;
container.func_231160_c_(); container.init();
})); }));
if(this.editColor) if(this.editColor)
@@ -144,10 +144,10 @@ public class ContentSignEditor extends Content
})); }));
} }
button1.field_230693_o_ = this.selectedLine != 0; button1.active = this.selectedLine != 0;
button2.field_230693_o_ = this.selectedLine != 1; button2.active = this.selectedLine != 1;
button3.field_230693_o_ = this.selectedLine != 2; button3.active = this.selectedLine != 2;
button4.field_230693_o_ = this.selectedLine != 3; button4.active = this.selectedLine != 3;
} }
} }
@@ -163,7 +163,7 @@ public class ContentSignEditor extends Content
private void toggleEditColor(Container container) private void toggleEditColor(Container container)
{ {
this.editColor = !this.editColor; this.editColor = !this.editColor;
container.func_231160_c_(); container.init();
} }
@Override @Override
@@ -173,7 +173,7 @@ public class ContentSignEditor extends Content
{ {
if(!this.editColor) if(!this.editColor)
{ {
this.commandField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.commandField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
} }
else else
@@ -181,7 +181,7 @@ public class ContentSignEditor extends Content
float scale = 4; float scale = 4;
matrix.push(); 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); matrix.scale(scale, scale, scale);
RenderUtils.renderItemIntoGUI(matrix, new ItemStack(Items.OAK_SIGN), 0, 0); 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_()); 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 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());
} }
} }

View File

@@ -72,7 +72,7 @@ public class ContentSummon extends Content
Items.CHAINMAIL_HELMET.getRegistryName(), Items.CHAINMAIL_HELMET.getRegistryName(),
Items.GOLDEN_HELMET.getRegistryName(), Items.GOLDEN_HELMET.getRegistryName(),
Items.DIAMOND_HELMET.getRegistryName(), Items.DIAMOND_HELMET.getRegistryName(),
Items.field_234763_ls_.getRegistryName() // netherite_helmet Items.NETHERITE_HELMET.getRegistryName()
}; };
private final ResourceLocation[] chestplates = private final ResourceLocation[] chestplates =
{ {
@@ -82,7 +82,7 @@ public class ContentSummon extends Content
Items.CHAINMAIL_CHESTPLATE.getRegistryName(), Items.CHAINMAIL_CHESTPLATE.getRegistryName(),
Items.GOLDEN_CHESTPLATE.getRegistryName(), Items.GOLDEN_CHESTPLATE.getRegistryName(),
Items.DIAMOND_CHESTPLATE.getRegistryName(), Items.DIAMOND_CHESTPLATE.getRegistryName(),
Items.field_234764_lt_.getRegistryName() // netherite_chestplate Items.NETHERITE_CHESTPLATE.getRegistryName()
}; };
private final ResourceLocation[] leggings = private final ResourceLocation[] leggings =
{ {
@@ -92,7 +92,7 @@ public class ContentSummon extends Content
Items.CHAINMAIL_LEGGINGS.getRegistryName(), Items.CHAINMAIL_LEGGINGS.getRegistryName(),
Items.GOLDEN_LEGGINGS.getRegistryName(), Items.GOLDEN_LEGGINGS.getRegistryName(),
Items.DIAMOND_LEGGINGS.getRegistryName(), Items.DIAMOND_LEGGINGS.getRegistryName(),
Items.field_234765_lu_.getRegistryName() // netherite_leggings Items.NETHERITE_LEGGINGS.getRegistryName()
}; };
private final ResourceLocation[] boots = private final ResourceLocation[] boots =
{ {
@@ -102,7 +102,7 @@ public class ContentSummon extends Content
Items.CHAINMAIL_BOOTS.getRegistryName(), Items.CHAINMAIL_BOOTS.getRegistryName(),
Items.GOLDEN_BOOTS.getRegistryName(), Items.GOLDEN_BOOTS.getRegistryName(),
Items.DIAMOND_BOOTS.getRegistryName(), Items.DIAMOND_BOOTS.getRegistryName(),
Items.field_234766_lv_.getRegistryName() // netherite_boots Items.NETHERITE_BOOTS.getRegistryName()
}; };
private final ResourceLocation[] swords = private final ResourceLocation[] swords =
{ {
@@ -112,7 +112,7 @@ public class ContentSummon extends Content
Items.IRON_SWORD.getRegistryName(), Items.IRON_SWORD.getRegistryName(),
Items.GOLDEN_SWORD.getRegistryName(), Items.GOLDEN_SWORD.getRegistryName(),
Items.DIAMOND_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[][] armor = {this.helmets, this.chestplates, this.leggings, this.boots};
private final ResourceLocation[][] hands = {this.swords, this.swords}; 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"), () -> container.add(button4 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.start"), () ->
{ {
this.page = Page.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"), () -> container.add(button5 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.potion_effects"), () ->
{ {
this.page = Page.POTIONS; 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"), () -> container.add(button6 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.attributes"), () ->
{ {
this.page = Page.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"), () -> container.add(button7 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.equipment"), () ->
{ {
this.page = Page.EQUIPMENT; this.page = Page.EQUIPMENT;
container.func_231160_c_(); container.init();
})); }));
if(Page.START.equals(this.page)) if(Page.START.equals(this.page))
{ {
button4.field_230693_o_ = false; button4.active = false;
container.add(this.mobField); container.add(this.mobField);
container.add(this.customNameField); 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()))); 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)) 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, () -> container.add(button1 = new GuiButtonBase(x + 118, y + 72, 56, 20, TextUtils.ARROW_LEFT, () ->
{ {
this.potionPage--; this.potionPage--;
container.func_231160_c_(); container.init();
})); }));
container.add(button2 = new GuiButtonBase(x + 118 + 60, y + 72, 55, 20, TextUtils.ARROW_RIGHT, () -> container.add(button2 = new GuiButtonBase(x + 118 + 60, y + 72, 55, 20, TextUtils.ARROW_RIGHT, () ->
{ {
this.potionPage++; this.potionPage++;
container.func_231160_c_(); container.init();
})); }));
int count = 0; int count = 0;
@@ -314,12 +314,12 @@ public class ContentSummon extends Content
{ {
if(this.potionPage == 0) if(this.potionPage == 0)
{ {
button1.field_230693_o_ = false; button1.active = false;
} }
if(this.potionPage == ForgeRegistries.POTIONS.getKeys().size() - 3) if(this.potionPage == ForgeRegistries.POTIONS.getKeys().size() - 3)
{ {
button2.field_230693_o_ = false; button2.active = false;
} }
if(count == this.potionPage) 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")), () -> 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)); this.builderSummon.setShowParticles(potion, !this.builderSummon.getShowParticles(potion));
container.func_231160_c_(); container.init();
})); }));
break; break;
} }
@@ -346,7 +346,7 @@ public class ContentSummon extends Content
} }
else if(Page.ATTRIBUTES.equals(this.page)) else if(Page.ATTRIBUTES.equals(this.page))
{ {
button6.field_230693_o_ = false; button6.active = false;
} }
else if(Page.EQUIPMENT.equals(this.page)) 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, () -> 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)]); 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(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, () -> 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)]); 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++) 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, () -> 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)]); 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(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, () -> 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)]); 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)) if(Page.START.equals(this.page))
{ {
this.mobField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); this.mobField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.customNameField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); this.customNameField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.passengerField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); this.passengerField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
else if(Page.POTIONS.equals(this.page)) 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)) else if(Page.EQUIPMENT.equals(this.page))
{ {
RenderUtils.color(1.0F, 1.0F, 1.0F, 1.0F); RenderUtils.color(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/beacon.png")); 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++) for(int i = 0; i < 4; i++)
{ {
if(this.builderSummon.getArmorItem(3 - i).equals(Items.AIR.getRegistryName())) 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())) 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);
} }
} }
} }

View File

@@ -141,9 +141,9 @@ public class ContentUsercontent extends Content
{ {
for(VisibleObject<TextFieldWidget> textfield : this.textfields.values()) 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)) 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) private void printError(String type, int index, Throwable e)
{ {
ITextComponent message = new StringTextComponent(TextFormatting.RED + "<" + Main.NAME + ":" + this.id + ":" + type + ":" + index + "> " + e.getMessage()); 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() private void updateTextfields()
@@ -265,7 +265,7 @@ public class ContentUsercontent extends Content
for(VisibleActiveObject<TextFieldWidget> visObj : this.textfields.values()) for(VisibleActiveObject<TextFieldWidget> visObj : this.textfields.values())
{ {
visObj.getObject().setEnabled(visObj.isEnabled(this.engineAdapter)); 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) for(VisibleActiveObject<Widget> visObj : this.buttons)
{ {
visObj.getObject().field_230693_o_ = visObj.isEnabled(this.engineAdapter); visObj.getObject().active = visObj.isEnabled(this.engineAdapter);
visObj.getObject().field_230694_p_ = visObj.isVisible(this.engineAdapter); visObj.getObject().visible = visObj.isVisible(this.engineAdapter);
} }
} }
} }

View File

@@ -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"), () -> container.add(start = new GuiButtonBase(x, y + 12, 114, 20, new TranslationTextComponent("gui.worldhandler.world_info.start"), () ->
{ {
this.page = Page.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"), () -> container.add(world = new GuiButtonBase(x, y + 36, 114, 20, new TranslationTextComponent("gui.worldhandler.world_info.world"), () ->
{ {
this.page = Page.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"), () -> container.add(stats = new GuiButtonBase(x, y + 60, 114, 20, new TranslationTextComponent("gui.worldhandler.world_info.statistics"), () ->
{ {
this.page = Page.STATS; this.page = Page.STATS;
container.func_231160_c_(); container.init();
})); }));
if(Page.START.equals(this.page)) if(Page.START.equals(this.page))
{ {
start.field_230693_o_ = false; start.active = false;
} }
else if(Page.WORLD.equals(this.page)) else if(Page.WORLD.equals(this.page))
{ {
GuiButtonBase seed; GuiButtonBase seed;
IntegratedServer server = Minecraft.getInstance().getIntegratedServer(); 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"), () -> 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())); 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)) 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)) if(Page.START.equals(this.page))
{ {
this.posXField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.posXField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.posYField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.posYField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.posZField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.posZField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
else if(Page.WORLD.equals(this.page)) else if(Page.WORLD.equals(this.page))
{ {
this.worldField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.worldField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.seedField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.seedField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
else if(Page.STATS.equals(this.page)) else if(Page.STATS.equals(this.page))
{ {
this.totalTimeField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.totalTimeField.renderButton(matrix, mouseX, mouseY, partialTicks);
this.currentTimeField.func_230431_b_(matrix, mouseX, mouseY, partialTicks); //renderButton this.currentTimeField.renderButton(matrix, mouseX, mouseY, partialTicks);
} }
} }

View File

@@ -18,10 +18,10 @@ public interface ILogicMapped<T> extends ILogic
if(tooltip != null) 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); void onClick(T item);

View File

@@ -77,7 +77,7 @@ public class MenuButtonList extends Menu
public void onClick(Node item) public void onClick(Node item)
{ {
MenuButtonList.this.getPersistence(container, 1).setIndex(0); MenuButtonList.this.getPersistence(container, 1).setIndex(0);
container.func_231160_c_(); container.init();
} }
@Override @Override
@@ -99,8 +99,8 @@ public class MenuButtonList extends Menu
{ {
for(int x = this.getDepth() + 1; x < this.maxDepth; x++) 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); GuiButtonBase button = new GuiButtonBase(this.x, this.y + 24 * x, 114, 20, StringTextComponent.EMPTY, null);
button.field_230693_o_ = false; button.active = false;
container.add(button); container.add(button);
} }
} }

View File

@@ -88,7 +88,7 @@ public class MenuColorField extends Menu
@Override @Override
public IFormattableTextComponent translate(TextFormatting item) 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 @Override
@@ -106,7 +106,7 @@ public class MenuColorField extends Menu
@Override @Override
public void onClick(TextFormatting item) public void onClick(TextFormatting item)
{ {
MenuColorField.this.string.func_240699_a_(item); MenuColorField.this.string.mergeStyle(item);
} }
@Override @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())); this.string.setStyle(this.string.getStyle().setItalic(!this.string.getStyle().getItalic()));
container.func_231160_c_(); 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())); this.string.setStyle(this.string.getStyle().setItalic(!this.string.getStyle().getBold()));
container.func_231160_c_(); 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())); this.string.setStyle(this.string.getStyle().setUnderlined(!this.string.getStyle().getUnderlined()));
container.func_231160_c_(); 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())); this.string.setStyle(this.string.getStyle().setStrikethrough(!this.string.getStyle().getStrikethrough()));
container.func_231160_c_(); 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())); this.string.setStyle(this.string.getStyle().setObfuscated(!this.string.getStyle().getObfuscated()));
container.func_231160_c_(); container.init();
})); }));
} }
} }
@@ -153,6 +153,6 @@ public class MenuColorField extends Menu
@Override @Override
public void draw(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) 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);
} }
} }

View File

@@ -60,11 +60,11 @@ public class MenuPageList<T> extends Menu
int buttonWidth = (this.width - 4) / 2; 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)); 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); 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)); 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); container.add(right);
} }
@@ -87,13 +87,13 @@ public class MenuPageList<T> extends Menu
if(this.logic.doDisable()) if(this.logic.doDisable())
{ {
button.field_230693_o_ = this.persistence.getSelectedIndex() != index; button.active = this.persistence.getSelectedIndex() != index;
} }
} }
else else
{ {
button = new GuiButtonBase(this.x, this.y + (this.height + 4) * x, this.width, this.height, StringTextComponent.field_240750_d_, null); button = new GuiButtonBase(this.x, this.y + (this.height + 4) * x, this.width, this.height, StringTextComponent.EMPTY, null);
button.field_230693_o_ = false; button.active = false;
} }
container.add(button); container.add(button);
@@ -109,14 +109,14 @@ public class MenuPageList<T> extends Menu
@Override @Override
public void draw(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) 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) private void goLeft(Container container)
{ {
int page = this.persistence.getPage(); int page = this.persistence.getPage();
if(Screen.func_231173_s_()) if(Screen.hasShiftDown())
{ {
this.persistence.setPage(page - Math.min(10, page)); this.persistence.setPage(page - Math.min(10, page));
} }
@@ -132,7 +132,7 @@ public class MenuPageList<T> extends Menu
{ {
int page = this.persistence.getPage(); int page = this.persistence.getPage();
if(Screen.func_231173_s_()) if(Screen.hasShiftDown())
{ {
this.persistence.setPage(page + Math.min(10, this.getTotalPages() - 1 - page)); this.persistence.setPage(page + Math.min(10, this.getTotalPages() - 1 - page));
} }

View File

@@ -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);
}
}

View File

@@ -40,7 +40,7 @@ public class UsercontentAPI
{ {
if(object != null) 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);
} }
} }

View File

@@ -163,11 +163,11 @@ public class ActionHelper
Minecraft.getInstance().displayGuiScreen(null); Minecraft.getInstance().displayGuiScreen(null);
Minecraft.getInstance().mouseHelper.grabMouse(); Minecraft.getInstance().mouseHelper.grabMouse();
ITextComponent message = new TranslationTextComponent("<" + Main.NAME + "> %s", new TranslationTextComponent("worldhandler.error.gui")).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()).func_240699_a_(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, message, Util.DUMMY_UUID);
Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.SYSTEM, cause, Util.field_240973_b_); Minecraft.getInstance().ingameGUI.func_238450_a_(ChatType.SYSTEM, cause, Util.DUMMY_UUID);
WorldHandler.LOGGER.throwing(e); WorldHandler.LOGGER.throwing(e);
} }
@@ -177,8 +177,8 @@ public class ActionHelper
{ {
if(!CommandHelper.canPlayerIssueCommand() && Config.getSettings().permissionQuery()) 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")), 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.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.DUMMY_UUID);
} }
else else
{ {

View File

@@ -53,7 +53,7 @@ public class BlockHelper
} }
} }
return Minecraft.getInstance().player.func_233580_cy_(); return Minecraft.getInstance().player.getPosition();
} }
public static Block getFocusedBlock() public static Block getFocusedBlock()
@@ -150,7 +150,7 @@ public class BlockHelper
{ {
if(CommandHelper.canPlayerIssueCommand() && Minecraft.getInstance().getConnection() != null) 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(); BuilderFill placeFill = new BuilderFill();
placeFill.setPosition1(pos); placeFill.setPosition1(pos);

View File

@@ -4,9 +4,9 @@ package exopandora.worldhandler.util;
import exopandora.worldhandler.builder.INBTWritable; import exopandora.worldhandler.builder.INBTWritable;
import net.minecraft.nbt.INBT; import net.minecraft.nbt.INBT;
import net.minecraft.nbt.StringNBT; import net.minecraft.nbt.StringNBT;
import net.minecraft.util.IReorderingProcessor;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@@ -73,51 +73,9 @@ public class MutableStringTextComponent extends StringTextComponent implements I
return result; return result;
} }
public String formatter(String string, Integer index) public IReorderingProcessor formatter(String string, Integer index)
{ {
StringBuilder builder = new StringBuilder(); return IReorderingProcessor.func_242239_a(string, this.getStyle());
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;
} }
@Override @Override
@@ -134,13 +92,13 @@ public class MutableStringTextComponent extends StringTextComponent implements I
@Override @Override
public String toString() public String toString()
{ {
MutableStringTextComponent serial = (MutableStringTextComponent) this.func_230532_e_(); //deepCopy MutableStringTextComponent serial = (MutableStringTextComponent) this.deepCopy();
serial.setText(MutableStringTextComponent.getSpecialFormattedText(this.getUnformattedComponentText())); serial.setText(MutableStringTextComponent.getSpecialFormattedText(this.getUnformattedComponentText()));
return ITextComponent.Serializer.toJson(serial); return ITextComponent.Serializer.toJson(serial);
} }
@Override @Override
public MutableStringTextComponent func_230531_f_() //shallowCopy public MutableStringTextComponent copyRaw()
{ {
return new MutableStringTextComponent(this.text); return new MutableStringTextComponent(this.text);
} }

View File

@@ -13,6 +13,10 @@ import net.minecraft.entity.EntityType;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.potion.Effect; import net.minecraft.potion.Effect;
import net.minecraft.util.ResourceLocation; 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.minecraft.world.biome.Biome;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@@ -31,7 +35,14 @@ public class RegistryHelper
registerRegistry(ForgeRegistries.BLOCKS, Block::getTranslationKey); registerRegistry(ForgeRegistries.BLOCKS, Block::getTranslationKey);
registerRegistry(ForgeRegistries.ITEMS, Item::getTranslationKey); registerRegistry(ForgeRegistries.ITEMS, Item::getTranslationKey);
registerRegistry(ForgeRegistries.POTIONS, Effect::getName); 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.ENCHANTMENTS, Enchantment::getName);
registerRegistry(ForgeRegistries.ENTITIES, EntityType::getTranslationKey); registerRegistry(ForgeRegistries.ENTITIES, EntityType::getTranslationKey);
registerRegistry(ForgeRegistries.STAT_TYPES, stat -> "stat." + stat.toString().replace(':', '.')); registerRegistry(ForgeRegistries.STAT_TYPES, stat -> "stat." + stat.toString().replace(':', '.'));

View File

@@ -7,7 +7,6 @@ import com.mojang.blaze3d.systems.RenderSystem;
import exopandora.worldhandler.config.Config; import exopandora.worldhandler.config.Config;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.AbstractGui; import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
@@ -45,11 +44,11 @@ public class RenderUtils
matrix.scale(0.25F, 0.25F, 0.25F); matrix.scale(0.25F, 0.25F, 0.25F);
matrix.rotate(Vector3f.ZP.rotationDegrees(rotationHour)); 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.ZN.rotationDegrees(rotationHour));
matrix.rotate(Vector3f.ZP.rotationDegrees(rotationMinute)); 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.rotate(Vector3f.ZN.rotationDegrees(rotationMinute));
matrix.pop(); matrix.pop();
@@ -57,11 +56,11 @@ public class RenderUtils
RenderUtils.color(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF()); RenderUtils.color(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF());
Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getIconTexture()); 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.push();
matrix.scale(0.5F, 0.5F, 0.5F); 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(); matrix.pop();
} }

View File

@@ -40,11 +40,11 @@ public class SignText implements INBTWritable
{ {
if(command != null && !command.isEmpty()) 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 else
{ {
this.text.getStyle().func_240715_a_(null); this.text.getStyle().setClickEvent(null);
} }
} }

View File

@@ -15,36 +15,36 @@ public class TextUtils
{ {
public static final StringTextComponent ARROW_LEFT = new StringTextComponent("<"); public static final StringTextComponent ARROW_LEFT = new StringTextComponent("<");
public static final StringTextComponent ARROW_RIGHT = 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_LEFT_BOLD = new StringTextComponent("<").mergeStyle(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_RIGHT_BOLD = new StringTextComponent(">").mergeStyle(net.minecraft.util.text.TextFormatting.BOLD);
public static IFormattableTextComponent stripText(IFormattableTextComponent string, int maxWidth, FontRenderer fontRenderer) 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) 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))) 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()) 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) 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 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) public static String formatTotalTime(long tick)
@@ -108,7 +108,7 @@ public class TextUtils
{ {
if(text == null) if(text == null)
{ {
return (IFormattableTextComponent) StringTextComponent.field_240750_d_; return (IFormattableTextComponent) StringTextComponent.EMPTY;
} }
return new TranslationTextComponent(text, parameters); return new TranslationTextComponent(text, parameters);

View File

@@ -1,5 +1,5 @@
modLoader="javafml" modLoader="javafml"
loaderVersion="[32,)" loaderVersion="[33,)"
updateJSONURL="https://raw.githubusercontent.com/Exopandora/worldhandler/master/version.json" updateJSONURL="https://raw.githubusercontent.com/Exopandora/worldhandler/master/version.json"
issueTrackerURL="https://github.com/Exopandora/WorldHandler/issues" issueTrackerURL="https://github.com/Exopandora/WorldHandler/issues"
displayURL="https://minecraft.curseforge.com/projects/world-handler-command-gui" displayURL="https://minecraft.curseforge.com/projects/world-handler-command-gui"
@@ -11,7 +11,7 @@ license="GPL v3.0"
[[mods]] [[mods]]
modId="worldhandler" modId="worldhandler"
version="1.16.1-2.11.1" version="1.16.2-2.11.1"
displayName="World Handler" displayName="World Handler"
description="The World Handler provides a simple and easy to use graphical user interface for commands. It lets you create powerful and complex sub-commands alongside NBT-structures within seconds." description="The World Handler provides a simple and easy to use graphical user interface for commands. It lets you create powerful and complex sub-commands alongside NBT-structures within seconds."

View File

@@ -2,6 +2,6 @@
"pack": "pack":
{ {
"description": "World Handler", "description": "World Handler",
"pack_format": 4 "pack_format": 5
} }
} }