aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java
index bc92df0e..630cf3dd 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java
@@ -3,11 +3,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures;
import com.google.gson.JsonObject;
import io.github.moulberry.notenoughupdates.NEUEventListener;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
-import io.github.moulberry.notenoughupdates.util.SBInfo;
-import io.github.moulberry.notenoughupdates.util.TexLoc;
-import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.gui.inventory.GuiChest;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.texture.DynamicTexture;
@@ -22,17 +18,14 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL14;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
-import java.util.Random;
public class BetterContainers {
@@ -53,7 +46,7 @@ public class BetterContainers {
public static long lastRenderMillis = 0;
private static int lastInvHashcode = 0;
- private static int lastHashcodeCheck = 0;
+ private static final int lastHashcodeCheck = 0;
public static HashMap<Integer, ItemStack> itemCache = new HashMap<>();
@@ -153,9 +146,7 @@ public class BetterContainers {
if(stack != null && stack.getTagCompound() != null && stack.getTagCompound().hasKey("display", 10) &&
stack.getTagCompound().getCompoundTag("display").hasKey("Lore", 9)) {
NBTTagList lore = stack.getTagCompound().getCompoundTag("display").getTagList("Lore", 8);
- if(lore.tagCount() == 1 && lore.getStringTagAt(0).equalsIgnoreCase(EnumChatFormatting.GRAY+"click to disable!")) {
- return true;
- }
+ return lore.tagCount() == 1 && lore.getStringTagAt(0).equalsIgnoreCase(EnumChatFormatting.GRAY + "click to disable!");
}
return false;
}
@@ -164,9 +155,7 @@ public class BetterContainers {
if(stack != null && stack.getTagCompound() != null && stack.getTagCompound().hasKey("display", 10) &&
stack.getTagCompound().getCompoundTag("display").hasKey("Lore", 9)) {
NBTTagList lore = stack.getTagCompound().getCompoundTag("display").getTagList("Lore", 8);
- if(lore.tagCount() == 1 && lore.getStringTagAt(0).equalsIgnoreCase(EnumChatFormatting.GRAY+"click to enable!")) {
- return true;
- }
+ return lore.tagCount() == 1 && lore.getStringTagAt(0).equalsIgnoreCase(EnumChatFormatting.GRAY + "click to enable!");
}
return false;
}
@@ -197,21 +186,21 @@ public class BetterContainers {
try {
bufferedImageBase = ImageIO.read(Minecraft.getMinecraft().getResourceManager().getResource(
new ResourceLocation("notenoughupdates:dynamic_54/style"+ backgroundStyle+"/dynamic_54.png")).getInputStream());
- } catch(Exception e) {}
+ } catch(Exception ignored) {}
BufferedImage bufferedImageSlot = ImageIO.read(Minecraft.getMinecraft().getResourceManager().getResource(DYNAMIC_54_SLOT).getInputStream());
try {
int buttonStyle = NotEnoughUpdates.INSTANCE.config.improvedSBMenu.buttonStyle+1;
buttonStyle = Math.max(1, Math.min(10, buttonStyle));
bufferedImageSlot = ImageIO.read(Minecraft.getMinecraft().getResourceManager().getResource(
new ResourceLocation("notenoughupdates:dynamic_54/style"+buttonStyle+"/dynamic_54_slot_ctm.png")).getInputStream());
- } catch(Exception e) {}
+ } catch(Exception ignored) {}
BufferedImage bufferedImageButton = ImageIO.read(Minecraft.getMinecraft().getResourceManager().getResource(DYNAMIC_54_BUTTON).getInputStream());
try {
int buttonStyle = NotEnoughUpdates.INSTANCE.config.improvedSBMenu.buttonStyle+1;
buttonStyle = Math.max(1, Math.min(10, buttonStyle));
bufferedImageButton = ImageIO.read(Minecraft.getMinecraft().getResourceManager().getResource(
new ResourceLocation("notenoughupdates:dynamic_54/style"+buttonStyle+"/dynamic_54_button_ctm.png")).getInputStream());
- } catch(Exception e) {}
+ } catch(Exception ignored) {}
int horzTexMult = bufferedImageBase.getWidth()/256;
int vertTexMult = bufferedImageBase.getWidth()/256;