From fbdbb388c369fae549cfde3eed38b536f7461d90 Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Wed, 18 Oct 2023 17:03:23 +0100 Subject: Cleaning up (#767) * Kill playerAPI * Gut more events and compat that is now obsolete * Remove commented out code * Remove final modifier from methods * Make more stuff final * Remove slow building ring * Protected -> private in final classes * More cleaning * More cleaning v2 * Purging * Clean DevHelper * Clean DevHelper 2 * delete DevHelper * remove useless IFMLLoadingPlugin.MCVersion annotation from @Mod files * check for obfuscation only once in the IFMLloadingPlugin.injectData * don't instantiate the static class ASMConfig * delete unused and empty implementation of IFMLCallHook * delete empty class * delete ClassesToTransform class that just holds the class names constants * delete unused methods and unsless logging in dummymod container * delete unused transformer ClassTransformer_TT_ThaumicRestorer * spotless * Clean * Clean utils * Build checkpoint * Purge * Stage 2 * Stage 3 * Stage 4 * Stage 5 * Stage 6 * Spotless * Imports * Stage idk * Stage 1 * Fix issue * Spotless * Format numbers --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Co-authored-by: Connor Colenso --- .../gtPlusPlus/nei/DecayableRecipeHandler.java | 4 +- .../java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java | 9 ++--- .../gtPlusPlus/nei/handlers/NeiTextureHandler.java | 45 +++------------------- 3 files changed, 12 insertions(+), 46 deletions(-) (limited to 'src/main/java/gtPlusPlus/nei') diff --git a/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java index d08ec57054..317a31d997 100644 --- a/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java +++ b/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java @@ -123,8 +123,8 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { } } - private final void sort() { - List g = new ArrayList(); + private void sort() { + List g = new ArrayList<>(); for (CachedRecipe u : arecipes) { g.add((DecayableRecipeNEI) u); } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java index 8192f11d61..f140045a4b 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java @@ -189,8 +189,7 @@ public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler { public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof GasSpargingRecipeNEI)) { - final GasSpargingRecipeNEI tRecipe = (GasSpargingRecipeNEI) tObject; + if ((tObject instanceof final GasSpargingRecipeNEI tRecipe)) { ItemStack aSpargeInput = tRecipe.mOutputs.get(0).item; ItemStack aSpentFuel = tRecipe.mOutputs.get(1).item; for (final PositionedStack tStack : tRecipe.mOutputs) { @@ -249,7 +248,7 @@ public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler { if (this.permutated) { return; } - final ArrayList tDisplayStacks = new ArrayList(); + final ArrayList tDisplayStacks = new ArrayList<>(); for (final ItemStack tStack : this.items) { if (GT_Utility.isStackValid(tStack)) { if (tStack.getItemDamage() == 32767) { @@ -282,8 +281,8 @@ public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler { public class GasSpargingRecipeNEI extends CachedRecipe implements Comparable { public final GasSpargingRecipe mRecipe; - public final List mOutputs = new ArrayList(); - public final List mInputs = new ArrayList(); + public final List mOutputs = new ArrayList<>(); + public final List mInputs = new ArrayList<>(); public GasSpargingRecipeNEI(GasSpargingRecipe tRecipe) { super(); diff --git a/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java b/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java index fc02e86011..1cec4d33e1 100644 --- a/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java +++ b/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java @@ -3,11 +3,9 @@ package gtPlusPlus.nei.handlers; import static gregtech.api.enums.Mods.GTPlusPlus; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -53,18 +51,14 @@ public final class NeiTextureHandler { public static final ResourceLocation TEXTURE = new ResourceLocation( GTPlusPlus.ID + ":textures/gui/nei/widgets.png"); - public NeiTextureHandler(int x, int y) { - this(x, y, 16, 16); - } - public NeiTextureHandler(int x, int y, int width, int height) { this( - (double) width, - (double) height, - (double) ((float) (0.00390625D * (double) x)), - (double) ((float) (0.00390625D * (double) (x + width))), - (double) ((float) (0.00390625D * (double) y)), - (double) ((float) (0.00390625D * (double) (y + height)))); + width, + height, + (float) (0.00390625D * (double) x), + (float) (0.00390625D * (double) (x + width)), + (float) (0.00390625D * (double) y), + (float) (0.00390625D * (double) (y + height))); } public NeiTextureHandler(double width, double height, double minU, double maxU, double minV, double maxV) { @@ -76,14 +70,6 @@ public final class NeiTextureHandler { this.maxV = maxV; } - public void renderIcon(double x, double y) { - this.renderIcon(x, y, this.width, this.height, 0.0D, false); - } - - public void renderIcon(double x, double y, boolean doDraw) { - this.renderIcon(x, y, this.width, this.height, 0.0D, doDraw); - } - public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw) { this.renderIcon(x, y, width, height, zLevel, doDraw, false); } @@ -130,22 +116,6 @@ public final class NeiTextureHandler { return Minecraft.getMinecraft().renderEngine; } - public static void bindItemTexture(ItemStack stack) { - engine().bindTexture(stack.getItemSpriteNumber() == 0 ? BLOCK_TEX : ITEM_TEX); - } - - public static void bindItemTexture() { - engine().bindTexture(ITEM_TEX); - } - - public static void bindBlockTexture() { - engine().bindTexture(BLOCK_TEX); - } - - public static void bindGlintTexture() { - engine().bindTexture(BLOCK_TEX); - } - public static void bindTexture(String string) { engine().bindTexture(new ResourceLocation(string)); } @@ -154,7 +124,4 @@ public final class NeiTextureHandler { engine().bindTexture(tex); } - public static FontRenderer fontRenderer() { - return Minecraft.getMinecraft().fontRenderer; - } } -- cgit