From 01ee39973acacafda7f0a2cd2cad57899721d388 Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Sun, 21 Nov 2021 10:57:50 -0600 Subject: [PATCH] So many errors.... --- .../mod/inventory/gui/Buttons.java | 48 +++++++++---------- .../mod/inventory/gui/FilterSettingsGui.java | 13 ++--- .../mod/inventory/gui/GuiCanolaPress.java | 4 +- .../mod/inventory/gui/GuiFluidCollector.java | 2 +- .../mod/inventory/gui/GuiOilGenerator.java | 4 +- .../mod/items/base/ItemFoodBase.java | 2 +- .../mod/items/base/ItemFoodSeed.java | 2 +- .../mod/items/metalists/ThePotionRings.java | 7 +-- 8 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java index 4142460c9..f5d161d39 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java @@ -1,6 +1,8 @@ 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.util.AssetUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.widget.button.Button; @@ -29,34 +31,32 @@ public class Buttons { } @Override - public void render(MatrixStack matrices, int x, int y, float f) { - /* + public void render(MatrixStack matrixStack, int x, int y, float f) { if (this.visible) { Minecraft.getInstance().getTextureManager().bind(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); + int k = this.getYImage(this.isHovered); GlStateManager._enableBlend(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.glBlendFuncSeparate(770, 771, 1, 0); GlStateManager._blendFunc(770, 771); - this.blit(matrices, this.x, this.y, this.smaller + this.blit(matrixStack, this.x, this.y, this.smaller ? 200 : 176, k * this.height, this.width, this.height); - //this.mouseDragged(mc, x, y); + //this.mouseDragged(mc, x, y); // The heck was this doing here? int color = 14737632; - if (this.packedFGColour != 0) { - color = this.packedFGColour; - } else if (!this.enabled) { + if (this.packedFGColor != 0) { + color = this.packedFGColor; + } else if (!this.active) { color = 10526880; } else if (this.isHovered) { color = 16777120; } - //this.drawCenteredString(Minecraft.getInstance().font, this.getMessage().getString(), this.x + this.width / 2, this.y + (this.height - 8) / 2, color); + drawCenteredString(matrixStack, Minecraft.getInstance().font, this.getMessage().getString(), this.x + this.width / 2, this.y + (this.height - 8) / 2, color); } - */ } } @@ -69,19 +69,19 @@ public class Buttons { super(x, y, 8, 8, new StringTextComponent(""), Button::onPress); } - //@Override - public void drawButton(Minecraft mc, int x, int y, float f) { -// if (this.visible) { -// mc.getTextureManager().bind(this.resLoc); -// 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(); -// GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); -// GlStateManager._blendFunc(770, 771); -// this.blit(matrices, this.x, this.y, 192, k * 8, 8, 8); -// this.mouseDragged(mc, x, y); -// } + @Override + public void render(MatrixStack matrixStack, int x, int y, float f) { + if (this.visible) { + Minecraft.getInstance().getTextureManager().bind(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.getYImage(this.isHovered); + GlStateManager._enableBlend(); + GlStateManager.glBlendFuncSeparate(770, 771, 1, 0); + GlStateManager._blendFunc(770, 771); + this.blit(matrixStack, this.x, this.y, 192, k * 8, 8, 8); + //this.mouseDragged(mc, x, y); + } } } } 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 dfd0a27bc..9933d8cec 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 @@ -18,6 +18,7 @@ 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.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -38,19 +39,19 @@ public class FilterSettingsGui extends AbstractGui { public FilterSettingsGui(FilterSettings settings, int x, int y, List