diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TrialsButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TrialsButton.java index 8d6b7ff4f..bf80538cd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TrialsButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TrialsButton.java @@ -21,7 +21,7 @@ public class TrialsButton extends TexturedButton { private final boolean isTrials; public TrialsButton(GuiBooklet gui) { - super(GuiBooklet.RES_LOC_GADGETS, -152000, gui.getGuiLeft() + gui.getSizeX(), gui.getGuiTop() + 10, 0, 204, 52, 16); + super(GuiBooklet.RES_LOC_GADGETS, gui.getGuiLeft() + gui.getSizeX(), gui.getGuiTop() + 10, 0, 204, 52, 16, ); this.isTrials = gui.areTrialsOpened(); this.active = !this.isTrials; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiBooklet.java index 32188343d..c2a94a8eb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiBooklet.java @@ -96,19 +96,19 @@ public abstract class GuiBooklet extends GuiBookletBase { if (this.hasPageLeftButton()) { List hoverText = Arrays.asList(TextFormatting.GOLD + "Previous Page", TextFormatting.ITALIC + "Or scroll up"); - this.buttonLeft = new TexturedButton(RES_LOC_GADGETS, -2000, this.guiLeft - 12, this.guiTop + this.ySize - 8, 18, 54, 18, 10, hoverText); + this.buttonLeft = new TexturedButton(RES_LOC_GADGETS, this.guiLeft - 12, this.guiTop + this.ySize - 8, 18, 54, 18, 10, hoverText, ); this.addButton(this.buttonLeft); } if (this.hasPageRightButton()) { List hoverText = Arrays.asList(TextFormatting.GOLD + "Next Page", TextFormatting.ITALIC + "Or scroll down"); - this.buttonRight = new TexturedButton(RES_LOC_GADGETS, -2001, this.guiLeft + this.xSize - 6, this.guiTop + this.ySize - 8, 0, 54, 18, 10, hoverText); + this.buttonRight = new TexturedButton(RES_LOC_GADGETS, this.guiLeft + this.xSize - 6, this.guiTop + this.ySize - 8, 0, 54, 18, 10, hoverText, ); this.addButton(this.buttonRight); } if (this.hasBackButton()) { List hoverText = Arrays.asList(TextFormatting.GOLD + "Go Back", TextFormatting.ITALIC + "Or right-click", TextFormatting.ITALIC.toString() + TextFormatting.GRAY + "Hold Shift for Main Page"); - this.buttonBack = new TexturedButton(RES_LOC_GADGETS, -2002, this.guiLeft - 15, this.guiTop - 3, 36, 54, 18, 10, hoverText); + this.buttonBack = new TexturedButton(RES_LOC_GADGETS, this.guiLeft - 15, this.guiTop - 3, 36, 54, 18, 10, hoverText, ); this.addButton(this.buttonBack); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiMainPage.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiMainPage.java index 6913ff96d..5531d1924 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiMainPage.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiMainPage.java @@ -135,7 +135,7 @@ public class GuiMainPage extends GuiBooklet { List configText = new ArrayList<>(); configText.add(TextFormatting.GOLD + StringUtil.localize("booklet." + ActuallyAdditions.MODID + ".configButton.name")); configText.addAll(this.font.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet." + ActuallyAdditions.MODID + ".configButton.desc", ActuallyAdditions.NAME).replaceAll("\\\\n", "\n"), 200)); - this.configButton = new TexturedButton(RES_LOC_GADGETS, -388, this.guiLeft + 16, this.guiTop + this.ySize - 30, 188, 14, 16, 16, configText); + this.configButton = new TexturedButton(RES_LOC_GADGETS, this.guiLeft + 16, this.guiTop + this.ySize - 30, 188, 14, 16, 16, configText, ); this.addButton(this.configButton); List achievementText = new ArrayList<>(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiPage.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiPage.java index 180e3af8d..12bf3d29c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiPage.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiPage.java @@ -117,7 +117,7 @@ public class GuiPage extends GuiBooklet { List links = this.getWebLinks(); if (links != null && !links.isEmpty()) { - this.buttonViewOnline = new TexturedButton(RES_LOC_GADGETS, -782822, this.guiLeft + this.xSize - 24, this.guiTop + this.ySize - 25, 0, 172, 16, 16, Collections.singletonList(TextFormatting.GOLD + StringUtil.localize("booklet." + ActuallyAdditions.MODID + ".onlineButton.name"))); + this.buttonViewOnline = new TexturedButton(RES_LOC_GADGETS, this.guiLeft + this.xSize - 24, this.guiTop + this.ySize - 25, 0, 172, 16, 16, Collections.singletonList(TextFormatting.GOLD + StringUtil.localize("booklet." + ActuallyAdditions.MODID + ".onlineButton.name")), ); this.addButton(this.buttonViewOnline); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java index d09d51233..d2086d9e8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java @@ -10,20 +10,24 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.tile.CustomEnergyStorage; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.AbstractGui; import net.minecraft.client.resources.I18n; -import net.minecraftforge.fml.client.config.GuiUtils; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.fml.client.gui.GuiUtils; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; @OnlyIn(Dist.CLIENT) -public class EnergyDisplay extends Gui { +public class EnergyDisplay extends AbstractGui { private CustomEnergyStorage rfReference; private int x; @@ -47,7 +51,7 @@ public class EnergyDisplay extends Gui { this.drawTextNextTo = drawTextNextTo; } - public void draw() { + public void draw(MatrixStack matrices) { Minecraft mc = Minecraft.getInstance(); mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); @@ -66,9 +70,9 @@ public class EnergyDisplay extends Gui { int i = this.rfReference.getEnergyStored() * 83 / this.rfReference.getMaxEnergyStored(); float[] color = AssetUtil.getWheelColor(mc.world.getTotalWorldTime() % 256); - GlStateManager.color(color[0] / 255F, color[1] / 255F, color[2] / 255F); + RenderSystem.color4f(color[0] / 255F, color[1] / 255F, color[2] / 255F); this.blit(matrices, barX + 1, barY + 84 - i, 36, 172, 16, i); - GlStateManager.color(1F, 1F, 1F); + RenderSystem.color4f(1F, 1F, 1F); } if (this.drawTextNextTo) { @@ -76,7 +80,7 @@ public class EnergyDisplay extends Gui { } } - public void drawOverlay(int mouseX, int mouseY) { + public void render(MatrixStack matrices, int mouseX, int mouseY) { if (this.isMouseOver(mouseX, mouseY)) { Minecraft mc = Minecraft.getInstance(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java index a8ea51801..f14e7a798 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java @@ -15,7 +15,9 @@ import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiInputter.SmallerButton; import de.ellpeck.actuallyadditions.mod.tile.FilterSettings; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.AbstractGui; import net.minecraft.client.gui.widget.button.Button; +import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -26,7 +28,7 @@ import java.util.Collections; import java.util.List; @OnlyIn(Dist.CLIENT) -public class FilterSettingsGui extends Gui { +public class FilterSettingsGui extends AbstractGui { private final FilterSettings theSettings; @@ -54,48 +56,48 @@ public class FilterSettingsGui extends Gui { this.modButton = new SmallerButton(this.theSettings.modButtonId, x, y, "", true); buttonList.add(this.modButton); - this.update(); + this.tick(); } - public void update() { - this.whitelistButton.displayString = (this.theSettings.isWhitelist + public void tick() { + this.whitelistButton.setMessage(new StringTextComponent("WH").mergeStyle(this.theSettings.isWhitelist ? TextFormatting.DARK_GREEN - : TextFormatting.RED) + "WH"; - this.metaButton.displayString = (this.theSettings.respectMeta + : TextFormatting.RED)); + this.whitelistButton.setMessage(new StringTextComponent("ME").mergeStyle(this.theSettings.respectMeta ? TextFormatting.DARK_GREEN - : TextFormatting.RED) + "ME"; - this.nbtButton.displayString = (this.theSettings.respectNBT + : TextFormatting.RED)); + this.whitelistButton.setMessage(new StringTextComponent("NB").mergeStyle(this.theSettings.respectNBT ? TextFormatting.DARK_GREEN - : TextFormatting.RED) + "NB"; - this.modButton.displayString = (this.theSettings.respectMod + : TextFormatting.RED)); + this.whitelistButton.setMessage(new StringTextComponent("MO").mergeStyle(this.theSettings.respectMod + ? TextFormatting.DARK_GREEN + : TextFormatting.RED)); + this.whitelistButton.setMessage(new StringTextComponent("OR").mergeStyle(this.theSettings.respectOredict == 0 ? TextFormatting.DARK_GREEN - : TextFormatting.RED) + "MO"; - this.oredictButton.displayString = (this.theSettings.respectOredict == 0 - ? TextFormatting.RED : this.theSettings.respectOredict == 1 ? TextFormatting.GREEN - : TextFormatting.DARK_GREEN) + "OR"; + : TextFormatting.DARK_GREEN)); } public void drawHover(int mouseX, int mouseY) { Minecraft mc = Minecraft.getInstance(); - if (this.whitelistButton.isMouseOver()) { + if (this.whitelistButton.isMouseOver(mouseX, mouseY)) { List list = new ArrayList<>(); list.add(TextFormatting.BOLD + (this.theSettings.isWhitelist ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.whitelist") : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.blacklist"))); list.addAll(mc.fontRenderer.listFormattedStringToWidth(StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".gui.whitelistInfo"), 200)); GuiUtils.drawHoveringText(list, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer); - } else if (this.metaButton.isMouseOver()) { + } else if (this.metaButton.isMouseOver(mouseX, mouseY)) { GuiUtils.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.theSettings.respectMeta ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.respectMeta") : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.ignoreMeta"))), mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer); - } else if (this.nbtButton.isMouseOver()) { + } else if (this.nbtButton.isMouseOver(mouseX, mouseY)) { GuiUtils.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.theSettings.respectNBT ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.respectNBT") : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.ignoreNBT"))), mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer); - } else if (this.modButton.isMouseOver()) { + } else if (this.modButton.isMouseOver(mouseX, mouseY)) { List list = new ArrayList<>(); list.add(TextFormatting.BOLD + (this.theSettings.respectMod ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.respectMod") diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FluidDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FluidDisplay.java index 961b02d0f..6ab83eebb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FluidDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FluidDisplay.java @@ -10,21 +10,25 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.platform.GlStateManager; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.AbstractGui; +import net.minecraft.fluid.Fluid; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fml.client.config.GuiUtils; +import net.minecraftforge.fluids.capability.templates.FluidTank; +import net.minecraftforge.fml.client.gui.GuiUtils; import java.text.NumberFormat; import java.util.Collections; @OnlyIn(Dist.CLIENT) -public class FluidDisplay extends Gui { +public class FluidDisplay extends AbstractGui { private FluidTank fluidReference; private Fluid oldFluid; @@ -53,7 +57,7 @@ public class FluidDisplay extends Gui { this.drawTextNextTo = drawTextNextTo; } - public void draw() { + public void draw(MatrixStack matrices) { Minecraft mc = Minecraft.getInstance(); mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); @@ -100,7 +104,7 @@ public class FluidDisplay extends Gui { } } - public void drawOverlay(int mouseX, int mouseY) { + public void render(MatrixStack matrices, int mouseX, int mouseY) { if (mouseX >= this.x && mouseY >= this.y && mouseX < this.x + (this.outline ? 26 : 18) && mouseY < this.y + (this.outline diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java index 58c3e920a..65ce4c47d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java @@ -11,7 +11,6 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; import com.mojang.blaze3d.matrix.MatrixStack; -import com.mojang.blaze3d.platform.GlStateManager; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerBag; import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; @@ -71,7 +70,7 @@ public class GuiBag extends GuiWtfMojang { @Override public void updateScreen() { super.updateScreen(); - this.filter.update(); + this.filter.tick(); this.buttonAutoInsert.displayString = (this.container.autoInsert ? TextFormatting.DARK_GREEN @@ -103,7 +102,7 @@ public class GuiBag extends GuiWtfMojang { @Override protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int x, int y) { - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrixStack, this.guiLeft, this.guiTop + 90, 0, 0, 176, 86); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java index 1f0132f0b..1404b750a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.inventory.ContainerBioReactor; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -38,19 +39,19 @@ public class GuiBioReactor extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); - this.energy.drawOverlay(x, y); + public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) { + super.render(matrices, mouseX, mouseY, partialTicks); + this.energy.render(mouseX, mouseY); } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.tile); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.tile); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float partialTicks, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -64,7 +65,7 @@ public class GuiBioReactor extends GuiWtfMojang { } if (this.tile.producePerTick > 0) { - this.drawCenteredString(this.font, this.tile.producePerTick + " " + I18n.format("actuallyadditions.cft"), this.guiLeft + 87, this.guiTop + 86, 0xFFFFFF); + drawCenteredString(matrices, this.font, this.tile.producePerTick + " " + I18n.format("actuallyadditions.cft"), this.guiLeft + 87, this.guiTop + 86, 0xFFFFFF); } this.energy.draw(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java index 6c38e75ad..e610bf4fc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.inventory.ContainerCanolaPress; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -43,21 +43,21 @@ public class GuiCanolaPress extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); - this.energy.drawOverlay(x, y); - this.fluid.drawOverlay(x, y); + this.energy.render(matrices, x, y); + this.fluid.render(matrices, x, y); } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.press); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.press); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -70,7 +70,7 @@ public class GuiCanolaPress extends GuiWtfMojang { this.blit(matrices, this.guiLeft + 83, this.guiTop + 32, 176, 0, 12, i); } - this.energy.draw(); - this.fluid.draw(); + this.energy.draw(matrices); + this.fluid.draw(matrices); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java index 9f07bd59e..e1494a9f1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoalGenerator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -17,7 +18,7 @@ import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; import net.minecraftforge.api.distmarker.Dist; - +import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class GuiCoalGenerator extends GuiWtfMojang { @@ -40,19 +41,19 @@ public class GuiCoalGenerator extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); - this.energy.drawOverlay(x, y); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); + this.energy.render(matrices, x, y); } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.generator); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.generator); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -65,6 +66,6 @@ public class GuiCoalGenerator extends GuiWtfMojang { this.blit(matrices, this.guiLeft + 87, this.guiTop + 27 + 12 - i, 176, 96 - i, 14, i); } - this.energy.draw(); + this.energy.draw(matrices); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java index bdee1cc22..7fe2ef2dd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java @@ -10,16 +10,20 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.client.gui.widget.button.Button; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import java.util.Collections; @@ -43,7 +47,7 @@ public class GuiCoffeeMachine extends GuiWtfMojang { public void init() { super.init(); - Button buttonOkay = new Button(0, this.guiLeft + 60, this.guiTop + 11, 58, 20, StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.ok")); + Button buttonOkay = new Button(this.guiLeft + 60, this.guiTop + 11, 58, 20, StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.ok")); this.addButton(buttonOkay); this.energy = new EnergyDisplay(this.guiLeft + 16, this.guiTop + 5, this.machine.storage); @@ -51,26 +55,26 @@ public class GuiCoffeeMachine extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); String text2 = this.machine.coffeeCacheAmount + "/" + TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT + " " + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.coffee"); if (x >= this.guiLeft + 40 && y >= this.guiTop + 25 && x <= this.guiLeft + 49 && y <= this.guiTop + 56) { this.drawHoveringText(Collections.singletonList(text2), x, y); } - this.energy.drawOverlay(x, y); - this.fluid.drawOverlay(x, y); + this.energy.render(matrices, x, y); + this.fluid.render(matrices, x, y); } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.machine); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.machine); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -91,8 +95,8 @@ public class GuiCoffeeMachine extends GuiWtfMojang { this.blit(matrices, this.guiLeft + 99 + 25 - j, this.guiTop + 44, 192 + 25 - j, 46, j, 12); } - this.energy.draw(); - this.fluid.draw(); + this.energy.draw(matrices); + this.fluid.draw(matrices); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java index 3a74fee2a..167d8af83 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.inventory.ContainerDirectionalBreaker; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -20,7 +20,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; - @OnlyIn(Dist.CLIENT) public class GuiDirectionalBreaker extends GuiWtfMojang { @@ -42,20 +41,20 @@ public class GuiDirectionalBreaker extends GuiWtfMojang { } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + ".drill.name")); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + ".drill.name")); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 54, 0, 0, 176, 86); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java index cca8d2242..f4f3d3192 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.inventory.ContainerDropper; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -35,13 +35,13 @@ public class GuiDropper extends GuiWtfMojang { } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.dropper); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.dropper); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java index c35536bc0..08651d2da 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnergizer; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -41,19 +41,19 @@ public class GuiEnergizer extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); - this.energy.drawOverlay(x, y); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); + this.energy.render(matrices, x, y); } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.energizer); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.energizer); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -61,6 +61,6 @@ public class GuiEnergizer extends GuiWtfMojang { this.getMinecraft().getTextureManager().bindTexture(RES_LOC); this.blit(matrices, this.guiLeft, this.guiTop, 0, 0, 176, 93); - this.energy.draw(); + this.energy.draw(matrices); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java index 02a1c669e..7032bba0a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnervator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -42,19 +42,19 @@ public class GuiEnervator extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); - this.energy.drawOverlay(x, y); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); + this.energy.render(matrices, x, y); } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.enervator); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.enervator); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -62,6 +62,6 @@ public class GuiEnervator extends GuiWtfMojang { this.getMinecraft().getTextureManager().bindTexture(RES_LOC); this.blit(matrices, this.guiLeft, this.guiTop, 0, 0, 176, 93); - this.energy.draw(); + this.energy.draw(matrices); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java index 9c7c03bbf..5bbde7520 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.inventory.ContainerFarmer; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFarmer; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -44,13 +44,13 @@ public class GuiFarmer extends GuiWtfMojang { } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.farmer); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.farmer); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -58,12 +58,12 @@ public class GuiFarmer extends GuiWtfMojang { this.getMinecraft().getTextureManager().bindTexture(RES_LOC); this.blit(matrices, this.guiLeft, this.guiTop, 0, 0, 176, 93); - this.energy.draw(); + this.energy.draw(matrices); } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); - this.energy.drawOverlay(x, y); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); + this.energy.render(matrices, x, y); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java index 10a2af8e5..30fb1752b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerFeeder; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder; @@ -38,8 +38,8 @@ public class GuiFeeder extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); if (x >= this.guiLeft + 69 && y >= this.guiTop + 30 && x <= this.guiLeft + 69 + 10 && y <= this.guiTop + 30 + 10) { String[] array = new String[]{this.tileFeeder.currentAnimalAmount + " " + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.animals"), this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.enoughToBreed") @@ -51,13 +51,13 @@ public class GuiFeeder extends GuiWtfMojang { } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.tileFeeder); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.tileFeeder); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 70, 0, 0, 176, 86); this.getMinecraft().getTextureManager().bindTexture(RES_LOC); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java index f6a4b1081..7c988e8fc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.inventory.ContainerFermentingBarrel; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -37,10 +37,10 @@ public class GuiFermentingBarrel extends GuiWtfMojang } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); - this.input.drawOverlay(x, y); - this.output.drawOverlay(x, y); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); + this.input.render(matrices, x, y); + this.output.render(matrices, x, y); } @Override @@ -51,13 +51,13 @@ public class GuiFermentingBarrel extends GuiWtfMojang } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.press); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.press); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -70,7 +70,7 @@ public class GuiFermentingBarrel extends GuiWtfMojang this.blit(matrices, this.guiLeft + 82, this.guiTop + 34, 176, 0, 12, i); } - this.input.draw(); - this.output.draw(); + this.input.draw(matrices); + this.output.draw(matrices); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java index 31c839379..07d50ae89 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java @@ -10,7 +10,8 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -21,7 +22,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; - @OnlyIn(Dist.CLIENT) public class GuiFilter extends GuiWtfMojang { @@ -34,13 +34,13 @@ public class GuiFilter extends GuiWtfMojang { } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + ".filter.name")); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + ".filter.name")); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 90, 0, 0, 176, 86); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFireworkBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFireworkBox.java index b0be5d15d..644f35426 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFireworkBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFireworkBox.java @@ -14,16 +14,14 @@ import de.ellpeck.actuallyadditions.mod.inventory.ContainerFireworkBox; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFireworkBox; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; -import net.minecraft.client.gui.GuiPageButtonList.GuiResponder; -import net.minecraft.client.gui.GuiSlider; -import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) -public class GuiFireworkBox extends GuiContainer implements GuiResponder { +public class GuiFireworkBox extends ContainerScreen implements GuiResponder { private final TileEntityFireworkBox tile; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java index e4f1a5aca..3d3a7e467 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java @@ -10,7 +10,8 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.inventory.ContainerFluidCollector; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidCollector; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -36,10 +37,10 @@ public class GuiFluidCollector extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); - this.fluid.drawOverlay(x, y); + this.fluid.render(matrices, x, y); } @Override @@ -49,13 +50,13 @@ public class GuiFluidCollector extends GuiWtfMojang { } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.collector); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.collector); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -63,6 +64,6 @@ public class GuiFluidCollector extends GuiWtfMojang { this.getMinecraft().getTextureManager().bindTexture(RES_LOC); this.blit(matrices, this.guiLeft, this.guiTop, 0, 0, 176, 93); - this.fluid.draw(); + this.fluid.draw(matrices); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java index 144e7057b..46bf9c246 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java @@ -10,16 +10,19 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerFurnaceDouble; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.client.gui.widget.button.Button; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -44,11 +47,11 @@ public class GuiFurnaceDouble extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); - this.energy.drawOverlay(x, y); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); + this.energy.render(matrices, x, y); - if (this.buttonAutoSplit.isMouseOver()) { + if (this.buttonAutoSplit.isMouseOver(x, y)) { this.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.tileFurnace.isAutoSplit ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.on") : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.off"))), x, y); @@ -64,13 +67,14 @@ public class GuiFurnaceDouble extends GuiWtfMojang { this.addButton(this.buttonAutoSplit); } - @Override - public void updateScreen() { - super.updateScreen(); - this.buttonAutoSplit.displayString = (this.tileFurnace.isAutoSplit + @Override + public void tick() { + super.tick(); + + this.buttonAutoSplit.setMessage(new StringTextComponent("S").mergeStyle(this.tileFurnace.isAutoSplit ? TextFormatting.DARK_GREEN - : TextFormatting.RED) + "S"; + : TextFormatting.RED)); } @Override @@ -81,13 +85,13 @@ public class GuiFurnaceDouble extends GuiWtfMojang { } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.tileFurnace); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.tileFurnace); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -104,6 +108,6 @@ public class GuiFurnaceDouble extends GuiWtfMojang { this.blit(matrices, this.guiLeft + 101, this.guiTop + 40, 176, 22, 24, i); } - this.energy.draw(); + this.energy.draw(matrices); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java index 2f479de0f..f376196cf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java @@ -70,7 +70,7 @@ // // @Override // public void drawGuiContainerBackgroundLayer(float f, int x, int y) { -// GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); +// RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); // this.getMinecraft().getTextureManager().bindTexture(RES_LOC); // this.blit(matrices, this.guiLeft, this.guiTop, 0, 0, 242, 190); // this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java index 7eed6e2b0..a3b56cd8a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java @@ -10,11 +10,11 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; @@ -22,6 +22,7 @@ import net.minecraft.client.gui.widget.button.Button; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -40,10 +41,6 @@ public class GuiGrinder extends GuiWtfMojang { private Button buttonAutoSplit; - public GuiGrinder(PlayerInventory inventoryPlayer, TileEntityBase tile) { - this(inventoryPlayer, tile, false); - } - private GuiGrinder(ContainerGrinder container, PlayerInventory inventory, ITextComponent title) { super(container, inventory); this.tileGrinder = container.tileGrinder; @@ -73,20 +70,20 @@ public class GuiGrinder extends GuiWtfMojang { } @Override - public void updateScreen() { - super.updateScreen(); + public void tick() { + super.tick(); if (this.isDouble) { - this.buttonAutoSplit.displayString = (this.tileGrinder.isAutoSplit + this.buttonAutoSplit.setMessage(new StringTextComponent("S").mergeStyle(this.tileGrinder.isAutoSplit ? TextFormatting.DARK_GREEN - : TextFormatting.RED) + "S"; + : TextFormatting.RED); } } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); - this.energy.drawOverlay(x, y); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); + this.energy.render(matrices, x, y); if (this.isDouble && this.buttonAutoSplit.isMouseOver()) { @@ -97,13 +94,13 @@ public class GuiGrinder extends GuiWtfMojang { } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.tileGrinder); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.tileGrinder); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -126,13 +123,13 @@ public class GuiGrinder extends GuiWtfMojang { } } - this.energy.draw(); + this.energy.draw(matrices); } public static class GuiGrinderDouble extends GuiGrinder { - public GuiGrinderDouble(PlayerInventory inventory, TileEntityBase tile) { - super(inventory, tile, true); + public GuiGrinderDouble(ContainerGrinder containerGrinder, PlayerInventory inventory, ITextComponent tile) { + super(containerGrinder, inventory, tile); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java index d8d3887a8..59e99f22b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java @@ -10,14 +10,15 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; +import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerInputter; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; import de.ellpeck.actuallyadditions.mod.tile.TileEntityInputter; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.java.games.input.Keyboard; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.client.gui.widget.button.Button; @@ -27,8 +28,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import java.io.IOException; - @OnlyIn(Dist.CLIENT) public class GuiInputter extends GuiWtfMojang { @@ -65,27 +64,33 @@ public class GuiInputter extends GuiWtfMojang { this.rightFilter = new FilterSettingsGui(this.tileInputter.rightFilter, this.guiLeft + 157, this.guiTop + 6, this.buttonList); } - this.fieldPullStart = new TextFieldWidget(3000, this.font, this.guiLeft + 6, this.guiTop + 80 + (this.isAdvanced + this.fieldPullStart = new TextFieldWidget(this.font, this.guiLeft + 6, this.guiTop + 80 + (this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); this.fieldPullStart.setMaxStringLength(5); this.fieldPullStart.setEnableBackgroundDrawing(false); - this.fieldPullEnd = new TextFieldWidget(3001, this.font, this.guiLeft + 50, this.guiTop + 80 + (this.isAdvanced + this.children.add(this.fieldPullStart); + + this.fieldPullEnd = new TextFieldWidget(this.font, this.guiLeft + 50, this.guiTop + 80 + (this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); this.fieldPullEnd.setMaxStringLength(5); this.fieldPullEnd.setEnableBackgroundDrawing(false); + this.children.add(this.fieldPullEnd); - this.fieldPutStart = new TextFieldWidget(3002, this.font, this.guiLeft + 91, this.guiTop + 80 + (this.isAdvanced + this.fieldPutStart = new TextFieldWidget(this.font, this.guiLeft + 91, this.guiTop + 80 + (this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); this.fieldPutStart.setMaxStringLength(5); this.fieldPutStart.setEnableBackgroundDrawing(false); - this.fieldPutEnd = new TextFieldWidget(3004, this.font, this.guiLeft + 135, this.guiTop + 80 + (this.isAdvanced + this.children.add(this.fieldPutStart); + + this.fieldPutEnd = new TextFieldWidget(this.font, this.guiLeft + 135, this.guiTop + 80 + (this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); this.fieldPutEnd.setMaxStringLength(5); this.fieldPutEnd.setEnableBackgroundDrawing(false); + this.children.add(this.fieldPutEnd); SmallerButton buttonSidePutP = new SmallerButton(0, this.guiLeft + 155, this.guiTop + 43 + (this.isAdvanced ? OFFSET_ADVANCED @@ -112,8 +117,8 @@ public class GuiInputter extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); int newTopOffset = this.guiTop + (this.isAdvanced ? OFFSET_ADVANCED @@ -139,13 +144,13 @@ public class GuiInputter extends GuiWtfMojang { } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.tileInputter); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.tileInputter); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 97 + (this.isAdvanced @@ -159,86 +164,81 @@ public class GuiInputter extends GuiWtfMojang { ? OFFSET_ADVANCED : 0)); - this.font.drawString(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.inbound"), this.guiLeft + 23 + 3, this.guiTop + 32 + (this.isAdvanced + this.font.drawString(matrices, StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.inbound"), this.guiLeft + 23 + 3, this.guiTop + 32 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.font.drawString(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.outbound"), this.guiLeft + 104 + 3, this.guiTop + 32 + (this.isAdvanced + this.font.drawString(matrices, StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.outbound"), this.guiLeft + 104 + 3, this.guiTop + 32 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.font.drawString(SIDES[this.tileInputter.sideToPull + 1], this.guiLeft + 24 + 1, this.guiTop + 45 + 3 + (this.isAdvanced + this.font.drawString(matrices, SIDES[this.tileInputter.sideToPull + 1], this.guiLeft + 24 + 1, this.guiTop + 45 + 3 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.font.drawString(SIDES[this.tileInputter.sideToPut + 1], this.guiLeft + 109 + 1, this.guiTop + 45 + 3 + (this.isAdvanced + this.font.drawString(matrices, SIDES[this.tileInputter.sideToPut + 1], this.guiLeft + 109 + 1, this.guiTop + 45 + 3 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.font.drawString(Integer.toString(this.tileInputter.slotToPutStart), this.guiLeft + 92, this.guiTop + 67 + (this.isAdvanced + this.font.drawString(matrices, Integer.toString(this.tileInputter.slotToPutStart), this.guiLeft + 92, this.guiTop + 67 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); - this.font.drawString(Integer.toString(this.tileInputter.slotToPutEnd), this.guiLeft + 136, this.guiTop + 67 + (this.isAdvanced + this.font.drawString(matrices, Integer.toString(this.tileInputter.slotToPutEnd), this.guiLeft + 136, this.guiTop + 67 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); - this.font.drawString(Integer.toString(this.tileInputter.slotToPullStart), this.guiLeft + 7, this.guiTop + 67 + (this.isAdvanced + this.font.drawString(matrices, Integer.toString(this.tileInputter.slotToPullStart), this.guiLeft + 7, this.guiTop + 67 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); - this.font.drawString(Integer.toString(this.tileInputter.slotToPullEnd), this.guiLeft + 51, this.guiTop + 67 + (this.isAdvanced + this.font.drawString(matrices, Integer.toString(this.tileInputter.slotToPullEnd), this.guiLeft + 51, this.guiTop + 67 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); - - this.fieldPutStart.drawTextBox(); - this.fieldPutEnd.drawTextBox(); - this.fieldPullStart.drawTextBox(); - this.fieldPullEnd.drawTextBox(); } - @Override - protected void mouseClicked(int par1, int par2, int par3) throws IOException { - this.fieldPutStart.mouseClicked(par1, par2, par3); - this.fieldPutEnd.mouseClicked(par1, par2, par3); - this.fieldPullStart.mouseClicked(par1, par2, par3); - this.fieldPullEnd.mouseClicked(par1, par2, par3); + // @Override + // protected void mouseClicked(int par1, int par2, int par3) throws IOException { + // this.fieldPutStart.mouseClicked(par1, par2, par3); + // this.fieldPutEnd.mouseClicked(par1, par2, par3); + // this.fieldPullStart.mouseClicked(par1, par2, par3); + // this.fieldPullEnd.mouseClicked(par1, par2, par3); + // + // super.mouseClicked(par1, par2, par3); + // } - super.mouseClicked(par1, par2, par3); - } + // @Override + // public void keyTyped(char theChar, int key) throws IOException { + // if (key == Keyboard.KEY_RETURN || key == Keyboard.KEY_NUMPADENTER) { + // if (this.fieldPutStart.isFocused()) { + // this.setVariable(this.fieldPutStart, 0); + // } + // if (this.fieldPutEnd.isFocused()) { + // this.setVariable(this.fieldPutEnd, 1); + // } + // if (this.fieldPullStart.isFocused()) { + // this.setVariable(this.fieldPullStart, 2); + // } + // if (this.fieldPullEnd.isFocused()) { + // this.setVariable(this.fieldPullEnd, 3); + // } + // } else if (Character.isDigit(theChar) || key == Keyboard.KEY_BACK || key == Keyboard.KEY_DELETE || key == Keyboard.KEY_LEFT || key == Keyboard.KEY_RIGHT) { + // this.fieldPutStart.textboxKeyTyped(theChar, key); + // this.fieldPutEnd.textboxKeyTyped(theChar, key); + // this.fieldPullStart.textboxKeyTyped(theChar, key); + // this.fieldPullEnd.textboxKeyTyped(theChar, key); + // } else { + // super.keyTyped(theChar, key); + // } + // } @Override - public void keyTyped(char theChar, int key) throws IOException { - if (key == Keyboard.KEY_RETURN || key == Keyboard.KEY_NUMPADENTER) { - if (this.fieldPutStart.isFocused()) { - this.setVariable(this.fieldPutStart, 0); - } - if (this.fieldPutEnd.isFocused()) { - this.setVariable(this.fieldPutEnd, 1); - } - if (this.fieldPullStart.isFocused()) { - this.setVariable(this.fieldPullStart, 2); - } - if (this.fieldPullEnd.isFocused()) { - this.setVariable(this.fieldPullEnd, 3); - } - } else if (Character.isDigit(theChar) || key == Keyboard.KEY_BACK || key == Keyboard.KEY_DELETE || key == Keyboard.KEY_LEFT || key == Keyboard.KEY_RIGHT) { - this.fieldPutStart.textboxKeyTyped(theChar, key); - this.fieldPutEnd.textboxKeyTyped(theChar, key); - this.fieldPullStart.textboxKeyTyped(theChar, key); - this.fieldPullEnd.textboxKeyTyped(theChar, key); - } else { - super.keyTyped(theChar, key); - } - } - - @Override - public void updateScreen() { - super.updateScreen(); - - this.fieldPutStart.updateCursorCounter(); - this.fieldPutEnd.updateCursorCounter(); - this.fieldPullStart.updateCursorCounter(); - this.fieldPullEnd.updateCursorCounter(); + public void tick() { + super.tick(); + // + // this.fieldPutStart.updateCursorCounter(); + // this.fieldPutEnd.updateCursorCounter(); + // this.fieldPullStart.updateCursorCounter(); + // this.fieldPullEnd.updateCursorCounter(); if (this.isAdvanced) { - this.leftFilter.update(); - this.rightFilter.update(); + this.leftFilter.tick(); + this.rightFilter.tick(); } } @@ -279,23 +279,23 @@ public class GuiInputter extends GuiWtfMojang { public final ResourceLocation resLoc = AssetUtil.getGuiLocation("gui_inputter"); private final boolean smaller; - public SmallerButton(int id, int x, int y, String display) { - this(id, x, y, display, false); + public SmallerButton(int x, int y, ITextComponent display, IPressable pressable) { + this(x, y, display, false, pressable); } - public SmallerButton(int id, int x, int y, String display, boolean smaller) { - super(id, x, y, 16, smaller + public SmallerButton(int x, int y, ITextComponent display, boolean smaller, IPressable pressable) { + super(x, y, 16, smaller ? 12 - : 16, display); + : 16, display, pressable); this.smaller = smaller; } @Override - public void drawButton(Minecraft mc, int x, int y, float f) { + public void render(MatrixStack matrices, int x, int y, float f) { if (this.visible) { - mc.getTextureManager().bindTexture(this.resLoc); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.hovered = x >= this.x && y >= this.y && x < this.x + this.width && y < this.y + this.height; + Minecraft.getInstance().getTextureManager().bindTexture(this.resLoc); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + this.isHovered = x >= this.x && y >= this.y && x < this.x + this.width && y < this.y + this.height; int k = this.getHoverState(this.hovered); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); @@ -332,7 +332,7 @@ public class GuiInputter extends GuiWtfMojang { public void drawButton(Minecraft mc, int x, int y, float f) { if (this.visible) { mc.getTextureManager().bindTexture(this.resLoc); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = x >= this.x && y >= this.y && x < this.x + this.width && y < this.y + this.height; int k = this.getHoverState(this.hovered); GlStateManager.enableBlend(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java index 0619d7c84..8ff47e245 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java @@ -10,7 +10,8 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiInputter.SmallerButton; @@ -49,11 +50,11 @@ public class GuiLaserRelayItemWhitelist extends GuiWtfMojang list = new ArrayList<>(); @@ -90,18 +91,18 @@ public class GuiLaserRelayItemWhitelist extends GuiWtfMojang { public void init() { super.init(); - Button buttonMode = new Button(0, this.guiLeft + this.xSize / 2 - 51, this.guiTop + 75, 50, 20, "Mode"); + Button buttonMode = new Button(this.guiLeft + this.xSize / 2 - 51, this.guiTop + 75, 50, 20, "Mode", button -> { + }); this.addButton(buttonMode); - Button buttonReset = new Button(1, this.guiLeft + this.xSize / 2 + 1, this.guiTop + 75, 50, 20, "Reset"); + Button buttonReset = new Button(this.guiLeft + this.xSize / 2 + 1, this.guiTop + 75, 50, 20, "Reset", button -> { + }); this.addButton(buttonReset); } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.miner); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.miner); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -65,7 +69,7 @@ public class GuiMiner extends GuiWtfMojang { String mining = this.miner.onlyMineOres ? "Only Mining Ores" : "Mining Everything"; - this.font.drawString(mining, this.guiLeft + this.xSize / 2 - this.font.getStringWidth(mining) / 2, this.guiTop + 8, StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.font.drawString(matrices, mining, this.guiLeft + this.xSize / 2 - this.font.getStringWidth(mining) / 2, this.guiTop + 8, StringUtil.DECIMAL_COLOR_GRAY_TEXT); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java index b29f3bb8e..acdb4823e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java @@ -10,7 +10,8 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.inventory.ContainerOilGenerator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -47,20 +48,20 @@ public class GuiOilGenerator extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); - this.energy.drawOverlay(x, y); - this.fluid.drawOverlay(x, y); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); + this.energy.render(matrices, x, y); + this.fluid.render(matrices, x, y); } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.generator); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.generator); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); @@ -74,16 +75,16 @@ public class GuiOilGenerator extends GuiWtfMojang { } if (this.generator.maxBurnTime > 0 && this.generator.currentEnergyProduce > 0) { - this.drawCenteredString(this.font, this.generator.currentEnergyProduce + " " + I18n.format("actuallyadditions.cft"), this.guiLeft + 87, this.guiTop + 65, 0xFFFFFF); - this.drawCenteredString(this.font, "for " + this.generator.maxBurnTime + " t", this.guiLeft + 87, this.guiTop + 75, 0xFFFFFF); - GlStateManager.pushMatrix(); - GlStateManager.scale(0.75, 0.75, 1); + drawCenteredString(matrices, this.font, this.generator.currentEnergyProduce + " " + I18n.format("actuallyadditions.cft"), this.guiLeft + 87, this.guiTop + 65, 0xFFFFFF); + drawCenteredString(matrices, this.font, "for " + this.generator.maxBurnTime + " t", this.guiLeft + 87, this.guiTop + 75, 0xFFFFFF); + matrices.push(); + matrices.scale(0.75F, 0.75F, 1F); float xS = (this.guiLeft + 87) * 1.365F - this.font.getStringWidth("(per 50 mB)") / 2F; StringUtil.renderScaledAsciiString(this.font, "(per 50 mB)", xS, (this.guiTop + 85) * 1.345F, 0xFFFFFF, true, 0.75F); - GlStateManager.popMatrix(); + matrices.pop(); } - this.energy.draw(); - this.fluid.draw(); + this.energy.draw(matrices); + this.fluid.draw(matrices); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java index 7ceabe627..39b597206 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java @@ -10,13 +10,15 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerPhantomPlacer; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.client.gui.widget.button.Button; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; @@ -51,8 +53,8 @@ public class GuiPhantomPlacer extends GuiWtfMojang { } @Override - public void updateScreen() { - super.updateScreen(); + public void tick() { + super.tick(); if (!this.placer.isBreaker) { this.buttonList.get(0).displayString = this.getSide(); @@ -60,8 +62,8 @@ public class GuiPhantomPlacer extends GuiWtfMojang { } @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - super.drawScreen(mouseX, mouseY, partialTicks); + public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) { + super.render(matrices, mouseX, mouseY, partialTicks); if (!this.placer.isBreaker && this.buttonList.get(0).isMouseOver()) { String loc = "info." + ActuallyAdditions.MODID + ".placer.sides"; @@ -85,13 +87,13 @@ public class GuiPhantomPlacer extends GuiWtfMojang { } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.placer); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.placer); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java index 01a4aa42c..492518b79 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java @@ -10,7 +10,8 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.inventory.ContainerRangedCollector; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector; @@ -45,27 +46,27 @@ public class GuiRangedCollector extends GuiWtfMojang { } @Override - public void drawScreen(int x, int y, float f) { - super.drawScreen(x, y, f); + public void render(MatrixStack matrices, int x, int y, float f) { + super.render(matrices, x, y, f); - this.filter.drawHover(x, y); + this.filter.drawHover(matrices, x, y); } @Override - public void updateScreen() { - super.updateScreen(); + public void tick() { + super.tick(); - this.filter.update(); + this.filter.tick(); } @Override - public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.font, this.xSize, -10, this.collector); + public void drawGuiContainerForegroundLayer(MatrixStack matrices, int x, int y) { + AssetUtil.displayNameString(matrices, this.font, this.xSize, -10, this.collector); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 86, 0, 0, 176, 86); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java index cc0bbf778..94c4ad2fb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java @@ -42,8 +42,8 @@ // } // // @Override -// public void drawScreen(int x, int y, float f) { -// super.drawScreen(x, y, f); +// public void render(int x, int y, float f) { +// super.render(x, y, f); // this.energy.drawOverlay(x, y); // } // @@ -54,7 +54,7 @@ // // @Override // public void drawGuiContainerBackgroundLayer(float f, int x, int y) { -// GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); +// RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); // // this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); // this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java index 80cba07ea..0ce275a00 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java @@ -75,7 +75,7 @@ // // @Override // public void drawGuiContainerBackgroundLayer(float f, int x, int y) { -// GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); +// RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); // // this.getMinecraft().getTextureManager().bindTexture(RES_LOC); // this.blit(matrices, this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java index 733ec6d30..2ba72868f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; import com.mojang.blaze3d.matrix.MatrixStack; -import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.inventory.ContainerXPSolidifier; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier; @@ -22,6 +22,7 @@ import net.minecraft.client.gui.widget.button.Button; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -43,15 +44,24 @@ public class GuiXPSolidifier extends GuiWtfMojang { public void init() { super.init(); - Button buttonOne = new GuiInputter.SmallerButton(0, this.guiLeft + 62, this.guiTop + 44, "1"); - Button buttonFive = new GuiInputter.SmallerButton(1, this.guiLeft + 80, this.guiTop + 44, "5"); - Button buttonTen = new GuiInputter.SmallerButton(2, this.guiLeft + 99, this.guiTop + 44, "10"); - Button buttonTwenty = new GuiInputter.SmallerButton(3, this.guiLeft + 62, this.guiTop + 61, "20"); - Button buttonThirty = new GuiInputter.SmallerButton(4, this.guiLeft + 80, this.guiTop + 61, "30"); - Button buttonForty = new GuiInputter.SmallerButton(5, this.guiLeft + 99, this.guiTop + 61, "40"); - Button buttonFifty = new GuiInputter.SmallerButton(6, this.guiLeft + 62, this.guiTop + 78, "50"); - Button buttonSixtyFour = new GuiInputter.SmallerButton(7, this.guiLeft + 80, this.guiTop + 78, "64"); - Button buttonAll = new GuiInputter.SmallerButton(8, this.guiLeft + 99, this.guiTop + 78, "All"); + Button buttonOne = new GuiInputter.SmallerButton(this.guiLeft + 62, this.guiTop + 44, new StringTextComponent("1"), btn -> { + }); + Button buttonFive = new GuiInputter.SmallerButton(this.guiLeft + 80, this.guiTop + 44, new StringTextComponent("5"), btn -> { + }); + Button buttonTen = new GuiInputter.SmallerButton(this.guiLeft + 99, this.guiTop + 44, new StringTextComponent("10"), btn -> { + }); + Button buttonTwenty = new GuiInputter.SmallerButton(this.guiLeft + 62, this.guiTop + 61, new StringTextComponent("20"), btn -> { + }); + Button buttonThirty = new GuiInputter.SmallerButton(this.guiLeft + 80, this.guiTop + 61, new StringTextComponent("30"), btn -> { + }); + Button buttonForty = new GuiInputter.SmallerButton(this.guiLeft + 99, this.guiTop + 61, new StringTextComponent("40"), btn -> { + }); + Button buttonFifty = new GuiInputter.SmallerButton(this.guiLeft + 62, this.guiTop + 78, new StringTextComponent("50"), btn -> { + }); + Button buttonSixtyFour = new GuiInputter.SmallerButton(this.guiLeft + 80, this.guiTop + 78, new StringTextComponent("64"), btn -> { + }); + Button buttonAll = new GuiInputter.SmallerButton(this.guiLeft + 99, this.guiTop + 78, new StringTextComponent("All"), btn -> { + }); this.addButton(buttonOne); this.addButton(buttonFive); @@ -71,7 +81,7 @@ public class GuiXPSolidifier extends GuiWtfMojang { @Override public void drawGuiContainerBackgroundLayer(MatrixStack matrices, float f, int x, int y) { - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.blit(matrices, this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java index 223b8ea1e..a44213c96 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java @@ -11,9 +11,11 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.widget.button.Button; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.StringTextComponent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.client.gui.GuiUtils; @@ -29,12 +31,12 @@ public class TexturedButton extends Button { public int texturePosX; public int texturePosY; - public TexturedButton(ResourceLocation resLoc, int id, int x, int y, int texturePosX, int texturePosY, int width, int height) { - this(resLoc, id, x, y, texturePosX, texturePosY, width, height, new ArrayList()); + public TexturedButton(ResourceLocation resLoc, int x, int y, int texturePosX, int texturePosY, int width, int height, IPressable pressable) { + this(resLoc, x, y, texturePosX, texturePosY, width, height, new ArrayList<>()); } - public TexturedButton(ResourceLocation resLoc, int id, int x, int y, int texturePosX, int texturePosY, int width, int height, List hoverTextList) { - super(id, x, y, width, height, ""); + public TexturedButton(ResourceLocation resLoc, int x, int y, int texturePosX, int texturePosY, int width, int height, List hoverTextList, IPressable pressable) { + super(x, y, width, height, StringTextComponent.EMPTY, pressable); this.texturePosX = texturePosX; this.texturePosY = texturePosY; this.resLoc = resLoc; @@ -45,7 +47,7 @@ public class TexturedButton extends Button { public void drawButton(Minecraft minecraft, int x, int y, float f) { if (this.visible) { minecraft.getTextureManager().bindTexture(this.resLoc); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = x >= this.x && y >= this.y && x < this.x + this.width && y < this.y + this.height; int k = this.getHoverState(this.hovered); if (k == 0) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java index 46516c78a..d837862b7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java @@ -27,7 +27,7 @@ public abstract class RecipeWrapperWithButton implements IRecipeWr { protected final TexturedButton theButton; public RecipeWrapperWithButton() { - this.theButton = new TexturedButton(GuiBooklet.RES_LOC_GADGETS, 23782, this.getButtonX(), this.getButtonY(), 0, 0, 20, 20); + this.theButton = new TexturedButton(GuiBooklet.RES_LOC_GADGETS, this.getButtonX(), this.getButtonY(), 0, 0, 20, 20, ); } public abstract int getButtonX();