aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java15
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java28
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementTextField.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/GuiPositionEditor.java115
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/PositionNew.java160
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java34
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java15
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java18
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java43
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java5
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java125
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java774
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java824
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Fishing.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java42
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java73
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.pngbin11050 -> 12354 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.pngbin12260 -> 12408 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.pngbin10640 -> 10543 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.pngbin10729 -> 10623 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.pngbin0 -> 1523 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.pngbin6708 -> 11843 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpgbin0 -> 3696 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpgbin0 -> 3642 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpgbin0 -> 3687 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpgbin0 -> 3827 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpgbin0 -> 3762 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpgbin0 -> 3701 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpgbin0 -> 3604 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpgbin0 -> 3574 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpgbin0 -> 3717 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpgbin0 -> 3798 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpgbin0 -> 4003 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpgbin0 -> 3719 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpgbin0 -> 3730 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpgbin0 -> 3762 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpgbin0 -> 3706 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpgbin0 -> 3560 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpgbin0 -> 3547 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpgbin0 -> 3579 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpgbin0 -> 3609 bytes
-rw-r--r--src/main/resources/mixins.notenoughupdates.json1
50 files changed, 1773 insertions, 554 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
index 0c35c56c..7fa81a59 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
@@ -320,7 +320,7 @@ public class NEUEventListener {
if(neu.config.notifications.doRamNotif) {
long maxMemoryMB = Runtime.getRuntime().maxMemory()/1024L/1024L;
- if(maxMemoryMB > 4100 || true) {
+ if(maxMemoryMB > 4100) {
notificationDisplayMillis = System.currentTimeMillis();
notificationLines = new ArrayList<>();
notificationLines.add(EnumChatFormatting.GRAY+"Too much memory allocated!");
@@ -447,21 +447,28 @@ public class NEUEventListener {
Minecraft.getMinecraft().currentScreen instanceof GuiContainer && neu.overlay.isUsingMobsFilter()) {
event.setCanceled(true);
}
+ if(event.type != null && event.type.equals(RenderGameOverlayEvent.ElementType.PLAYER_LIST)) {
+ GlStateManager.enableDepth();
+ }
}
@SubscribeEvent
public void onRenderGameOverlayPost(RenderGameOverlayEvent.Post event) {
- if(neu.hasSkyblockScoreboard() && event.type == RenderGameOverlayEvent.ElementType.ALL) {
+ if(neu.hasSkyblockScoreboard() && event.type.equals(RenderGameOverlayEvent.ElementType.ALL)) {
DungeonWin.render(event.partialTicks);
+ GlStateManager.pushMatrix();
+ GlStateManager.translate(0, 0, -200);
for(TextOverlay overlay : OverlayManager.textOverlays) {
if(OverlayManager.dontRenderOverlay != null && OverlayManager.dontRenderOverlay.isAssignableFrom(overlay.getClass())) {
continue;
}
+ GlStateManager.translate(0, 0, -1);
+ GlStateManager.enableDepth();
overlay.render();
}
+ GlStateManager.popMatrix();
OverlayManager.dontRenderOverlay = null;
}
-
if(Keyboard.isKeyDown(Keyboard.KEY_X)) {
notificationDisplayMillis = 0;
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
index 9d2fe2fe..2a6160f1 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
@@ -1109,18 +1109,15 @@ public class NEUOverlay extends Gui {
if(rarity1 < rarity2) return mult;
if(rarity1 > rarity2) return -mult;
} else if(getCompareMode() == COMPARE_MODE_VALUE) {
- float cost1 = manager.auctionManager.getLowestBin(o1.get("internalname").getAsString());
- float cost2 = manager.auctionManager.getLowestBin(o2.get("internalname").getAsString());
+ String internal1 = o1.get("internalname").getAsString();
+ String internal2 = o2.get("internalname").getAsString();
- float craftCost1 = manager.auctionManager.getCraftCost(o1.get("internalname").getAsString()).craftCost;
- float craftCost2 = manager.auctionManager.getCraftCost(o2.get("internalname").getAsString()).craftCost;
+ float cost1 = manager.auctionManager.getLowestBin(internal1);
+ float cost2 = manager.auctionManager.getLowestBin(internal2);
- float diff = (cost1 - craftCost1) - (cost2 - craftCost2);
- if(diff > 0) return mult;
- if(diff < 0) return -mult;
- /*if(cost1 < cost2) return mult;
- if(cost1 > cost2) return -mult;*/
+ if(cost1 < cost2) return mult;
+ if(cost1 > cost2) return -mult;
}
String i1 = o1.get("internalname").getAsString();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
index 78bb6536..86a36f49 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
@@ -6,11 +6,16 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
+import com.mojang.authlib.Agent;
+import com.mojang.authlib.minecraft.MinecraftSessionService;
+import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
+import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
import io.github.moulberry.notenoughupdates.auction.CustomAHGui;
import io.github.moulberry.notenoughupdates.collectionlog.GuiCollectionLog;
import io.github.moulberry.notenoughupdates.commands.SimpleCommand;
import io.github.moulberry.notenoughupdates.core.BackgroundBlur;
import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper;
+import io.github.moulberry.notenoughupdates.core.config.GuiPositionEditor;
import io.github.moulberry.notenoughupdates.core.util.MiscUtils;
import io.github.moulberry.notenoughupdates.cosmetics.CapeManager;
import io.github.moulberry.notenoughupdates.cosmetics.GuiCosmetics;
@@ -62,6 +67,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.HttpClients;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11;
@@ -69,6 +76,7 @@ import java.awt.*;
import java.awt.datatransfer.StringSelection;
import java.io.*;
import java.lang.management.ManagementFactory;
+import java.net.Proxy;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.List;
@@ -711,9 +719,10 @@ public class NotEnoughUpdates {
private ScheduledExecutorService devES = Executors.newSingleThreadScheduledExecutor();
private static final String[] devFailStrings = {"No.", "I said no.", "You aren't allowed to use this.",
- "Are you sure you want to use this? Type 'Yes' in chat.", "Lmao you thought", "Ok please stop",
- "What do you want from me?", "This command almost certainly does nothing useful for you",
- "Ok, this is the last message, after this it will repeat", "No.", "Dammit. I thought that would work. Uhh...",
+ "Are you sure you want to use this? Type 'Yes' in chat.", "Are you sure you want to use this? Type 'Yes' in chat.",
+ "Lmao you thought", "Ok please stop", "What do you want from me?",
+ "This command almost certainly does nothing useful for you",
+ "Ok, this is the last message, after this it will repeat", "No.", "I said no.", "Dammit. I thought that would work. Uhh...",
"\u00a7dFrom \u00a7c[ADMIN] Minikloon\u00a77: If you use that command again, I'll have to ban you", "",
"Ok, this is actually the last message, use the command again and you'll crash I promise"};
private int devFailIndex = 0;
@@ -726,7 +735,7 @@ public class NotEnoughUpdates {
throw new Error("L") {
@Override
public void printStackTrace() {
- throw new Error("Double L");
+ throw new Error("L");
}
};
}
@@ -750,9 +759,15 @@ public class NotEnoughUpdates {
DupePOC.doDupe(args[0]);
return;
}*/
+ if(args.length == 1 && args[0].equalsIgnoreCase("positiontest")) {
+ openGui = new GuiPositionEditor();
+ return;
+ }
+
if(args.length == 2 && args[0].equalsIgnoreCase("pt")) {
EnumParticleTypes t = EnumParticleTypes.valueOf(args[1]);
FishingHelper.type = t;
+ return;
}
if(args.length == 1 && args[0].equalsIgnoreCase("dev")) {
NotEnoughUpdates.INSTANCE.config.hidden.dev = true;
@@ -1106,13 +1121,8 @@ public class NotEnoughUpdates {
*/
@EventHandler
public void preinit(FMLPreInitializationEvent event) {
- //if(!Minecraft.getMinecraft().getSession().getUsername().equalsIgnoreCase("moulberry")) throw new RuntimeException("moulbeBad");
-
INSTANCE = this;
- String uuid = Minecraft.getMinecraft().getSession().getPlayerID();
- if(uuid.equalsIgnoreCase("ea9b1c5a-bf68-4fa2-9492-2d4e69693228")) throw new RuntimeException("Ding-dong, racism is wrong.");
-
neuDir = new File(event.getModConfigurationDirectory(), "notenoughupdates");
neuDir.mkdirs();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java b/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java
index a4001675..8a8655f9 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java
@@ -121,6 +121,7 @@ public class BackgroundBlur {
if(event.type == RenderGameOverlayEvent.ElementType.ALL) {
processBlurs();
}
+ Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false);
}
@SubscribeEvent
@@ -215,9 +216,8 @@ public class BackgroundBlur {
output.blurShaderVert.loadShader(0);
GlStateManager.enableDepth();
GL11.glPopMatrix();
-
- Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false);
}
+ Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false);
}
public static void renderBlurredBackground(float blurStrength, int screenWidth, int screenHeight,
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementTextField.java b/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementTextField.java
index 658ab2f2..d221b37e 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementTextField.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementTextField.java
@@ -495,7 +495,7 @@ public class GuiElementTextField {
if(focus && System.currentTimeMillis()%1000>500) {
String textNCBeforeCursor = textNoColor.substring(0, textField.getCursorPosition()+prependText.length());
int colorCodes = org.apache.commons.lang3.StringUtils.countMatches(textNCBeforeCursor, "\u00B6");
- String textBeforeCursor = text.substring(0, textField.getCursorPosition()+prependText.length()+(((options & COLOUR) != 0) ? colorCodes*2 : 0));
+ String textBeforeCursor = text.substring(0, Math.min(text.length(), textField.getCursorPosition()+prependText.length()+(((options & COLOUR) != 0) ? colorCodes*2 : 0)));
int numLinesBeforeCursor = org.apache.commons.lang3.StringUtils.countMatches(textBeforeCursor, "\n");
int yOff = numLinesBeforeCursor*extraSize;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/GuiPositionEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/GuiPositionEditor.java
new file mode 100644
index 00000000..a48f3f1a
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/GuiPositionEditor.java
@@ -0,0 +1,115 @@
+package io.github.moulberry.notenoughupdates.core.config;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.Gui;
+import net.minecraft.client.gui.GuiScreen;
+import net.minecraft.client.gui.ScaledResolution;
+
+import java.io.IOException;
+
+public class GuiPositionEditor extends GuiScreen {
+
+ public PositionNew position = new PositionNew();
+
+ public int clickedX;
+ public int clickedY;
+
+ @Override
+ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
+ super.drawDefaultBackground();
+
+ ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
+ int width = scaledResolution.getScaledWidth();
+ int height = scaledResolution.getScaledHeight();
+
+ int x = position.resolveX(scaledResolution, 200);
+ int y = position.resolveY(scaledResolution, 100);
+
+ int centerWidth = 176;
+ int centerHeight = 166;
+
+ float centerWF = centerWidth/2f / (float)width;
+ float centerHF = centerHeight/2f / (float)height;
+
+ float left = 0;
+ float top = 0;
+ float right = 0;
+ float bottom = 0;
+
+ switch(position.getAnchorX()) {
+ case MIN: {
+ left = 0;
+ right = 0.5f - centerWF;
+ break;
+ }
+ case MID: {
+ left = 0.5f - centerWF;
+ right = 0.5f + centerWF;
+ break;
+ }
+ case MAX: {
+ left = 0.5f + centerWF;
+ right = 1;
+ break;
+ }
+ }
+ switch(position.getAnchorY()) {
+ case MIN: {
+ top = 0;
+ bottom = 0.5f - centerHF;
+ break;
+ }
+ case MID: {
+ top = 0.5f - centerHF;
+ bottom = 0.5f + centerHF;
+ break;
+ }
+ case MAX: {
+ top = 0.5f + centerHF;
+ bottom = 1;
+ break;
+ }
+ }
+
+ Gui.drawRect((int)(left*width), (int)(top*height), (int)(right*width), (int)(bottom*height), 0x40404040);
+ Gui.drawRect(x, y, x+200, y+100, 0x80404040);
+ }
+
+ @Override
+ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
+ ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
+ int x = position.resolveX(scaledResolution, 200);
+ int y = position.resolveY(scaledResolution, 100);
+
+ if(mouseX > x && mouseX < x+200 &&
+ mouseY > y && mouseY < y+100) {
+ clickedX = mouseX;
+ clickedY = mouseY;
+ } else {
+ clickedX = -1;
+ clickedY = -1;
+ }
+ }
+
+ @Override
+ protected void mouseReleased(int mouseX, int mouseY, int state) {
+ clickedX = -1;
+ clickedY = -1;
+ }
+
+ @Override
+ protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) {
+ if(clickedX >= 0 && clickedY >= 0) {
+ int deltaX = mouseX - clickedX;
+ int deltaY = mouseY - clickedY;
+
+ ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
+
+ deltaX = position.moveX(scaledResolution, deltaX, 200);
+ deltaY = position.moveY(scaledResolution, deltaY, 100);
+
+ clickedX += deltaX;
+ clickedY += deltaY;
+ }
+ }
+}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/PositionNew.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/PositionNew.java
new file mode 100644
index 00000000..842df73d
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/PositionNew.java
@@ -0,0 +1,160 @@
+package io.github.moulberry.notenoughupdates.core.config;
+
+import com.google.gson.annotations.Expose;
+import net.minecraft.client.gui.ScaledResolution;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class PositionNew {
+
+ public enum Anchor {
+ MIN(0, 0, 0),
+ MID(0.5f, -0.5f, 0),
+ MAX(1f, -1f, 0),
+ GUI_MIN(0.5f, -1f, -0.5f),
+ GUI_MAX(0.5f, 0, 0.5f);
+
+ float screenMult;
+ float elementMult;
+ float guiMult;
+
+ Anchor(float screenMult, float elementMult, float guiMult) {
+ this.screenMult = screenMult;
+ this.elementMult = elementMult;
+ this.guiMult = guiMult;
+ }
+ }
+
+ @Expose
+ private int x = 0;
+ @Expose
+ private int y = 0;
+ @Expose
+ private float scaleX = 1;
+ @Expose
+ private float scaleY = 1;
+
+ @Expose
+ private Anchor anchorX = Anchor.MIN;
+ @Expose
+ private Anchor anchorY = Anchor.MIN;
+
+ @Expose
+ private boolean pinned = false;
+ @Expose
+ private boolean allowPinToggle = true;
+ @Expose
+ private boolean allowResize = true;
+
+ public PositionNew(int x, int y, int scaleX, int scaleY, Anchor anchorX, Anchor anchorY, boolean pinned, boolean allowPinToggle, boolean allowResize) {
+ this.x = x;
+ this.y = y;
+ this.scaleX = scaleX;
+ this.scaleY = scaleY;
+ this.anchorX = anchorX;
+ this.anchorY = anchorY;
+ this.pinned = pinned;
+ this.allowPinToggle = allowPinToggle;
+ this.allowResize = allowResize;
+ }
+
+ protected PositionNew() {
+ }
+
+ public int moveX(ScaledResolution scaledResolution, int deltaX, int sizeX) {
+ int originalX = resolveX(scaledResolution, sizeX);
+ AtomicInteger atomicInteger = new AtomicInteger(x+deltaX);
+ AtomicReference<Anchor> atomicReference = new AtomicReference<>(anchorX);
+ move(atomicInteger, atomicReference, anchorY, (int)Math.ceil(sizeX*scaleX), scaledResolution.getScaledWidth(), 176);
+ x = atomicInteger.get();
+ anchorX = atomicReference.get();
+ return resolveX(scaledResolution, sizeX) - originalX;
+ }
+
+ public int moveY(ScaledResolution scaledResolution, int deltaY, int sizeY) {
+ int originalY = resolveY(scaledResolution, sizeY);
+ AtomicInteger atomicInteger = new AtomicInteger(y+deltaY);
+ AtomicReference<Anchor> atomicReference = new AtomicReference<>(anchorY);
+ move(atomicInteger, atomicReference, anchorY, (int)Math.ceil(sizeY*scaleY), scaledResolution.getScaledHeight(), 166);
+ y = atomicInteger.get();
+ anchorY = atomicReference.get();
+ return resolveY(scaledResolution, sizeY) - originalY;
+ }
+
+ private void move(AtomicInteger coord, AtomicReference<Anchor> anchor, Anchor oppositeAnchor, int elementSize, int screenSize, int guiSize) {
+ int centerCoord = resolve(coord.get(), anchor.get(), elementSize, screenSize, guiSize) + elementSize/2;
+
+ if(centerCoord < screenSize/2-guiSize/2) {
+ if(pinned && centerCoord > screenSize/4-guiSize/4 && oppositeAnchor == Anchor.MID) {
+ anchor.set(Anchor.GUI_MIN);
+ } else {
+ anchor.set(Anchor.MIN);
+ }
+ } else if(centerCoord > screenSize/2+guiSize/2) {
+ if(pinned && centerCoord < screenSize-(screenSize/4-guiSize/4) && oppositeAnchor == Anchor.MID) {
+ anchor.set(Anchor.GUI_MAX);
+ } else {
+ anchor.set(Anchor.MAX);
+ }
+ } else {
+ anchor.set(Anchor.MID);
+ }
+
+ if(centerCoord - elementSize/2 < 0) centerCoord = elementSize/2;
+ if(centerCoord + elementSize/2 > screenSize) centerCoord = screenSize - elementSize/2;
+
+ Anchor newAnchor = anchor.get();
+ coord.set(Math.round(centerCoord - (elementSize*(newAnchor.elementMult+0.5f)) - screenSize*newAnchor.screenMult - guiSize*newAnchor.guiMult));
+ }
+
+ public int resolveX(ScaledResolution scaledResolution, int sizeX) {
+ return resolve(x, anchorX, (int)Math.ceil(sizeX*scaleX), scaledResolution.getScaledWidth(), 176);
+ }
+
+ public int resolveY(ScaledResolution scaledResolution, int sizeY) {
+ return resolve(y, anchorY, (int)Math.ceil(sizeY*scaleY), scaledResolution.getScaledHeight(), 166);
+ }
+
+ private int resolve(int coord, Anchor anchor, int elementSize, int screenSize, int guiSize) {
+ return Math.round(screenSize*anchor.screenMult + elementSize*anchor.elementMult + guiSize*anchor.guiMult + coord);
+ }
+
+ public void setScaleX(float scaleX) {
+ if(allowResize) {
+ this.scaleX = scaleX;
+ }
+ }
+
+ public void setScaleY(float scaleY) {
+ if(allowResize) {
+ this.scaleY = scaleY;
+ }
+ }
+
+ public float getScaleX() {
+ return scaleX;
+ }
+
+ public float getScaleY() {
+ return scaleY;
+ }
+
+ public void setPinned(boolean pinned) {
+ if(allowPinToggle) {
+ this.pinned = pinned;
+ }
+ }
+
+ public boolean isPinned() {
+ return pinned;
+ }
+
+ public Anchor getAnchorX() {
+ return anchorX;
+ }
+
+ public Anchor getAnchorY() {
+ return anchorY;
+ }
+}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
index aeedd5d1..560cdf51 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
@@ -211,24 +211,26 @@ public class CapeManager {
public void onRenderPlayer(RenderPlayerEvent.Post e) {
if(e.partialRenderTick == 1.0F) return; //rendering in inventory
- String uuid = e.entityPlayer.getUniqueID().toString().replace("-", "");
- String clientUuid = Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", "");
-
- if(Minecraft.getMinecraft().thePlayer != null && uuid.equals(clientUuid)) {
- String selCape = NotEnoughUpdates.INSTANCE.config.hidden.selectedCape;
- if(selCape != null && !selCape.isEmpty()) {
- if(localCape == null) {
- localCape = new MutablePair<>(new NEUCape(selCape), selCape);
- } else {
- localCape.setValue(selCape);
+ try {
+ String uuid = e.entityPlayer.getUniqueID().toString().replace("-", "");
+ String clientUuid = Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", "");
+
+ if(Minecraft.getMinecraft().thePlayer != null && uuid.equals(clientUuid)) {
+ String selCape = NotEnoughUpdates.INSTANCE.config.hidden.selectedCape;
+ if(selCape != null && !selCape.isEmpty()) {
+ if(localCape == null) {
+ localCape = new MutablePair<>(new NEUCape(selCape), selCape);
+ } else {
+ localCape.setValue(selCape);
+ }
}
}
- }
- if(uuid.equals(clientUuid) && localCape != null && localCape.getRight() != null && !localCape.getRight().equals("null")) {
- localCape.getLeft().onRenderPlayer(e);
- } else if(capeMap.containsKey(uuid)) {
- capeMap.get(uuid).getLeft().onRenderPlayer(e);
- }
+ if(uuid.equals(clientUuid) && localCape != null && localCape.getRight() != null && !localCape.getRight().equals("null")) {
+ localCape.getLeft().onRenderPlayer(e);
+ } else if(capeMap.containsKey(uuid)) {
+ capeMap.get(uuid).getLeft().onRenderPlayer(e);
+ }
+ } catch(Exception ignored) {}
}
public static void onTickSlow() {
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 5af6e8bb..48601df3 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java
@@ -348,7 +348,7 @@ public class BetterContainers {
return false;
}
- private static int getCTMIndex(boolean up, boolean right, boolean down, boolean left, boolean upleft, boolean upright, boolean downright, boolean downleft) {
+ public static int getCTMIndex(boolean up, boolean right, boolean down, boolean left, boolean upleft, boolean upright, boolean downright, boolean downleft) {
if(up && right && down && left) {
if(upleft && upright && downright && downleft) {
return 26;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
index 71fec1c7..32c64f4c 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
@@ -68,6 +68,10 @@ public class FishingHelper {
private static final ResourceLocation FISHING_WARNING_EXCLAM = new ResourceLocation("notenoughupdates:fishing_warning_exclam.png");
public void onRenderBobber(EntityFishHook hook) {
if(Minecraft.getMinecraft().thePlayer.fishEntity == hook && warningState != PlayerWarningState.NOTHING) {
+
+ if(!NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning && warningState == PlayerWarningState.FISH_INCOMING) return;
+ if(!NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR && warningState == PlayerWarningState.FISH_HOOKED) return;
+
GlStateManager.disableCull();
GlStateManager.disableLighting();
GL11.glDepthFunc(GL11.GL_ALWAYS);
@@ -134,7 +138,7 @@ public class FishingHelper {
if(Minecraft.getMinecraft().thePlayer != null && event.phase == TickEvent.Phase.END) {
if(buildupSoundDelay > 0) buildupSoundDelay--;
- if(NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning) {
+ if(NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning || NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) {
if(Minecraft.getMinecraft().thePlayer.fishEntity != null) {
if(!pingDelayList.isEmpty()) {
while(pingDelayList.size() > 5) pingDelayList.remove(pingDelayList.size()-1);
@@ -270,7 +274,8 @@ public class FishingHelper {
public boolean onSpawnParticle(EnumParticleTypes particleType, double x, double y, double z, double xOffset, double yOffset, double zOffset) {
if(!NotEnoughUpdates.INSTANCE.config.fishing.hideOtherPlayerAll &&
!NotEnoughUpdates.INSTANCE.config.fishing.enableCustomParticles &&
- !NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning) {
+ !NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning &&
+ !NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) {
return false;
}
if(hookEntities.isEmpty()) {
@@ -340,12 +345,12 @@ public class FishingHelper {
double delta = oldDistance - newDistance;
if(newDistance < 0.2 || (delta > -0.1 && delta < 0.3)) {
- if(NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning &&
+ if((NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning || NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) &&
Minecraft.getMinecraft().thePlayer.fishEntity != null &&
Minecraft.getMinecraft().thePlayer.fishEntity.getEntityId() == hookEntityId &&
chain.particleNum > 3) {
- if(newDistance <= 0.2f + 0.1f*pingDelayTicks) {
+ if(newDistance <= 0.2f + 0.1f*pingDelayTicks && NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) {
if(NotEnoughUpdates.INSTANCE.config.fishing.incomingFishHookedSounds &&
hookedWarningStateTicks <= 0) {
float vol = NotEnoughUpdates.INSTANCE.config.fishing.incomingFishHookedSoundsVol/100f;
@@ -369,7 +374,7 @@ public class FishingHelper {
}
hookedWarningStateTicks = 12;
- } else if(newDistance >= 0.4f + 0.1f*pingDelayTicks) {
+ } else if(newDistance >= 0.4f + 0.1f*pingDelayTicks && NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning) {
if(NotEnoughUpdates.INSTANCE.config.fishing.incomingFishIncSounds &&
buildupSoundDelay <= 0) {
float vol = NotEnoughUpdates.INSTANCE.config.fishing.incomingFishIncSoundsVol/100f;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java
index 546f9d89..59b3d802 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java
@@ -109,12 +109,26 @@ public class ItemCooldowns {
private static Pattern PICKAXE_COOLDOWN_LORE_REGEX = Pattern.compile("\\u00a78Cooldown: \\u00a7a(\\d+)s");
+ private static boolean isPickaxe(String internalname) {
+ if(internalname == null) return false;
+
+ if(internalname.endsWith("_PICKAXE")) {
+ return true;
+ } else if(internalname.contains("_DRILL_")) {
+ char lastChar = internalname.charAt(internalname.length()-1);
+ if(lastChar >= '0' && lastChar <= '9') {
+ return true;
+ }
+ }
+ return false;
+ }
+
private static void updatePickaxeCooldown() {
if(pickaxeCooldown == -1) {
for(ItemStack stack : Minecraft.getMinecraft().thePlayer.inventory.mainInventory) {
if(stack != null && stack.hasTagCompound()) {
String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack);
- if(internalname != null && (internalname.endsWith("_PICKAXE") || internalname.contains("_DRILL_"))) {
+ if(isPickaxe(internalname)) {
for(String line : NotEnoughUpdates.INSTANCE.manager.getLoreFromNBT(stack.getTagCompound())) {
Matcher matcher = PICKAXE_COOLDOWN_LORE_REGEX.matcher(line);
if(matcher.find()) {
@@ -154,7 +168,7 @@ public class ItemCooldowns {
return -1;
}
- if(internalname.endsWith("_PICKAXE") || internalname.contains("_DRILL_")) {
+ if(isPickaxe(internalname)) {
updatePickaxeCooldown();
if(pickaxeUseCooldownMillisRemaining < 0) {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
index e7f5c8e6..62a3a5d1 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
@@ -115,6 +115,7 @@ public class PetInfoOverlay extends TextOverlay {
private static LinkedList<Float> xpGainQueue = new LinkedList<>();
private static float xpGainHourLast = -1;
private static float xpGainHour = -1;
+ private static int pauseCountdown = 0;
private static float xpGainHourSecondPet = -1;
@@ -369,7 +370,15 @@ public class PetInfoOverlay extends TextOverlay {
if(xpGain < 0) xpGain = 0;
String xpGainString = EnumChatFormatting.AQUA + "XP/h: " +
EnumChatFormatting.YELLOW + roundFloat(xpGain);
- if(xpGain > 0 && xpGainHour == xpGainHourLast) xpGainString += EnumChatFormatting.RED + " (PAUSED)";
+ if(!secondPet && xpGain > 0 && levelXp != levelXpLast) {
+ if(pauseCountdown <= 0) {
+ xpGainString += EnumChatFormatting.RED + " (PAUSED)";
+ } else {
+ pauseCountdown--;
+ }
+ } else {
+ pauseCountdown = 60;
+ }
String totalXpString = EnumChatFormatting.AQUA + "Total XP: " + EnumChatFormatting.YELLOW + roundFloat(currentPet.petLevel.totalXp);
@@ -609,7 +618,7 @@ public class PetInfoOverlay extends TextOverlay {
if(petItem) {
ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(entry.getValue());
- itemMap.put(stack.getDisplayName(), entry.getKey());
+ itemMap.put(stack.getDisplayName().replace("\u00a7f\u00a7f", ""), entry.getKey());
}
}
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java
index 3c53c735..1925811d 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java
@@ -512,7 +512,9 @@ public class SlotLocking {
y2 -= vec.y;
}
+ GlStateManager.translate(0, 0, 200);
drawLinkArrow((int)x1, (int)y1, (int)x2, (int)y2);
+ GlStateManager.translate(0, 0, -200);
}
} else if(NotEnoughUpdates.INSTANCE.config.slotLocking.enableSlotBinding && slot.getSlotIndex() < 8 && pairingSlot != null && lockKeyHeld) {
if(!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java
index 53607fae..37a60b1b 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java
@@ -150,6 +150,7 @@ public class StorageManager {
public ItemStack backpackDisplayStack;
public String customTitle;
public int rows = -1;
+ public boolean[] shouldDarkenIfNotSelected = new boolean[45];
public transient boolean matchesSearch;
public transient int searchedId;
@@ -185,7 +186,7 @@ public class StorageManager {
private boolean shouldRenderStorageOverlayCached = false;
- private static final Pattern WINDOW_REGEX = Pattern.compile(".+ Backpack \\((\\d+)/(\\d+)\\)");
+ private static final Pattern WINDOW_REGEX = Pattern.compile(".+ Backpack (?:\u2726 )?\\((\\d+)/(\\d+)\\)");
private static final Pattern ECHEST_WINDOW_REGEX = Pattern.compile("Ender Chest \\((\\d+)/(\\d+)\\)");
public void loadConfig(File file) {
@@ -313,7 +314,7 @@ public class StorageManager {
public void sendToPage(int page) {
if(desiredStoragePage != getCurrentPageId() &&
- System.currentTimeMillis() - storageOpenSwitchMillis < 1000) return;
+ System.currentTimeMillis() - storageOpenSwitchMillis < 100) return;
if(getCurrentPageId() == page) return;
if(page == 0) {
@@ -325,6 +326,44 @@ public class StorageManager {
sendMouseClick(getCurrentWindowId(), 27+page-MAX_ENDER_CHEST_PAGES);
}
} else {
+ boolean onEnderchest = page < MAX_ENDER_CHEST_PAGES && currentStoragePage < MAX_ENDER_CHEST_PAGES;
+ boolean onStorage = page >= MAX_ENDER_CHEST_PAGES && currentStoragePage >= MAX_ENDER_CHEST_PAGES;
+ if(currentStoragePage >= 0 && (onEnderchest || (onStorage))) {
+ int currentPageDisplay = getDisplayIdForStorageId(currentStoragePage);
+ int desiredPageDisplay = getDisplayIdForStorageId(page);
+
+ if(onEnderchest && desiredPageDisplay > currentPageDisplay) {
+ boolean isLastPage = true;
+ for(int pageN=page+1; pageN<MAX_ENDER_CHEST_PAGES; pageN++) {
+ if(getDisplayIdForStorageId(pageN) >= 0) {
+ isLastPage = false;
+ break;
+ }
+ }
+ if(isLastPage) {
+ sendMouseClick(getCurrentWindowId(), 8);
+ return;
+ }
+ }
+
+ if(onStorage && page == MAX_ENDER_CHEST_PAGES) {
+ sendMouseClick(getCurrentWindowId(), 5);
+ return;
+ } else if(onStorage && desiredPageDisplay == storageConfig.displayToStorageIdMap.size()-1) {
+ sendMouseClick(getCurrentWindowId(), 8);
+ return;
+ } else {
+ int delta = desiredPageDisplay - currentPageDisplay;
+ if(delta == -1) {
+ sendMouseClick(getCurrentWindowId(), 6);
+ return;
+ } else if(delta == 1) {
+ sendMouseClick(getCurrentWindowId(), 7);
+ return;
+ }
+ }
+ }
+
storageOpenSwitchMillis = System.currentTimeMillis();
desiredStoragePage = page;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java
index f3cb2ed9..d32d74af 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java
@@ -199,9 +199,12 @@ public class GuiCustomEnchant extends Gui {
}
public boolean shouldOverride(String containerName) {
+ shouldOverrideFast = false;
+ if(true) return shouldOverrideFast;
+
shouldOverrideFast = containerName != null &&
NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() &&
- containerName.equalsIgnoreCase("Enchant Item") && !Keyboard.isKeyDown(Keyboard.KEY_K);
+ containerName.equalsIgnoreCase("Enchant Item");
if(!shouldOverrideFast) {
currentState = EnchantState.NO_ITEM;
applicable.clear();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java
index 055db5ec..c1a7ec6d 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java
@@ -6,8 +6,10 @@ import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager;
import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
@@ -25,6 +27,7 @@ public class InventoryStorageSelector {
private static final InventoryStorageSelector INSTANCE = new InventoryStorageSelector();
private static final ResourceLocation ICONS = new ResourceLocation("notenoughupdates:storage_gui/hotbar_icons.png");
+ private static final ResourceLocation STORAGE_PANE_CTM_TEXTURE = new ResourceLocation("notenoughupdates:storage_gui/storage_gui_pane_ctm.png");
public boolean isOverridingSlot = false;
public int selectedIndex = 0;
@@ -180,7 +183,8 @@ public class InventoryStorageSelector {
return 0;
}
- if(resultantSlot == 0 && direction == -1 && !isOverridingSlot) {
+ if(NotEnoughUpdates.INSTANCE.config.storageGUI.scrollToBackpack &&
+ resultantSlot == 0 && direction == -1 && !isOverridingSlot) {
isOverridingSlot = true;
Minecraft.getMinecraft().getItemRenderer().resetEquippedProgress();
return 0;
@@ -188,7 +192,8 @@ public class InventoryStorageSelector {
isOverridingSlot = false;
Minecraft.getMinecraft().getItemRenderer().resetEquippedProgress();
return 0;
- } else if(resultantSlot == 8 && direction == 1 && !isOverridingSlot) {
+ } else if(NotEnoughUpdates.INSTANCE.config.storageGUI.scrollToBackpack &&
+ resultantSlot == 8 && direction == 1 && !isOverridingSlot) {
isOverridingSlot = true;
Minecraft.getMinecraft().getItemRenderer().resetEquippedProgress();
return 0;
@@ -264,7 +269,7 @@ public class InventoryStorageSelector {
ResourceLocation storagePreviewTexture = StorageOverlay.STORAGE_PREVIEW_TEXTURES[NotEnoughUpdates.INSTANCE.config.storageGUI.displayStyle];
int startX = centerX - 172/2;
- int startY = height - 70 - (10+18*rows);
+ int startY = height - 80 - (10+18*rows);
GlStateManager.translate(0, 0, 100);
GL11.glDepthMask(false);
@@ -280,19 +285,127 @@ public class InventoryStorageSelector {
GL11.glDepthMask(true);
+ int[] isPaneCache = new int[rows*9];
+ int[] ctmIndexCache = new int[rows*9];
+
for(int i=0; i<rows*9; i++) {
ItemStack stack = page.items[i];
if(stack != null) {
- Utils.drawItemStack(stack, startX+8+18*(i%9), startY+8+18*(i/9));
+ int itemX = startX+8+18*(i%9);
+ int itemY = startY+8+18*(i/9);
+
+ int paneType = StorageOverlay.getPaneType(stack, i, isPaneCache);
+ if(paneType > 0) {
+ GlStateManager.disableAlpha();
+ Gui.drawRect(itemX-1, itemY-1, itemX+17, itemY+17, 0x01000000);
+ GlStateManager.enableAlpha();
+
+ int ctmIndex = StorageOverlay.getCTMIndex(page, i, isPaneCache, ctmIndexCache);
+ int startCTMX = (ctmIndex%12)*19;
+ int startCTMY = (ctmIndex/12)*19;
+
+ ctmIndexCache[i] = ctmIndex;
+
+ if(paneType != 17) {
+ int rgb = StorageOverlay.getRGBFromPane(paneType-1);
+ {
+ int a = (rgb >> 24) & 0xFF;
+ int r = (rgb >> 16) & 0xFF;
+ int g = (rgb >> 8) & 0xFF;
+ int b = rgb & 0xFF;
+ Minecraft.getMinecraft().getTextureManager().bindTexture(STORAGE_PANE_CTM_TEXTURE);
+ GlStateManager.color(r/255f, g/255f, b/255f, a/255f);
+ Utils.drawTexturedRect(itemX-1, itemY-1, 18, 18,
+ startCTMX/227f, (startCTMX+18)/227f, startCTMY/75f, (startCTMY+18)/75f, GL11.GL_NEAREST);
+ }
+
+ RenderItem itemRender = Minecraft.getMinecraft().getRenderItem();
+ itemRender.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRendererObj, stack, itemX, itemY, null);
+ GlStateManager.disableLighting();
+ }
+
+ page.shouldDarkenIfNotSelected[i] = false;
+ continue;
+ } else {
+ int upIndex = i-9;
+ int leftIndex = i%9 > 0 ? i-1 : -1;
+ int rightIndex = i%9 < 8 ? i+1 : -1;
+ int downIndex = i+9;
+
+ int[] indexArr = {rightIndex, downIndex, leftIndex, upIndex};
+
+ for(int j=0; j<4; j++) {
+ int index = indexArr[j];
+ int type = index >= 0 && index < isPaneCache.length ? StorageOverlay.getPaneType(page.items[index], index, isPaneCache) : -1;
+ if(type > 0) {
+ int ctmIndex = StorageOverlay.getCTMIndex(page, index, isPaneCache, ctmIndexCache);
+ if(ctmIndex < 0) continue;
+
+ boolean renderConnection;
+ boolean horizontal = ctmIndex == 1 || ctmIndex == 2 || ctmIndex == 3;
+ boolean vertical = ctmIndex == 12 || ctmIndex == 24 || ctmIndex == 36;
+ if((i%9 == 0 && index%9 == 0) || (i%9 == 8 && index%9 == 8)) {
+ renderConnection = horizontal || vertical;
+ } else if(index == leftIndex || index == rightIndex) {
+ renderConnection = horizontal;
+ } else {
+ renderConnection = vertical;
+ }
+
+ if(renderConnection) {
+ Minecraft.getMinecraft().getTextureManager().bindTexture(STORAGE_PANE_CTM_TEXTURE);
+ int rgb = StorageOverlay.getRGBFromPane(type-1);
+ int a = (rgb >> 24) & 0xFF;
+ int r = (rgb >> 16) & 0xFF;
+ int g = (rgb >> 8) & 0xFF;
+ int b = rgb & 0xFF;
+ GlStateManager.color(r/255f, g/255f, b/255f, a/255f);
+
+ GlStateManager.pushMatrix();
+ GlStateManager.translate(itemX-1+9, itemY-1+9, 10);
+ GlStateManager.rotate(j*90, 0, 0, 1);
+ GlStateManager.enableAlpha();
+ GlStateManager.disableLighting();
+
+ boolean horzFlip = false;
+ boolean vertFlip = false;
+
+ if(index == leftIndex) {
+ vertFlip = true;
+ } else if(index == downIndex) {
+ vertFlip = true;
+ }
+
+ Utils.drawTexturedRect(0, -9, 8, 18,
+ !horzFlip ? 209/227f : 219/227f, horzFlip ? 227/227f : 217/227f,
+ !vertFlip ? 57/75f : 75f/75f, vertFlip ? 57/75f : 75f/75f, GL11.GL_NEAREST);
+ Utils.drawTexturedRect(8, -9, 10, 18,
+ !horzFlip ? 217/227f : 209/227f, horzFlip ? 219/227f : 227/227f,
+ !vertFlip ? 57/75f : 75f/75f, vertFlip ? 57/75f : 75f/75f, GL11.GL_NEAREST);
+
+ GlStateManager.popMatrix();
+ }
+ }
+ }
+ }
+
+ GlStateManager.translate(0, 0, 20);
+ Utils.drawItemStack(stack, itemX, itemY);
+ GlStateManager.translate(0, 0, -20);
}
}
- ItemStack named = getNamedHeldItemOverride();
+ String pageTitle;
+ if(page.customTitle != null && !page.customTitle.isEmpty()) {
+ pageTitle = page.customTitle;
+ } else {
+ pageTitle = getNamedHeldItemOverride().getDisplayName();
+ }
Utils.drawItemStack(held, centerX-8, startY-8);
GlStateManager.translate(0, 0, 100);
- Utils.drawStringCentered(named.getDisplayName(), fontRendererObj, centerX, height - 66, true, 0xffff0000);
+ Utils.drawStringCentered(pageTitle, fontRendererObj, centerX, height - 76, true, 0xffff0000);
int keyCode = NotEnoughUpdates.INSTANCE.config.storageGUI.backpackScrollKey;
if(KeybindHelper.isKeyValid(keyCode) && !KeybindHelper.isKeyDown(keyCode)) {
String keyName = KeybindHelper.getKeyName(keyCode);
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
index 24a4f413..b8d6dc38 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
@@ -2,14 +2,13 @@ package io.github.moulberry.notenoughupdates.miscgui;
import com.google.common.collect.Lists;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
-import io.github.moulberry.notenoughupdates.core.BackgroundBlur;
-import io.github.moulberry.notenoughupdates.core.GlScissorStack;
-import io.github.moulberry.notenoughupdates.core.GuiElement;
-import io.github.moulberry.notenoughupdates.core.GuiElementTextField;
+import io.github.moulberry.notenoughupdates.core.*;
import io.github.moulberry.notenoughupdates.core.config.KeybindHelper;
import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger;
+import io.github.moulberry.notenoughupdates.miscfeatures.BetterContainers;
import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking;
import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager;
+import io.github.moulberry.notenoughupdates.util.SpecialColour;
import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
@@ -19,6 +18,10 @@ import net.minecraft.client.gui.inventory.GuiChest;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.WorldRenderer;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.shader.Framebuffer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -31,14 +34,14 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL14;
import org.lwjgl.util.vector.Vector2f;
+import org.lwjgl.util.vector.Vector4f;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.awt.*;
-import java.util.HashSet;
+import java.util.*;
import java.util.List;
-import java.util.Map;
-import java.util.Set;
public class StorageOverlay extends GuiElement {
@@ -53,7 +56,9 @@ public class StorageOverlay extends GuiElement {
public static final ResourceLocation STORAGE_PREVIEW_TEXTURES[] = new ResourceLocation[4];
private static final ResourceLocation STORAGE_TEXTURES[] = new ResourceLocation[4];
private static final ResourceLocation STORAGE_ICONS_TEXTURE = new ResourceLocation("notenoughupdates:storage_gui/storage_icons.png");
+ private static final ResourceLocation STORAGE_PANE_CTM_TEXTURE = new ResourceLocation("notenoughupdates:storage_gui/storage_gui_pane_ctm.png");
private static final ResourceLocation[] LOAD_CIRCLE_SEQ = new ResourceLocation[11];
+ private static final ResourceLocation[] NOT_RICKROLL_SEQ = new ResourceLocation[19];
static {
for(int i=0; i<STORAGE_TEXTURES.length; i++) {
STORAGE_TEXTURES[i] = new ResourceLocation("notenoughupdates:storage_gui/storage_gui_"+i+".png");
@@ -62,6 +67,10 @@ public class StorageOverlay extends GuiElement {
STORAGE_PREVIEW_TEXTURES[i] = new ResourceLocation("notenoughupdates:storage_gui/storage_preview_"+i+".png");
}
+ for(int i=0; i<NOT_RICKROLL_SEQ.length; i++) {
+ NOT_RICKROLL_SEQ[i] = new ResourceLocation("notenoughupdates:storage_gui/we_do_a_little_rolling/"+i+".jpg");
+ }
+
LOAD_CIRCLE_SEQ[0] = new ResourceLocation("notenoughupdates:loading_circle_seq/1.png");
LOAD_CIRCLE_SEQ[1] = new ResourceLocation("notenoughupdates:loading_circle_seq/1.png");
LOAD_CIRCLE_SEQ[2] = new ResourceLocation("notenoughupdates:loading_circle_seq/2.png");
@@ -79,14 +88,20 @@ public class StorageOverlay extends GuiElement {
private GuiElementTextField searchBar = new GuiElementTextField("", 88, 10,
GuiElementTextField.SCALE_TEXT | GuiElementTextField.DISABLE_BG);
+ private GuiElementTextField renameStorageField = new GuiElementTextField("", 100, 13,
+ GuiElementTextField.COLOUR);
+
+ private int editingNameId = -1;
private int guiLeft;
private int guiTop;
private int loadCircleIndex = 0;
+ private int rollIndex = 0;
private int loadCircleRotation = 0;
private long millisAccumIndex = 0;
+ private long millisAccumRoll = 0;
private long millisAccumRotation = 0;
private long lastMillis = 0;
@@ -94,6 +109,9 @@ public class StorageOverlay extends GuiElement {
private int scrollVelocity = 0;
private long lastScroll = 0;
+ private int[][] isPaneCaches = new int[40][];
+ private int[][] ctmIndexCaches = new int[40][];
+
private int desiredHeightSwitch = -1;
private int desiredHeightMX = -1;
private int desiredHeightMY = -1;
@@ -106,10 +124,19 @@ public class StorageOverlay extends GuiElement {
private int getMaximumScroll() {
synchronized(StorageManager.getInstance().storageConfig.displayToStorageIdMap) {
- int lastDisplayId = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size()-1;
- int coords = (int)Math.ceil(lastDisplayId/3f)*3+3;
- return getPageCoords(coords).y+scroll.getValue()-getStorageViewSize()-14;
+ int maxH = 0;
+
+ for(int i=0; i<3; i++) {
+ int lastDisplayId = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size()-1;
+ int coords = (int)Math.ceil(lastDisplayId/3f)*3+1+i;
+
+ int h = getPageCoords(coords).y+scroll.getValue()-getStorageViewSize()-14;
+
+ if(h > maxH) maxH = h;
+ }
+
+ return maxH;
}
}
@@ -161,6 +188,8 @@ public class StorageOverlay extends GuiElement {
@Override
public void render() {
if(!(Minecraft.getMinecraft().currentScreen instanceof GuiChest)) return;
+ GuiChest guiChest = (GuiChest) Minecraft.getMinecraft().currentScreen;
+ ContainerChest containerChest = (ContainerChest) guiChest.inventorySlots;
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
int width = scaledResolution.getScaledWidth();
@@ -196,10 +225,15 @@ public class StorageOverlay extends GuiElement {
millisAccumRotation += deltaTime;
loadCircleRotation += millisAccumRotation / (1000/107);
millisAccumRotation %= (1000/107);
+
+ millisAccumRoll += deltaTime;
+ rollIndex += millisAccumRoll/100;
+ millisAccumRoll %= 100;
}
lastMillis = currentTime;
loadCircleIndex %= LOAD_CIRCLE_SEQ.length;
+ rollIndex %= NOT_RICKROLL_SEQ.length*2;
loadCircleRotation %= 360;
Color loadCircleColour = Color.getHSBColor(loadCircleRotation/360f, 0.3f, 0.9f);
@@ -283,9 +317,14 @@ public class StorageOverlay extends GuiElement {
GlStateManager.enableDepth();
GlStateManager.translate(0, startY, 107.0001f);
framebuffer.bindFramebufferTexture();
+
GlStateManager.color(1, 1, 1, 1);
+ GlStateManager.enableAlpha();
+ GlStateManager.alphaFunc(GL11.GL_GREATER, 0F);
Utils.drawTexturedRect(0, 0, w, h, 0, 1, 1, 0, GL11.GL_NEAREST);
+ GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
+
renderEnchOverlay(enchantGlintRenderLocations);
GlStateManager.translate(0, -startY, -107.0001f);
@@ -338,22 +377,190 @@ public class StorageOverlay extends GuiElement {
if(page != null && page.rows > 0) {
int rows = page.rows;
+ isPaneCaches[storageId] = new int[page.rows*9];
+ ctmIndexCaches[storageId] = new int[page.rows*9];
+ int[] isPaneCache = isPaneCaches[storageId];
+ int[] ctmIndexCache = ctmIndexCaches[storageId];
+
for(int k=0; k<rows*9; k++) {
- ItemStack stack = page.items[k];
+ ItemStack stack;
- if(stack == null) continue;
+ if(storageId == currentPage) {
+ stack = containerChest.getSlot(k+9).getStack();
+ } else {
+ stack = page.items[k];
+ }
int itemX = storageX+1+18*(k%9);
int itemY = storageY+1+18*(k/9);
+ //Render fancy glass
+ if(stack != null) {
+ int paneType = getPaneType(stack, k, isPaneCache);
+ if(paneType > 0) {
+ GlStateManager.disableAlpha();
+ Gui.drawRect(itemX-1, itemY-1, itemX+17, itemY+17, 0x01000000);
+ GlStateManager.enableAlpha();
+
+ int ctmIndex = getCTMIndex(page, k, isPaneCache, ctmIndexCache);
+ int startCTMX = (ctmIndex%12)*19;
+ int startCTMY = (ctmIndex/12)*19;
+
+ ctmIndexCache[k] = ctmIndex;
+
+ if(paneType != 17) {
+ int rgb = getRGBFromPane(paneType-1);
+ {
+ int a = (rgb >> 24) & 0xFF;
+ int r = (rgb >> 16) & 0xFF;
+ int g = (rgb >> 8) & 0xFF;
+ int b = rgb & 0xFF;
+ Minecraft.getMinecraft().getTextureManager().bindTexture(STORAGE_PANE_CTM_TEXTURE);
+ GlStateManager.color(r/255f, g/255f, b/255f, a/255f);
+ Utils.drawTexturedRect(itemX-1, itemY-1, 18, 18,
+ startCTMX/227f, (startCTMX+18)/227f, startCTMY/75f, (startCTMY+18)/75f, GL11.GL_NEAREST);
+ }
+
+ /*int[] colours = new int[9];
+
+ for(int xi=-1; xi<=1; xi++) {
+ for(int yi=-1; yi<=1; yi++) {
+ List<Integer> indexes = new ArrayList<>();
+ List<Integer> coloursList = new ArrayList<>();
+ coloursList.add(rgb);
+
+ if(xi != 0) {
+ indexes.add(k+xi);
+ }
+ if(yi != 0) {
+ indexes.add(k+yi*9);
+ }
+ if(xi != 0 && yi != 0) {
+ indexes.add(k+yi*9+xi);
+ }
+ for(int index : indexes) {
+ if(index >= 0 && index < rows*9) {
+ int paneTypeI = getPaneType(page.items[index], index, isPaneCache);
+ if(shouldConnect(paneType, paneTypeI)) {
+ coloursList.add(getRGBFromPane(paneTypeI-1));
+ }
+ }
+ }
+ Vector4f cv = new Vector4f();
+ for(int colour : coloursList) {
+ float a = (colour >> 24) & 0xFF;
+ float r = (colour >> 16) & 0xFF;
+ float g = (colour >> 8) & 0xFF;
+ float b = colour & 0xFF;
+ cv.x += a/coloursList.size();
+ cv.y += r/coloursList.size();
+ cv.z += g/coloursList.size();
+ cv.w += b/coloursList.size();
+ }
+ int finalCol = (((int)cv.x) << 24) | (((int)cv.y) << 16) | (((int)cv.z) << 8) | ((int)cv.w);
+ colours[(xi+1)+(yi+1)*3] = finalCol;
+ }
+ }
+ int[] colours4 = new int[16];
+
+ for(int x=0; x<4; x++) {
+ for(int y=0; y<4; y++) {
+ int ya = y < 2 ? y : y-1;
+ int xa = x < 2 ? x : x-1;
+ colours4[x+y*4] = colours[xa+ya*3];
+ }
+ }
+
+ GlStateManager.pushMatrix();
+ GlStateManager.translate(itemX-1, itemY-1, 0);
+ Tessellator tessellator = Tessellator.getInstance();
+ WorldRenderer worldrenderer = tessellator.getWorldRenderer();
+ worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
+ float uMinCTM = startCTMX/227f;
+ float uMaxCTM = (startCTMX+18)/227f;
+ float vMinCTM = startCTMY/75f;
+ float vMaxCTM = (startCTMY+18)/75f;
+ for(int xi=-1; xi<=1; xi++) {
+ for(int yi = -1; yi <= 1; yi++) {
+ float x = xi == -1 ? 0 : xi == 0 ? 1 : 17;
+ float y = yi == -1 ? 0 : yi == 0 ? 1 : 17;
+ float w = xi == 0 ? 16 : 1;
+ float h = yi == 0 ? 16 : 1;
+
+ int col1 = colours4[(xi+1)+(yi+1)*4];
+ int col2 = colours4[(xi+2)+(yi+1)*4];
+ int col3 = colours4[(xi+1)+(yi+2)*4];
+ int col4 = colours4[(xi+2)+(yi+2)*4];
+
+ worldrenderer
+ .pos(x, y+h, 0.0D)
+ .tex(uMinCTM + (uMaxCTM - uMinCTM) * x/18f, vMinCTM+(vMaxCTM-vMinCTM)*(y+h)/18f)
+ .color((col3 >> 16) & 0xFF, (col3 >> 8) & 0xFF, col3 & 0xFF, (col3 >> 24) & 0xFF).endVertex();
+ worldrenderer
+ .pos(x+w, y+h, 0.0D)
+ .tex(uMinCTM+(uMaxCTM-uMinCTM)*(x+w)/18f, vMinCTM+(vMaxCTM-vMinCTM)*(y+h)/18f)
+ .color((col4 >> 16) & 0xFF, (col4 >> 8) & 0xFF, col4 & 0xFF, (col4 >> 24) & 0xFF).endVertex();
+ worldrenderer
+ .pos(x+w, y, 0.0D)
+ .tex(uMinCTM+(uMaxCTM-uMinCTM)*(x+w)/18f, vMinCTM+(vMaxCTM-vMinCTM)*y/18f)
+ .color((col2 >> 16) & 0xFF, (col2 >> 8) & 0xFF, col2 & 0xFF, (col2 >> 24) & 0xFF).endVertex();
+ worldrenderer
+ .pos(x, y, 0.0D)
+ .tex(uMinCTM + (uMaxCTM - uMinCTM) * x/18f, vMinCTM+(vMaxCTM-vMinCTM)*y/18f)
+ .color((col1 >> 16) & 0xFF, (col1 >> 8) & 0xFF, col1 & 0xFF, (col1 >> 24) & 0xFF).endVertex();
+ }
+ }
+ GlStateManager.disableDepth();
+ GlStateManager.color(1, 1, 1, 1);
+ GlStateManager.shadeModel(GL11.GL_SMOOTH);
+ tessellator.draw();
+ GlStateManager.shadeModel(GL11.GL_FLAT);
+ GlStateManager.enableDepth();
+ GlStateManager.popMatrix();*/
+
+ RenderItem itemRender = Minecraft.getMinecraft().getRenderItem();
+ itemRender.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRendererObj, stack, itemX, itemY, null);
+ GlStateManager.disableLighting();
+ }
+
+ page.shouldDarkenIfNotSelected[k] = false;
+ continue;
+ }
+ }
+ page.shouldDarkenIfNotSelected[k] = true;
+
+ //Render item
+ GlStateManager.translate(0, 0, 20);
if(doRenderFramebuffer) {
- Utils.drawItemStackWithoutGlint(stack, itemX, itemY);
- if(stack.hasEffect() || stack.getItem() == Items.enchanted_book) {
+ GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
+ GL14.glBlendFuncSeparate(GL11.GL_ONE, GL11.GL_ZERO, GL11.GL_ONE, GL11.GL_ZERO);
+
+ if(storageId == currentPage) {
+ Utils.hasEffectOverride = true;
+ GlStateManager.translate(storageX-7, storageY-17-18, 0);
+ guiChest.drawSlot(containerChest.getSlot(k+9));
+ GlStateManager.translate(-storageX+7, -storageY+17+18, 0);
+ Utils.hasEffectOverride = false;
+ } else {
+ Utils.drawItemStackWithoutGlint(stack, itemX, itemY);
+ }
+
+ GL14.glBlendFuncSeparate(770, 771, 1, 0);
+
+ if(stack != null && (stack.hasEffect() || stack.getItem() == Items.enchanted_book)) {
enchantGlintRenderLocations.add(new Vector2f(itemX, itemY-startY));
}
+ } else if(storageId == currentPage) {
+ Utils.hasEffectOverride = true;
+ GlStateManager.translate(storageX-7, storageY-17-18, 0);
+ guiChest.drawSlot(containerChest.getSlot(k+9));
+ GlStateManager.translate(-storageX+7, -storageY+17+18, 0);
+ Utils.hasEffectOverride = false;
} else {
Utils.drawItemStack(stack, itemX, itemY);
}
+ GlStateManager.disableLighting();
+ GlStateManager.translate(0, 0, -20);
}
GlStateManager.disableLighting();
@@ -386,25 +593,26 @@ public class StorageOverlay extends GuiElement {
StorageManager.StoragePage page = StorageManager.getInstance().getPage(storageId, false);
- String pageTitle;
- if(storageId < 9) {
- pageTitle = "Ender Chest Page " + (storageId + 1);
- } else if(page.customTitle != null && !page.customTitle.isEmpty()) {
- pageTitle = page.customTitle;
- } else if(page != null && page.backpackDisplayStack != null) {
- pageTitle = page.backpackDisplayStack.getDisplayName();
+ if(editingNameId == storageId) {
+ int len = fontRendererObj.getStringWidth(renameStorageField.getTextDisplay())+10;
+ renameStorageField.setSize(len, 12);
+ renameStorageField.render(storageX, storageY-13);
} else {
- pageTitle = "Backpack Slot "+(storageId-8);
- }
- int titleLen = fontRendererObj.getStringWidth(pageTitle);
- fontRendererObj.drawString(pageTitle, storageX, storageY-11, textColour);
+ String pageTitle;
+ if(page.customTitle != null && !page.customTitle.isEmpty()) {
+ pageTitle = Utils.chromaStringByColourCode(page.customTitle);
+ } else if(entry.getValue() < 9) {
+ pageTitle = "Ender Chest Page " + (entry.getValue() + 1);
+ } else {
+ pageTitle = "Backpack Slot "+(storageId-8);
+ }
+ int titleLen = fontRendererObj.getStringWidth(pageTitle);
- if(mouseX >= storageX && mouseX <= storageX+titleLen+15 &&
- mouseY >= storageY-14 && mouseY <= storageY+1) {
- Minecraft.getMinecraft().getTextureManager().bindTexture(storageTexture);
- GlStateManager.color(1, 1, 1, 1);
- Utils.drawTexturedRect(storageX+titleLen, storageY-14, 15, 15,
- 24/600f, 39/600f, 250/400f, 265/ 400f, GL11.GL_NEAREST);
+ if(mouseX >= guiLeft+storageX && mouseX <= guiLeft+storageX+titleLen+15 &&
+ mouseY >= guiTop+storageY-14 && mouseY <= guiTop+storageY+1) {
+ pageTitle += " \u270E";
+ }
+ fontRendererObj.drawString(pageTitle, storageX, storageY-11, textColour);
}
if(page == null) {
@@ -440,24 +648,137 @@ public class StorageOverlay extends GuiElement {
int storageW = 162;
int storageH = 18*rows;
+ GlStateManager.enableDepth();
+
+ boolean[] shouldLimitBorder = new boolean[rows*9];
+ boolean hasCaches = isPaneCaches[storageId] != null && isPaneCaches[storageId].length == rows*9 &&
+ ctmIndexCaches[storageId] != null && ctmIndexCaches[storageId].length == rows*9;
+
+ //Render item connections
+ for(int k=0; k<rows*9; k++) {
+ ItemStack stack = page.items[k];
+
+ if(stack != null && hasCaches) {
+ int itemX = storageX+1+18*(k%9);
+ int itemY = storageY+1+18*(k/9);
+
+ int[] isPaneCache = isPaneCaches[storageId];
+ int[] ctmIndexCache = ctmIndexCaches[storageId];
+
+ if(isPaneCache[k] == 17) {
+ int ctmIndex = getCTMIndex(page, k, isPaneCache, ctmIndexCache);
+ int startCTMX = (ctmIndex%12)*19;
+ int startCTMY = (ctmIndex/12)*19;
+
+ int rgb = getRGBFromPane(isPaneCache[k]-1);
+ int a = (rgb >> 24) & 0xFF;
+ int r = (rgb >> 16) & 0xFF;
+ int g = (rgb >> 8) & 0xFF;
+ int b = rgb & 0xFF;
+ Minecraft.getMinecraft().getTextureManager().bindTexture(STORAGE_PANE_CTM_TEXTURE);
+ GlStateManager.color(r/255f, g/255f, b/255f, a/255f);
+ GlStateManager.translate(0, 0, 110);
+ Utils.drawTexturedRect(itemX-1, itemY-1, 18, 18,
+ startCTMX/227f, (startCTMX+18)/227f, startCTMY/75f, (startCTMY+18)/75f, GL11.GL_NEAREST);
+ GlStateManager.translate(0, 0, -110);
+
+ RenderItem itemRender = Minecraft.getMinecraft().getRenderItem();
+ itemRender.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRendererObj, stack, itemX, itemY, null);
+ GlStateManager.enableDepth();
+ } else if(isPaneCache[k] < 0) {
+ boolean hasConnection = false;
+
+ int upIndex = k-9;
+ int leftIndex = k%9 > 0 ? k-1 : -1;
+ int rightIndex = k%9 < 8 ? k+1 : -1;
+ int downIndex = k+9;
+
+ int[] indexArr = {rightIndex, downIndex, leftIndex, upIndex};
+
+ for(int j=0; j<4; j++) {
+ int index = indexArr[j];
+ int type = index >= 0 && index < isPaneCache.length ? getPaneType(page.items[index], index, isPaneCache) : -1;
+ if(type > 0) {
+ int ctmIndex = getCTMIndex(page, index, isPaneCache, ctmIndexCache);
+ if(ctmIndex < 0) continue;
+
+ boolean renderConnection;
+ boolean horizontal = ctmIndex == 1 || ctmIndex == 2 || ctmIndex == 3;
+ boolean vertical = ctmIndex == 12 || ctmIndex == 24 || ctmIndex == 36;
+ if((k%9 == 0 && index%9 == 0) || (k%9 == 8 && index%9 == 8)) {
+ renderConnection = horizontal || vertical;
+ } else if(index == leftIndex || index == rightIndex) {
+ renderConnection = horizontal;
+ } else {
+ renderConnection = vertical;
+ }
+
+ if(renderConnection) {
+ shouldLimitBorder[k] = true;
+ hasConnection = true;
+
+ Minecraft.getMinecraft().getTextureManager().bindTexture(STORAGE_PANE_CTM_TEXTURE);
+ int rgb = getRGBFromPane(type-1);
+ int a = (rgb >> 24) & 0xFF;
+ int r = (rgb >> 16) & 0xFF;
+ int g = (rgb >> 8) & 0xFF;
+ int b = rgb & 0xFF;
+ GlStateManager.color(r/255f, g/255f, b/255f, a/255f);
+
+ GlStateManager.pushMatrix();
+ GlStateManager.translate(itemX-1+9, itemY-1+9, 10);
+ GlStateManager.rotate(j*90, 0, 0, 1);
+ GlStateManager.enableAlpha();
+ GlStateManager.disableLighting();
+
+ boolean horzFlip = false;
+ boolean vertFlip = false;
+
+ if(index == leftIndex) {
+ vertFlip = true;
+ } else if(index == downIndex) {
+ vertFlip = true;
+ }
+
+ GlStateManager.enableDepth();
+ Utils.drawTexturedRect(0, -9, 8, 18,
+ !horzFlip ? 209/227f : 219/227f, horzFlip ? 227/227f : 217/227f,
+ !vertFlip ? 57/75f : 75f/75f, vertFlip ? 57/75f : 75f/75f, GL11.GL_NEAREST);
+ GlStateManager.translate(0, 0, 120);
+ Utils.drawTexturedRect(8, -9, 10, 18,
+ !horzFlip ? 217/227f : 209/227f, horzFlip ? 219/227f : 227/227f,
+ !vertFlip ? 57/75f : 75f/75f, vertFlip ? 57/75f : 75f/75f, GL11.GL_NEAREST);
+ GlStateManager.translate(0, 0, -120);
+
+ GlStateManager.popMatrix();
+ }
+ }
+ }
+
+ if(hasConnection) {
+ page.shouldDarkenIfNotSelected[k] = false;
+
+ GlStateManager.disableAlpha();
+ GlStateManager.translate(0, 0, 10);
+ Gui.drawRect(itemX-1, itemY-1, itemX+17, itemY+17, 0x01000000);
+ GlStateManager.translate(0, 0, -10);
+ GlStateManager.enableAlpha();
+ }
+ }
+ }
+ }
+
Minecraft.getMinecraft().getTextureManager().bindTexture(storageTexture);
GlStateManager.color(1, 1, 1, 1);
Utils.drawTexturedRect(storageX, storageY, storageW, storageH, 0, 162/600f, 265/400f, (265+storageH)/400f, GL11.GL_NEAREST);
boolean whiteOverlay = false;
- GlStateManager.enableDepth();
for(int k=0; k<rows*9; k++) {
ItemStack stack = page.items[k];
int itemX = storageX+1+18*(k%9);
int itemY = storageY+1+18*(k/9);
- /*if(doItemRender || frameBufferItemRender) {
- GlStateManager.colorMask(true, true, true, true);
- Utils.drawItemStack(stack, itemX, itemY);
- GlStateManager.colorMask(false, false, false, false);
- }*/
-
if(!searchBar.getText().isEmpty()) {
if(stack == null || !NotEnoughUpdates.INSTANCE.manager.doesStackMatchSearch(stack, searchBar.getText())) {
GlStateManager.disableDepth();
@@ -469,15 +790,17 @@ public class StorageOverlay extends GuiElement {
GlStateManager.disableLighting();
if(mouseInsideStorages && mouseX >= guiLeft+itemX && mouseX < guiLeft+itemX+18 && mouseY >= guiTop+itemY && mouseY < guiTop+itemY+18) {
+ boolean allowHover = NotEnoughUpdates.INSTANCE.config.storageGUI.fancyPanes != 1 || !hasCaches || isPaneCaches[storageId][k] <= 0;
+
if(storageId != StorageManager.getInstance().getCurrentPageId()) {
hoveringOtherBackpack = true;
whiteOverlay = stackOnMouse == null;
- } else {
+ } else if(stack == null || allowHover) {
itemHoverX = itemX;
itemHoverY = itemY;
}
- if(stack != null) {
+ if(stack != null && allowHover) {
tooltipToDisplay = stack.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips);
}
}
@@ -485,10 +808,90 @@ public class StorageOverlay extends GuiElement {
GlStateManager.disableDepth();
if(storageId == currentPage) {
- Gui.drawRect(storageX+1, storageY, storageX, storageY+storageH, 0xffffdf00);
- Gui.drawRect(storageX+storageW-1, storageY, storageX+storageW, storageY+storageH, 0xffffdf00);
- Gui.drawRect(storageX, storageY, storageX+storageW, storageY+1, 0xffffdf00);
- Gui.drawRect(storageX, storageY+storageH-1, storageX+storageW, storageY+storageH, 0xffffdf00);
+ if(isPaneCaches[storageId] != null && isPaneCaches[storageId].length == rows*9 &&
+ ctmIndexCaches[storageId] != null && ctmIndexCaches[storageId].length == rows*9) {
+ int[] isPaneCache = isPaneCaches[storageId];
+
+ int borderStartY = 0;
+ int borderEndY = storageH;
+ int borderStartX = 0;
+ int borderEndX = storageW;
+
+ boolean allChroma = true;
+ for(int y=0; y<page.rows; y++) {
+ for(int x=0; x<9; x++) {
+ int index = x+y*9;
+ if(isPaneCache[index] != 17) {
+ allChroma = false;
+ break;
+ }
+ }
+ }
+
+ out:
+ for(int y=0; y<page.rows; y++) {
+ for(int x=0; x<9; x++) {
+ int index = x+y*9;
+ if(isPaneCache[index] <= 0 && !shouldLimitBorder[index]) {
+ borderStartY = y*18;
+ break out;
+ }
+ }
+ }
+ out:
+ for(int y=page.rows-1; y>=0; y--) {
+ for(int x=0; x<9; x++) {
+ int index = x+y*9;
+ if(isPaneCache[index] <= 0 && !shouldLimitBorder[index]) {
+ borderEndY = y*18+18; //Bottom
+ break out;
+ }
+ }
+ }
+ out:
+ for(int x=0; x<9; x++) {
+ for(int y=0; y<page.rows; y++) {
+ int index = x+y*9;
+ if(isPaneCache[index] <= 0 && !shouldLimitBorder[index]) {
+ borderStartX = x*18;
+ break out;
+ }
+ }
+ }
+ out:
+ for(int x=8; x>=0; x--) {
+ for(int y=0; y<page.rows; y++) {
+ int index = x+y*9;
+ if(isPaneCache[index] <= 0 && !shouldLimitBorder[index]) {
+ borderEndX = x*18+18; //Bottom
+ break out;
+ }
+ }
+ }
+ int borderColour = ChromaColour.specialToChromaRGB(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedStorageColour);
+ Gui.drawRect(storageX+borderStartX+1, storageY+borderStartY, storageX+borderStartX, storageY+borderEndY, borderColour); //Left
+ Gui.drawRect(storageX+borderEndX-1, storageY+borderStartY, storageX+borderEndX, storageY+borderEndY, borderColour); //Right
+ Gui.drawRect(storageX+borderStartX, storageY+borderStartY, storageX+borderEndX, storageY+borderStartY+1, borderColour); //Top
+ Gui.drawRect(storageX+borderStartX, storageY+borderEndY-1, storageX+borderEndX, storageY+borderEndY, borderColour); //Bottom
+
+ if(allChroma) {
+ ResourceLocation loc;
+ if(rollIndex < NOT_RICKROLL_SEQ.length) {
+ loc = NOT_RICKROLL_SEQ[rollIndex];
+ } else {
+ loc = NOT_RICKROLL_SEQ[NOT_RICKROLL_SEQ.length*2-rollIndex-1];
+ }
+ Minecraft.getMinecraft().getTextureManager().bindTexture(loc);
+ GlStateManager.color(1, 1, 1, 1);
+ Utils.drawTexturedRect(storageX, storageY, storageW, storageH, GL11.GL_LINEAR);
+ }
+ } else {
+ int borderColour = ChromaColour.specialToChromaRGB(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedStorageColour);
+ Gui.drawRect(storageX+1, storageY, storageX, storageY+storageH, borderColour); //Left
+ Gui.drawRect(storageX+storageW-1, storageY, storageX+storageW, storageY+storageH, borderColour); //Right
+ Gui.drawRect(storageX, storageY-1, storageX+storageW, storageY, borderColour); //Top
+ Gui.drawRect(storageX, storageY+storageH-1, storageX+storageW, storageY+storageH, borderColour); //Bottom
+ }
} else if(currentTime - StorageManager.getInstance().storageOpenSwitchMillis < 1000 &&
StorageManager.getInstance().desiredStoragePage == storageId &&
StorageManager.getInstance().getCurrentPageId() != storageId) {
@@ -506,7 +909,17 @@ public class StorageOverlay extends GuiElement {
} else if(whiteOverlay) {
Gui.drawRect(storageX, storageY, storageX+storageW, storageY+storageH, 0x80ffffff);
} else {
- Gui.drawRect(storageX, storageY, storageX+storageW, storageY+storageH, 0x30000000);
+ if(page.rows <= 0) {
+ Gui.drawRect(storageX, storageY, storageX+storageW, storageY+storageH, 0x40000000);
+ } else {
+ for(int i=0; i<page.rows*9; i++) {
+ if(page.items[i] == null || page.shouldDarkenIfNotSelected[i]) {
+ int x = storageX+18*(i%9);
+ int y = storageY+18*(i/9);
+ Gui.drawRect(x, y, x+18, y+18, 0x40000000);
+ }
+ }
+ }
}
if(StorageManager.getInstance().desiredStoragePage == storageId && StorageManager.getInstance().onStorageMenu) {
@@ -544,8 +957,6 @@ public class StorageOverlay extends GuiElement {
searchBar.render(252, storageViewSize+5);
//Player Inventory
- GuiChest guiChest = (GuiChest) Minecraft.getMinecraft().currentScreen;
- ContainerChest containerChest = (ContainerChest) guiChest.inventorySlots;
ItemStack[] playerItems = Minecraft.getMinecraft().thePlayer.inventory.mainInventory;
int inventoryStartIndex = containerChest.getLowerChestInventory().getSizeInventory();
GlStateManager.enableDepth();
@@ -683,6 +1094,14 @@ public class StorageOverlay extends GuiElement {
itemHoverY = itemY;
if(NotEnoughUpdates.INSTANCE.config.storageGUI.backpackPreview) slotPreview = i+StorageManager.MAX_ENDER_CHEST_PAGES;
tooltipToDisplay = stack.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips);
+
+ if(!StorageManager.getInstance().onStorageMenu) {
+ List<String> tooltip = new ArrayList<>();
+ for(String line : tooltipToDisplay) {
+ tooltip.add(line.replace("Right-click to remove", "Click \"Edit\" to manage"));
+ }
+ tooltipToDisplay = tooltip;
+ }
}
}
}
@@ -709,6 +1128,10 @@ public class StorageOverlay extends GuiElement {
vIndex = NotEnoughUpdates.INSTANCE.config.storageGUI.enderchestPreview ? 1 : 0; break;
case 5:
vIndex = NotEnoughUpdates.INSTANCE.config.storageGUI.masonryMode ? 1 : 0; break;
+ case 6:
+ vIndex = NotEnoughUpdates.INSTANCE.config.storageGUI.fancyPanes == 2 ? 0 : NotEnoughUpdates.INSTANCE.config.storageGUI.fancyPanes+1; break;
+ case 7:
+ vIndex = NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus ? 1 : 0; break;
}
Utils.drawTexturedRect(buttonX, buttonY, 16, 16, minU, maxU, (vIndex*16)/256f, (vIndex*16+16)/256f, GL11.GL_NEAREST);
@@ -774,10 +1197,36 @@ public class StorageOverlay extends GuiElement {
"Off"
);
break;
+ case 6:
+ tooltipToDisplay = createTooltip(
+ "Fancy Glass Panes",
+ NotEnoughUpdates.INSTANCE.config.storageGUI.fancyPanes,
+ "On",
+ "Locked",
+ "Off"
+ );
+ tooltipToDisplay.add(1, "\u00a7eReplace the glass pane textures");
+ tooltipToDisplay.add(2, "\u00a7ein your storage containers with");
+ tooltipToDisplay.add(3, "\u00a7ea fancy connected texture");
+ break;
+ case 7:
+ tooltipToDisplay = createTooltip(
+ "Search Bar Autofocus",
+ NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus ? 0 : 1,
+ "On",
+ "Off"
+ );
+ break;
}
}
}
+ if(!StorageManager.getInstance().onStorageMenu) {
+ Minecraft.getMinecraft().getTextureManager().bindTexture(storageTexture);
+ GlStateManager.color(1, 1, 1, 1);
+ Utils.drawTexturedRect(171-36, 41+storageViewSize, 36, 14, 24/600f, 60/600f, 251/400f, 265/400f, GL11.GL_NEAREST);
+ }
+
if(itemHoverX >= 0 && itemHoverY >= 0) {
GlStateManager.disableDepth();
GlStateManager.colorMask(true, true, true, false);
@@ -787,7 +1236,7 @@ public class StorageOverlay extends GuiElement {
}
GlStateManager.popMatrix();
- GlStateManager.translate(0, 0, 100);
+ GlStateManager.translate(0, 0, 300);
if(stackOnMouse != null) {
if(hoveringOtherBackpack) {
Utils.drawItemStack(new ItemStack(Item.getItemFromBlock(Blocks.barrier)), mouseX - 8, mouseY - 8);
@@ -796,7 +1245,6 @@ public class StorageOverlay extends GuiElement {
}
} else if(slotPreview >= 0) {
StorageManager.StoragePage page = StorageManager.getInstance().getPage(slotPreview, false);
-
if(page != null && page.rows > 0) {
int rows = page.rows;
@@ -812,6 +1260,7 @@ public class StorageOverlay extends GuiElement {
Utils.drawTexturedRect(mouseX, mouseY+7+18*i, 176, 18, 0, 1, 7/32f, 25/32f, GL11.GL_NEAREST);
}
Utils.drawTexturedRect(mouseX, mouseY+7+18*rows, 176, 7, 0, 1, 25/32f, 1, GL11.GL_NEAREST);
+ GlStateManager.enableDepth();
for(int i=0; i<rows*9; i++) {
ItemStack stack = page.items[i];
@@ -821,7 +1270,6 @@ public class StorageOverlay extends GuiElement {
GlStateManager.disableDepth();
}
}
- GlStateManager.enableDepth();
GlStateManager.translate(0, 0, -100);
} else {
Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1, Minecraft.getMinecraft().fontRendererObj);
@@ -829,7 +1277,102 @@ public class StorageOverlay extends GuiElement {
} else if(tooltipToDisplay != null) {
Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1, Minecraft.getMinecraft().fontRendererObj);
}
- GlStateManager.translate(0, 0, -100);
+ GlStateManager.translate(0, 0, -300);
+ }
+
+ private static boolean shouldConnect(int paneIndex1, int paneIndex2) {
+ if(paneIndex1 == 16 || paneIndex2 == 16) return false;
+ if(paneIndex1 < 1 || paneIndex2 < 1) return false;
+ if(paneIndex1 == paneIndex2) {
+ return true;
+ }
+ /*if((paneIndex1 == 17) == (paneIndex2 == 17)) {
+ return true;
+ }*/
+ return false;
+
+ }
+
+ public static int getCTMIndex(StorageManager.StoragePage page, int index, int[] isPaneCache, int[] ctmIndexCache) {
+ if(page.items[index] == null) {
+ ctmIndexCache[index] = -1;
+ return -1;
+ }
+
+ int paneType = getPaneType(page.items[index], index, isPaneCache);
+
+ int upIndex = index-9;
+ int leftIndex = index%9 > 0 ? index-1 : -1;
+ int rightIndex = index%9 < 8 ? index+1 : -1;
+ int downIndex = index+9;
+ int upleftIndex = index%9 > 0 ? index-10 : -1;
+ int uprightIndex = index%9 < 8 ? index-8 : -1;
+ int downleftIndex = index%9 > 0 ? index+8 : -1;
+ int downrightIndex = index%9 < 8 ?index+10 : -1;
+
+ boolean up = upIndex >= 0 && upIndex < isPaneCache.length && shouldConnect(getPaneType(page.items[upIndex], upIndex, isPaneCache), paneType);
+ boolean left = leftIndex >= 0 && leftIndex < isPaneCache.length && shouldConnect(getPaneType(page.items[leftIndex], leftIndex, isPaneCache) , paneType);
+ boolean down = downIndex >= 0 && downIndex < isPaneCache.length && shouldConnect(getPaneType(page.items[downIndex], downIndex, isPaneCache) , paneType);
+ boolean right = rightIndex >= 0 && rightIndex < isPaneCache.length && shouldConnect(getPaneType(page.items[rightIndex], rightIndex, isPaneCache) , paneType);
+ boolean upleft = upleftIndex >= 0 && upleftIndex < isPaneCache.length && shouldConnect(getPaneType(page.items[upleftIndex], upleftIndex, isPaneCache) , paneType);
+ boolean upright = uprightIndex >= 0 && uprightIndex < isPaneCache.length && shouldConnect(getPaneType(page.items[uprightIndex], uprightIndex, isPaneCache) , paneType);
+ boolean downleft = downleftIndex >= 0 && downleftIndex < isPaneCache.length && shouldConnect(getPaneType(page.items[downleftIndex], downleftIndex, isPaneCache) , paneType);
+ boolean downright = downrightIndex >= 0 && downrightIndex < isPaneCache.length && shouldConnect(getPaneType(page.items[downrightIndex], downrightIndex, isPaneCache) , paneType);
+
+ int ctmIndex = BetterContainers.getCTMIndex(up, right, down, left, upleft, upright, downright, downleft);
+ ctmIndexCache[index] = ctmIndex;
+ return ctmIndex;
+ }
+
+ private static String CHROMA_STR = "230:255:255:0:0";
+ public static int getRGBFromPane(int paneType) {
+ int rgb = -1;
+ EnumChatFormatting formatting = EnumChatFormatting.WHITE;
+ switch(paneType) {
+ case 0: formatting = EnumChatFormatting.WHITE; break;
+ case 1: formatting = EnumChatFormatting.GOLD; break;
+ case 2: formatting = EnumChatFormatting.LIGHT_PURPLE; break;
+ case 3: formatting = EnumChatFormatting.BLUE; break;
+ case 4: formatting = EnumChatFormatting.YELLOW; break;
+ case 5: formatting = EnumChatFormatting.GREEN; break;
+ case 6: rgb = 0xfff03c96; break;
+ case 7: formatting = EnumChatFormatting.DARK_GRAY; break;
+ case 8: formatting = EnumChatFormatting.GRAY; break;
+ case 9: formatting = EnumChatFormatting.DARK_AQUA; break;
+ case 10: formatting = EnumChatFormatting.DARK_PURPLE; break;
+ case 11: formatting = EnumChatFormatting.DARK_BLUE; break;
+ case 12: rgb = 0xffA0522D; break;
+ case 13: formatting = EnumChatFormatting.DARK_GREEN; break;
+ case 14: formatting = EnumChatFormatting.DARK_RED; break;
+ case 15: rgb = 0x00000000; break;
+ case 16: rgb = SpecialColour.specialToChromaRGB(CHROMA_STR); break;
+ }
+ if(rgb != -1) return rgb;
+ return 0xff000000 | Minecraft.getMinecraft().fontRendererObj.getColorCode(formatting.toString().charAt(1));
+ }
+
+ public static int getPaneType(ItemStack stack, int index, int[] cache) {
+ if(cache != null && cache[index] != 0) return cache[index];
+
+ if(NotEnoughUpdates.INSTANCE.config.storageGUI.fancyPanes == 2) {
+ if(cache != null) cache[index] = -1;
+ return -1;
+ }
+
+ if(stack != null && (stack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane) || stack.getItem() == Item.getItemFromBlock(Blocks.glass_pane))) {
+ String internalName = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack);
+ if(internalName != null) {
+ if(internalName.startsWith("STAINED_GLASS_PANE")) {
+ if(cache != null) cache[index] = stack.getItemDamage()+1;
+ return stack.getItemDamage()+1;
+ } else if(internalName.startsWith("THIN_GLASS")) {
+ if(cache != null) cache[index] = 17;
+ return 17;
+ }
+ }
+ }
+ if(cache != null) cache[index] = -1;
+ return -1;
}
private List<String> createTooltip(String title, int selectedOption, String... options) {
@@ -920,11 +1463,15 @@ public class StorageOverlay extends GuiElement {
return true;
}
+ if(Mouse.getEventButtonState()) {
+ editingNameId = -1;
+ }
+
if(Mouse.getEventButton() == 0) {
if(!Mouse.getEventButtonState()) {
scrollGrabOffset = -1;
} else if(mouseX >= guiLeft+519 && mouseX <= guiLeft+519+14 &&
- mouseY >= guiTop+8 && mouseY <= guiTop+106) {
+ mouseY >= guiTop+8 && mouseY <= guiTop+2+getStorageViewSize()) {
int scrollMouseY = mouseY - (guiTop+8);
int scrollBarY = Math.round(getScrollBarHeight()*scroll.getValue()/(float)getMaximumScroll());
@@ -954,6 +1501,35 @@ public class StorageOverlay extends GuiElement {
guiLeft = width/2 - (sizeX-searchNobX)/2;
guiTop = height/2 - sizeY/2;
+ if(Mouse.getEventButtonState() && !StorageManager.getInstance().onStorageMenu) {
+ if(mouseX > guiLeft+171-36 && mouseX < guiLeft+171 &&
+ mouseY > guiTop+41+storageViewSize && mouseY < guiTop+41+storageViewSize+14) {
+ NotEnoughUpdates.INSTANCE.sendChatMessage("/storage");
+ searchBar.setFocus(false);
+ return true;
+ }
+ }
+
+ if(Mouse.getEventButtonState()) {
+ if(mouseX >= guiLeft+252 && mouseX <= guiLeft+252+searchBar.getWidth() &&
+ mouseY >= guiTop+storageViewSize+5 && mouseY <= guiTop+storageViewSize+5+searchBar.getHeight()) {
+ if(searchBar.getFocus()) {
+ searchBar.mouseClicked(mouseX-guiLeft, mouseY-guiTop, Mouse.getEventButton());
+ StorageManager.getInstance().searchDisplay(searchBar.getText());
+ dirty = true;
+ } else {
+ searchBar.setFocus(true);
+ if(Mouse.getEventButton() == 1) {
+ searchBar.setText("");
+ StorageManager.getInstance().searchDisplay(searchBar.getText());
+ dirty = true;
+ }
+ }
+ } else {
+ searchBar.setFocus(false);
+ }
+ }
+
if(mouseX > guiLeft+181 && mouseX < guiLeft+181+162 &&
mouseY > guiTop+storageViewSize+18 && mouseY < guiTop+storageViewSize+94) {
return false;
@@ -969,6 +1545,39 @@ public class StorageOverlay extends GuiElement {
StorageManager.StoragePage page = StorageManager.getInstance().getPage(entry.getValue(), false);
int rows = page == null ? 3 : page.rows <= 0 ? 3 : page.rows;
+
+ if(page != null) {
+ String pageTitle;
+ if(page.customTitle != null && !page.customTitle.isEmpty()) {
+ pageTitle = page.customTitle;
+ } else if(entry.getValue() < 9) {
+ pageTitle = "Ender Chest Page " + (entry.getValue() + 1);
+ } else {
+ pageTitle = "Backpack Slot "+(entry.getValue()-8);
+ }
+ int titleLen = Minecraft.getMinecraft().fontRendererObj.getStringWidth(pageTitle);
+
+ if(mouseX >= guiLeft+pageCoords.x && mouseX <= guiLeft+pageCoords.x+titleLen+15 &&
+ mouseY >= guiTop+pageCoords.y-14 && mouseY <= guiTop+pageCoords.y+1) {
+ if(Mouse.getEventButtonState() && (Mouse.getEventButton() == 0 || Mouse.getEventButton() == 1)) {
+ if(editingNameId != entry.getValue()) {
+ editingNameId = entry.getValue();
+ if(!renameStorageField.getText().equalsIgnoreCase(pageTitle)) {
+ renameStorageField.setText(pageTitle);
+ }
+ }
+ if(!renameStorageField.getFocus()) {
+ renameStorageField.setFocus(true);
+ } else {
+ renameStorageField.mouseClicked(mouseX-guiLeft, mouseY-guiTop, Mouse.getEventButton());
+ }
+ } else if(Mouse.getEventButton() < 0 && Mouse.isButtonDown(0)) {
+ renameStorageField.mouseClickMove(mouseX-guiLeft, mouseY-guiTop, 0, 0);
+ }
+ return true;
+ }
+ }
+
if(mouseX > guiLeft+pageCoords.x && mouseX < guiLeft+pageCoords.x+162 &&
mouseY > guiTop+pageCoords.y && mouseY < guiTop+pageCoords.y+rows*18) {
if(currentPage >= 0 && entry.getValue() == currentPage) {
@@ -1042,9 +1651,9 @@ public class StorageOverlay extends GuiElement {
case 2:
int displayStyle = NotEnoughUpdates.INSTANCE.config.storageGUI.displayStyle;
if(Mouse.getEventButton() == 0) {
- displayStyle--;
- } else {
displayStyle++;
+ } else {
+ displayStyle--;
}
if(displayStyle < 0) displayStyle = STORAGE_TEXTURES.length-1;
if(displayStyle >= STORAGE_TEXTURES.length) displayStyle = 0;
@@ -1059,6 +1668,20 @@ public class StorageOverlay extends GuiElement {
case 5:
NotEnoughUpdates.INSTANCE.config.storageGUI.masonryMode =
!NotEnoughUpdates.INSTANCE.config.storageGUI.masonryMode; break;
+ case 6:
+ int fancyPanes = NotEnoughUpdates.INSTANCE.config.storageGUI.fancyPanes;
+ if(Mouse.getEventButton() == 0) {
+ fancyPanes++;
+ } else {
+ fancyPanes--;
+ }
+ if(fancyPanes < 0) fancyPanes = 2;
+ if(fancyPanes >= 3) fancyPanes = 0;
+
+ NotEnoughUpdates.INSTANCE.config.storageGUI.fancyPanes = fancyPanes; break;
+ case 7:
+ NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus =
+ !NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus; break;
}
dirty = true;
}
@@ -1183,6 +1806,11 @@ public class StorageOverlay extends GuiElement {
if(xClicked >= 0 && xClicked <= 8 &&
yClicked >= 0 && yClicked <= 5) {
if(xClicked + yClicked*9 + 9 == slotId) {
+ if(NotEnoughUpdates.INSTANCE.config.storageGUI.fancyPanes == 1 && slot.getHasStack() &&
+ getPaneType(slot.getStack(), -1, null) > 0) {
+ cir.setReturnValue(false);
+ return;
+ }
cir.setReturnValue(true);
return;
}
@@ -1195,6 +1823,7 @@ public class StorageOverlay extends GuiElement {
}
public void clearSearch() {
+ searchBar.setFocus(false);
searchBar.setText("");
StorageManager.getInstance().searchDisplay(searchBar.getText());
}
@@ -1234,13 +1863,38 @@ public class StorageOverlay extends GuiElement {
}
}
- String prevText = searchBar.getText();
- searchBar.setFocus(true);
- searchBar.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey());
- if(!prevText.equals(searchBar.getText())) {
- StorageManager.getInstance().searchDisplay(searchBar.getText());
- dirty = true;
+ if(editingNameId >= 0) {
+ if(Keyboard.getEventKey() == Keyboard.KEY_RETURN) {
+ editingNameId = -1;
+ return true;
+ }
+
+ String prevText = renameStorageField.getText();
+ renameStorageField.setFocus(true);
+ searchBar.setFocus(false);
+ renameStorageField.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey());
+ if(!prevText.equals(renameStorageField.getText())) {
+ StorageManager.StoragePage page = StorageManager.getInstance().getPage(editingNameId, false);
+ if(page != null) {
+ page.customTitle = renameStorageField.getText();
+ }
+ }
+ } else if(NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus || searchBar.getFocus()) {
+ String prevText = searchBar.getText();
+ searchBar.setFocus(true);
+ renameStorageField.setFocus(false);
+ searchBar.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey());
+ if(!prevText.equals(searchBar.getText())) {
+ StorageManager.getInstance().searchDisplay(searchBar.getText());
+ dirty = true;
+ }
+ if(NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus &&
+ searchBar.getText().isEmpty()) {
+ searchBar.setFocus(false);
+ }
}
+
+
}
return true;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
index 65add047..67db8723 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
@@ -1,412 +1,412 @@
-package io.github.moulberry.notenoughupdates.options;
-
-import com.google.common.collect.Lists;
-import com.google.gson.annotations.Expose;
-import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
-import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper;
-import io.github.moulberry.notenoughupdates.core.config.Config;
-import io.github.moulberry.notenoughupdates.core.config.Position;
-import io.github.moulberry.notenoughupdates.core.config.annotations.*;
-import io.github.moulberry.notenoughupdates.core.config.gui.GuiPositionEditor;
-import io.github.moulberry.notenoughupdates.miscgui.GuiEnchantColour;
-import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor;
-import io.github.moulberry.notenoughupdates.miscgui.NEUOverlayPlacements;
-import io.github.moulberry.notenoughupdates.options.seperateSections.*;
-import io.github.moulberry.notenoughupdates.overlays.*;
-import io.github.moulberry.notenoughupdates.util.SBInfo;
-import net.minecraft.client.Minecraft;
-import net.minecraftforge.client.ClientCommandHandler;
-import org.lwjgl.util.vector.Vector2f;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-public class NEUConfig extends Config {
-
- private void editOverlay(String activeConfig, TextOverlay overlay, Position position) {
- Vector2f size = overlay.getDummySize();
- int width = (int)size.x;
- int height = (int)size.y;
- Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(position, width, height, () -> {
- overlay.renderDummy();
- OverlayManager.dontRenderOverlay = overlay.getClass();
- }, () -> {
- }, () -> NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper(
- new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, activeConfig))
- ));
- }
-
- @Override
- public void executeRunnable(int runnableId) {
- String activeConfigCategory = null;
- if(Minecraft.getMinecraft().currentScreen instanceof GuiScreenElementWrapper) {
- GuiScreenElementWrapper wrapper = (GuiScreenElementWrapper) Minecraft.getMinecraft().currentScreen;
- if(wrapper.element instanceof NEUConfigEditor) {
- activeConfigCategory = ((NEUConfigEditor)wrapper.element).getSelectedCategoryName();
- }
- }
- final String activeConfigCategoryF = activeConfigCategory;
-
- switch (runnableId) {
- case 0:
- ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neumap");
- return;
- case 1:
- editOverlay(activeConfigCategory, OverlayManager.miningOverlay, mining.overlayPosition);
- return;
- case 2:
- Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(
- NotEnoughUpdates.INSTANCE.config.mining.drillFuelBarPosition,
- NotEnoughUpdates.INSTANCE.config.mining.drillFuelBarWidth, 12, () -> {
- }, () -> {
- }, () -> NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper(
- new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, activeConfigCategoryF))
- ));
- return;
- case 3:
- editOverlay(activeConfigCategory, OverlayManager.farmingOverlay, skillOverlays.farmingPosition);
- return;
- case 4:
- editOverlay(activeConfigCategory, OverlayManager.petInfoOverlay, petOverlay.petInfoPosition);
- return;
- case 5:
- editOverlay(activeConfigCategory, OverlayManager.timersOverlay, miscOverlays.todoPosition);
- return;
- case 6:
- NotEnoughUpdates.INSTANCE.openGui = new NEUOverlayPlacements();
- return;
- case 7:
- NotEnoughUpdates.INSTANCE.openGui = new GuiInvButtonEditor();
- return;
- case 8:
- NotEnoughUpdates.INSTANCE.openGui = new GuiEnchantColour();
- return;
-
- }
- }
-
- @Expose
- @Category(
- name = "Misc",
- desc = "Miscellaneous options which don't fit into any other category"
- )
- public Misc misc = new Misc();
-
- @Expose
- @Category(
- name = "Notifications",
- desc = "Notifications"
- )
- public Notifications notifications = new Notifications();
-
- @Expose
- @Category(
- name = "Item List",
- desc = "Item List"
- )
- public Itemlist itemlist = new Itemlist();
-
- @Expose
- @Category(
- name = "Toolbar",
- desc = "Toolbar"
- )
- public Toolbar toolbar = new Toolbar();
-
- @Expose
- @Category(
- name = "Inventory Buttons",
- desc = "Inventory Buttons"
- )
- public InventoryButtons inventoryButtons = new InventoryButtons();
-
-
- @Expose
- @Category(
- name = "Slot Locking",
- desc = "Slot Locking"
- )
- public SlotLocking slotLocking = new SlotLocking();
-
- @Expose
- @Category(
- name = "Tooltip Tweaks",
- desc = "Tooltip Tweaks"
- )
- public TooltipTweaks tooltipTweaks = new TooltipTweaks();
-
- @Expose
- @Category(
- name = "Item Overlays",
- desc = "Item Overlays"
- )
- public ItemOverlays itemOverlays = new ItemOverlays();
-
- @Expose
- @Category(
- name = "Skill Overlays",
- desc = "Skill Overlays"
- )
- public SkillOverlays skillOverlays = new SkillOverlays();
-
- @Expose
- @Category(
- name = "Misc Overlays",
- desc = "Misc Overlays"
- )
- public MiscOverlays miscOverlays = new MiscOverlays();
-
- @Expose
- @Category(
- name = "Storage GUI",
- desc = "Storage GUI"
- )
- public StorageGUI storageGUI = new StorageGUI();
-
- @Expose
- @Category(
- name = "Dungeons",
- desc = "Dungeons"
- )
- public Dungeons dungeons = new Dungeons();
-
-
- @Expose
- @Category(
- name = "Enchanting Solvers",
- desc = "Enchanting Solvers"
- )
- public EnchSolvers enchantingSolvers = new EnchSolvers();
-
- @Expose
- @Category(
- name = "Mining",
- desc = "Mining"
- )
- public Mining mining = new Mining();
-
-
- @Expose
- @Category(
- name = "Fishing",
- desc = "Fishing"
- )
- public Fishing fishing = new Fishing();
-
- @Expose
- @Category(
- name = "NEU Auction House",
- desc = "NEU Auction House"
- )
- public NeuAuctionHouse neuAuctionHouse = new NeuAuctionHouse();
-
- @Expose
- @Category(
- name = "Improved SB Menus",
- desc = "Improved SB Menus"
- )
- public ImprovedSBMenu improvedSBMenu = new ImprovedSBMenu();
-
- @Expose
- @Category(
- name = "Calendar",
- desc = "Calendar"
- )
- public Calendar calendar = new Calendar();
-
- @Expose
- @Category(
- name = "Trade Menu",
- desc = "Trade Menu"
- )
- public TradeMenu tradeMenu = new TradeMenu();
-
- @Expose
- @Category(
- name = "Pet Overlay",
- desc = "Pet Overlay"
- )
- public PetOverlay petOverlay = new PetOverlay();
-
- @Expose
- @Category(
- name = "AH Search GUI",
- desc = "AH Search GUI"
- )
- public AuctionHouseSearch auctionHouseSearch = new AuctionHouseSearch();
-
- @Expose
- @Category(
- name = "Accessory Bag Overlay",
- desc = "Accessory Bag Overlay"
- )
- public AccessoryBag accessoryBag = new AccessoryBag();
-
- @Expose
- @Category(
- name = "Api Key",
- desc = "Api Key"
- )
- public ApiKey apiKey = new ApiKey();
-
- @Expose
- public Hidden hidden = new Hidden();
-
- @Expose
- public DungeonMapConfig dungeonMap = new DungeonMapConfig();
-
- public static class Hidden {
- @Expose
- public HashMap<String, NEUConfig.HiddenProfileSpecific> profileSpecific = new HashMap<>();
- @Expose public List<NEUConfig.InventoryButton> inventoryButtons = createDefaultInventoryButtons();
-
- @Expose public boolean enableItemEditing = false;
- @Expose public boolean cacheRenderedItempane = true;
- @Expose public boolean autoupdate = true;
- @Expose public String overlaySearchBar = "";
- @Expose public String overlayQuickCommand = "";
- @Expose public boolean dev = false;
- @Expose public boolean loadedModBefore = false;
- @Expose public String selectedCape = null;
- @Expose public int compareMode = 0;
- @Expose public int sortMode = 0;
- @Expose public ArrayList<Boolean> compareAscending = Lists.newArrayList(true, true, true);
- @Expose public ArrayList<String> favourites = new ArrayList<>();
- @Expose public ArrayList<String> previousAuctionSearches = new ArrayList<>();
- @Expose public ArrayList<String> eventFavourites = new ArrayList<>();
- @Expose public ArrayList<String> quickCommands = createDefaultQuickCommands();
- @Expose public ArrayList<String> enchantColours = Lists.newArrayList(
- "[a-zA-Z\\- ]+:\u003e:9:6:0",
- "[a-zA-Z\\- ]+:\u003e:6:c:0",
- "[a-zA-Z\\- ]+:\u003e:5:5:0",
- "Experience:\u003e:3:5:0",
- "Life Steal:\u003e:3:5:0",
- "Scavenger:\u003e:3:5:0",
- "Looting:\u003e:3:5:0");
- }
-
- private static ArrayList<String> createDefaultQuickCommands() {
- ArrayList<String> arr = new ArrayList<>();
- arr.add("/warp home:Warp Home:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzljODg4MWU0MjkxNWE5ZDI5YmI2MWExNmZiMjZkMDU5OTEzMjA0ZDI2NWRmNWI0MzliM2Q3OTJhY2Q1NiJ9fX0=");
- arr.add("/warp hub:Warp Hub:eyJ0aW1lc3RhbXAiOjE1NTkyMTU0MTY5MDksInByb2ZpbGVJZCI6IjQxZDNhYmMyZDc0OTQwMGM5MDkwZDU0MzRkMDM4MzFiIiwicHJvZmlsZU5hbWUiOiJNZWdha2xvb24iLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2Q3Y2M2Njg3NDIzZDA1NzBkNTU2YWM1M2UwNjc2Y2I1NjNiYmRkOTcxN2NkODI2OWJkZWJlZDZmNmQ0ZTdiZjgifX19");
- arr.add("/warp dungeon_hub:Dungeon Hub:eyJ0aW1lc3RhbXAiOjE1Nzg0MDk0MTMxNjksInByb2ZpbGVJZCI6IjQxZDNhYmMyZDc0OTQwMGM5MDkwZDU0MzRkMDM4MzFiIiwicHJvZmlsZU5hbWUiOiJNZWdha2xvb24iLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzliNTY4OTViOTY1OTg5NmFkNjQ3ZjU4NTk5MjM4YWY1MzJkNDZkYjljMWIwMzg5YjhiYmViNzA5OTlkYWIzM2QiLCJtZXRhZGF0YSI6eyJtb2RlbCI6InNsaW0ifX19fQ==");
- arr.add("/craft:Crafting Table:CRAFTING_TABLE");
- arr.add("/storage:Storage:CHEST");
- arr.add("/wardrobe:Wardrobe:LEATHER_CHESTPLATE");
- arr.add("/pets:Pets:BONE");
- arr.add("neuah:NEU Auction House:GOLD_BLOCK");
- arr.add("/bz:Bazaar:GOLD_BARDING");
- return arr;
- }
-
- public HiddenProfileSpecific getProfileSpecific() {
- if(SBInfo.getInstance().currentProfile == null) {
- return null;
- }
- return hidden.profileSpecific.computeIfAbsent(SBInfo.getInstance().currentProfile, k-> new HiddenProfileSpecific());
- }
-
- public static class HiddenProfileSpecific {
-
- @Expose public long godPotionDuration = 0l;
- @Expose public long puzzlerCompleted = 0L;
- @Expose public long firstCakeAte = 0L;
- @Expose public long fetchurCompleted = 0L;
- @Expose public long commissionsCompleted = 0L;
- @Expose public long experimentsCompleted = 0L;
- @Expose public long cookieBuffRemaining = 0L;
-
- @Expose public int commissionMilestone = 0;
- }
-
- public static List<InventoryButton> createDefaultInventoryButtons() {
- List<InventoryButton> buttons = new ArrayList<>();
- //Below crafting
- buttons.add(new InventoryButton(87, 63, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(87+21, 63, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(87+21*2, 63, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(87+21*3, 63, null, true, false, false, 0, ""));
-
- //Above crafting
- buttons.add(new InventoryButton(87, 5, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(87+21, 5, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(87+21*2, 5, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(87+21*3, 5, null, true, false, false, 0, ""));
-
- //Crafting square
- buttons.add(new InventoryButton(87, 25, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(87+18, 25, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(87, 25+18, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(87+18, 25+18, null, true, false, false, 0, ""));
-
- //Crafting result
- buttons.add(new InventoryButton(143, 35, null, true, false, false, 0, ""));
-
- //Player menu area
- buttons.add(new InventoryButton(60, 8, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(60, 60, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(26, 8, null, true, false, false, 0, ""));
- buttons.add(new InventoryButton(26, 60, null, true, false, false, 0, ""));
-
- //Right side
- for(int i=0; i<8; i++) {
- int y = 2+20*i;
- if(y < 80) {
- buttons.add(new InventoryButton(2, 2+20*i, null, false, true, false, 0, ""));
- } else {
- buttons.add(new InventoryButton(2, 2+20*i-166, null, false, true, true, 0, ""));
- }
- }
-
- //Top side
- for(int i=0; i<8; i++) {
- buttons.add(new InventoryButton(4+21*i, -19, null, false, false, false, 0, ""));
- }
-
- //Left side
- for(int i=0; i<8; i++) {
- int y = 2+20*i;
- if(y < 80) {
- buttons.add(new InventoryButton(-19, 2+20*i, null, false, false, false, 0, ""));
- } else {
- buttons.add(new InventoryButton(-19, 2+20*i-166, null, false, false, true, 0, ""));
- }
- }
-
- //Bottom side
- for(int i=0; i<8; i++) {
- buttons.add(new InventoryButton(4+21*i, 2, null, false, false, true, 0, ""));
- }
- return buttons;
- }
-
- public static class InventoryButton {
- @Expose public int x;
- @Expose public int y;
- @Expose public boolean playerInvOnly;
-
- @Expose public boolean anchorRight;
- @Expose public boolean anchorBottom;
-
- @Expose public int backgroundIndex;
- @Expose public String command;
- @Expose public String icon;
-
- public boolean isActive() {
- return command.trim().length() > 0;
- }
-
- public InventoryButton(int x, int y, String icon, boolean playerInvOnly, boolean anchorRight, boolean anchorBottom, int backgroundIndex, String command) {
- this.x = x;
- this.y = y;
- this.icon = icon;
- this.playerInvOnly = playerInvOnly;
- this.anchorRight = anchorRight;
- this.anchorBottom = anchorBottom;
- this.backgroundIndex = backgroundIndex;
- this.command = command;
- }
- }
-
-}
+package io.github.moulberry.notenoughupdates.options;
+
+import com.google.common.collect.Lists;
+import com.google.gson.annotations.Expose;
+import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
+import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper;
+import io.github.moulberry.notenoughupdates.core.config.Config;
+import io.github.moulberry.notenoughupdates.core.config.Position;
+import io.github.moulberry.notenoughupdates.core.config.annotations.*;
+import io.github.moulberry.notenoughupdates.core.config.gui.GuiPositionEditor;
+import io.github.moulberry.notenoughupdates.miscgui.GuiEnchantColour;
+import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor;
+import io.github.moulberry.notenoughupdates.miscgui.NEUOverlayPlacements;
+import io.github.moulberry.notenoughupdates.options.seperateSections.*;
+import io.github.moulberry.notenoughupdates.overlays.*;
+import io.github.moulberry.notenoughupdates.util.SBInfo;
+import net.minecraft.client.Minecraft;
+import net.minecraftforge.client.ClientCommandHandler;
+import org.lwjgl.util.vector.Vector2f;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class NEUConfig extends Config {
+
+ private void editOverlay(String activeConfig, TextOverlay overlay, Position position) {
+ Vector2f size = overlay.getDummySize();
+ int width = (int)size.x;
+ int height = (int)size.y;
+ Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(position, width, height, () -> {
+ overlay.renderDummy();
+ OverlayManager.dontRenderOverlay = overlay.getClass();
+ }, () -> {
+ }, () -> NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper(
+ new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, activeConfig))
+ ));
+ }
+
+ @Override
+ public void executeRunnable(int runnableId) {
+ String activeConfigCategory = null;
+ if(Minecraft.getMinecraft().currentScreen instanceof GuiScreenElementWrapper) {
+ GuiScreenElementWrapper wrapper = (GuiScreenElementWrapper) Minecraft.getMinecraft().currentScreen;
+ if(wrapper.element instanceof NEUConfigEditor) {
+ activeConfigCategory = ((NEUConfigEditor)wrapper.element).getSelectedCategoryName();
+ }
+ }
+ final String activeConfigCategoryF = activeConfigCategory;
+
+ switch (runnableId) {
+ case 0:
+ ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neumap");
+ return;
+ case 1:
+ editOverlay(activeConfigCategory, OverlayManager.miningOverlay, mining.overlayPosition);
+ return;
+ case 2:
+ Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(
+ NotEnoughUpdates.INSTANCE.config.mining.drillFuelBarPosition,
+ NotEnoughUpdates.INSTANCE.config.mining.drillFuelBarWidth, 12, () -> {
+ }, () -> {
+ }, () -> NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper(
+ new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, activeConfigCategoryF))
+ ));
+ return;
+ case 3:
+ editOverlay(activeConfigCategory, OverlayManager.farmingOverlay, skillOverlays.farmingPosition);
+ return;
+ case 4:
+ editOverlay(activeConfigCategory, OverlayManager.petInfoOverlay, petOverlay.petInfoPosition);
+ return;
+ case 5:
+ editOverlay(activeConfigCategory, OverlayManager.timersOverlay, miscOverlays.todoPosition);
+ return;
+ case 6:
+ NotEnoughUpdates.INSTANCE.openGui = new NEUOverlayPlacements();
+ return;
+ case 7:
+ NotEnoughUpdates.INSTANCE.openGui = new GuiInvButtonEditor();
+ return;
+ case 8:
+ NotEnoughUpdates.INSTANCE.openGui = new GuiEnchantColour();
+ return;
+
+ }
+ }
+
+ @Expose
+ @Category(
+ name = "Misc",
+ desc = "Miscellaneous options which don't fit into any other category"
+ )
+ public Misc misc = new Misc();
+
+ @Expose
+ @Category(
+ name = "Notifications",
+ desc = "Notifications"
+ )
+ public Notifications notifications = new Notifications();
+
+ @Expose
+ @Category(
+ name = "Item List",
+ desc = "Item List"
+ )
+ public Itemlist itemlist = new Itemlist();
+
+ @Expose
+ @Category(
+ name = "Toolbar",
+ desc = "Toolbar"
+ )
+ public Toolbar toolbar = new Toolbar();
+
+ @Expose
+ @Category(
+ name = "Inventory Buttons",
+ desc = "Inventory Buttons"
+ )
+ public InventoryButtons inventoryButtons = new InventoryButtons();
+
+
+ @Expose
+ @Category(
+ name = "Slot Locking",
+ desc = "Slot Locking"
+ )
+ public SlotLocking slotLocking = new SlotLocking();
+
+ @Expose
+ @Category(
+ name = "Tooltip Tweaks",
+ desc = "Tooltip Tweaks"
+ )
+ public TooltipTweaks tooltipTweaks = new TooltipTweaks();
+
+ @Expose
+ @Category(
+ name = "Item Overlays",
+ desc = "Item Overlays"
+ )
+ public ItemOverlays itemOverlays = new ItemOverlays();
+
+ @Expose
+ @Category(
+ name = "Skill Overlays",
+ desc = "Skill Overlays"
+ )
+ public SkillOverlays skillOverlays = new SkillOverlays();
+
+ @Expose
+ @Category(
+ name = "Misc Overlays",
+ desc = "Misc Overlays"
+ )
+ public MiscOverlays miscOverlays = new MiscOverlays();
+
+ @Expose
+ @Category(
+ name = "Storage GUI",
+ desc = "Storage GUI"
+ )
+ public StorageGUI storageGUI = new StorageGUI();
+
+ @Expose
+ @Category(
+ name = "Dungeons",
+ desc = "Dungeons"
+ )
+ public Dungeons dungeons = new Dungeons();
+
+
+ @Expose
+ @Category(
+ name = "Enchanting Solvers",
+ desc = "Enchanting Solvers"
+ )
+ public EnchSolvers enchantingSolvers = new EnchSolvers();
+
+ @Expose
+ @Category(
+ name = "Mining",
+ desc = "Mining"
+ )
+ public Mining mining = new Mining();
+
+
+ @Expose
+ @Category(
+ name = "Fishing",
+ desc = "Fishing"
+ )
+ public Fishing fishing = new Fishing();
+
+ @Expose
+ @Category(
+ name = "NEU Auction House",
+ desc = "NEU Auction House"
+ )
+ public NeuAuctionHouse neuAuctionHouse = new NeuAuctionHouse();
+
+ @Expose
+ @Category(
+ name = "Improved SB Menus",
+ desc = "Improved SB Menus"
+ )
+ public ImprovedSBMenu improvedSBMenu = new ImprovedSBMenu();
+
+ @Expose
+ @Category(
+ name = "Calendar",
+ desc = "Calendar"
+ )
+ public Calendar calendar = new Calendar();
+
+ @Expose
+ @Category(
+ name = "Trade Menu",
+ desc = "Trade Menu"
+ )
+ public TradeMenu tradeMenu = new TradeMenu();
+
+ @Expose
+ @Category(
+ name = "Pet Overlay",
+ desc = "Pet Overlay"
+ )
+ public PetOverlay petOverlay = new PetOverlay();
+
+ @Expose
+ @Category(
+ name = "AH Search GUI",
+ desc = "AH Search GUI"
+ )
+ public AuctionHouseSearch auctionHouseSearch = new AuctionHouseSearch();
+
+ @Expose
+ @Category(
+ name = "Accessory Bag Overlay",
+ desc = "Accessory Bag Overlay"
+ )
+ public AccessoryBag accessoryBag = new AccessoryBag();
+
+ @Expose
+ @Category(
+ name = "Api Key",
+ desc = "Api Key"
+ )
+ public ApiKey apiKey = new ApiKey();
+
+ @Expose
+ public Hidden hidden = new Hidden();
+
+ @Expose
+ public DungeonMapConfig dungeonMap = new DungeonMapConfig();
+
+ public static class Hidden {
+ @Expose
+ public HashMap<String, NEUConfig.HiddenProfileSpecific> profileSpecific = new HashMap<>();
+ @Expose public List<NEUConfig.InventoryButton> inventoryButtons = createDefaultInventoryButtons();
+
+ @Expose public boolean enableItemEditing = false;
+ @Expose public boolean cacheRenderedItempane = true;
+ @Expose public boolean autoupdate = true;
+ @Expose public String overlaySearchBar = "";
+ @Expose public String overlayQuickCommand = "";
+ @Expose public boolean dev = false;
+ @Expose public boolean loadedModBefore = false;
+ @Expose public String selectedCape = null;
+ @Expose public int compareMode = 0;
+ @Expose public int sortMode = 0;
+ @Expose public ArrayList<Boolean> compareAscending = Lists.newArrayList(true, true, true);
+ @Expose public ArrayList<String> favourites = new ArrayList<>();
+ @Expose public ArrayList<String> previousAuctionSearches = new ArrayList<>();
+ @Expose public ArrayList<String> eventFavourites = new ArrayList<>();
+ @Expose public ArrayList<String> quickCommands = createDefaultQuickCommands();
+ @Expose public ArrayList<String> enchantColours = Lists.newArrayList(
+ "[a-zA-Z\\- ]+:\u003e:9:6:0",
+ "[a-zA-Z\\- ]+:\u003e:6:c:0",
+ "[a-zA-Z\\- ]+:\u003e:5:5:0",
+ "Experience:\u003e:3:5:0",
+ "Life Steal:\u003e:3:5:0",
+ "Scavenger:\u003e:3:5:0",
+ "Looting:\u003e:3:5:0");
+ }
+
+ private static ArrayList<String> createDefaultQuickCommands() {
+ ArrayList<String> arr = new ArrayList<>();
+ arr.add("/warp home:Warp Home:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzljODg4MWU0MjkxNWE5ZDI5YmI2MWExNmZiMjZkMDU5OTEzMjA0ZDI2NWRmNWI0MzliM2Q3OTJhY2Q1NiJ9fX0=");
+ arr.add("/warp hub:Warp Hub:eyJ0aW1lc3RhbXAiOjE1NTkyMTU0MTY5MDksInByb2ZpbGVJZCI6IjQxZDNhYmMyZDc0OTQwMGM5MDkwZDU0MzRkMDM4MzFiIiwicHJvZmlsZU5hbWUiOiJNZWdha2xvb24iLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2Q3Y2M2Njg3NDIzZDA1NzBkNTU2YWM1M2UwNjc2Y2I1NjNiYmRkOTcxN2NkODI2OWJkZWJlZDZmNmQ0ZTdiZjgifX19");
+ arr.add("/warp dungeon_hub:Dungeon Hub:eyJ0aW1lc3RhbXAiOjE1Nzg0MDk0MTMxNjksInByb2ZpbGVJZCI6IjQxZDNhYmMyZDc0OTQwMGM5MDkwZDU0MzRkMDM4MzFiIiwicHJvZmlsZU5hbWUiOiJNZWdha2xvb24iLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzliNTY4OTViOTY1OTg5NmFkNjQ3ZjU4NTk5MjM4YWY1MzJkNDZkYjljMWIwMzg5YjhiYmViNzA5OTlkYWIzM2QiLCJtZXRhZGF0YSI6eyJtb2RlbCI6InNsaW0ifX19fQ==");
+ arr.add("/craft:Crafting Table:CRAFTING_TABLE");
+ arr.add("/storage:Storage:CHEST");
+ arr.add("/wardrobe:Wardrobe:LEATHER_CHESTPLATE");
+ arr.add("/pets:Pets:BONE");
+ arr.add("neuah:NEU Auction House:GOLD_BLOCK");
+ arr.add("/bz:Bazaar:GOLD_BARDING");
+ return arr;
+ }
+
+ public HiddenProfileSpecific getProfileSpecific() {
+ if(SBInfo.getInstance().currentProfile == null) {
+ return null;
+ }
+ return hidden.profileSpecific.computeIfAbsent(SBInfo.getInstance().currentProfile, k-> new HiddenProfileSpecific());
+ }
+
+ public static class HiddenProfileSpecific {
+
+ @Expose public long godPotionDuration = 0l;
+ @Expose public long puzzlerCompleted = 0L;
+ @Expose public long firstCakeAte = 0L;
+ @Expose public long fetchurCompleted = 0L;
+ @Expose public long commissionsCompleted = 0L;
+ @Expose public long experimentsCompleted = 0L;
+ @Expose public long cookieBuffRemaining = 0L;
+
+ @Expose public int commissionMilestone = 0;
+ }
+
+ public static List<InventoryButton> createDefaultInventoryButtons() {
+ List<InventoryButton> buttons = new ArrayList<>();
+ //Below crafting
+ buttons.add(new InventoryButton(87, 63, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(87+21, 63, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(87+21*2, 63, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(87+21*3, 63, null, true, false, false, 0, ""));
+
+ //Above crafting
+ buttons.add(new InventoryButton(87, 5, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(87+21, 5, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(87+21*2, 5, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(87+21*3, 5, null, true, false, false, 0, ""));
+
+ //Crafting square
+ buttons.add(new InventoryButton(87, 25, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(87+18, 25, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(87, 25+18, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(87+18, 25+18, null, true, false, false, 0, ""));
+
+ //Crafting result
+ buttons.add(new InventoryButton(143, 35, null, true, false, false, 0, ""));
+
+ //Player menu area
+ buttons.add(new InventoryButton(60, 8, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(60, 60, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(26, 8, null, true, false, false, 0, ""));
+ buttons.add(new InventoryButton(26, 60, null, true, false, false, 0, ""));
+
+ //Right side
+ for(int i=0; i<8; i++) {
+ int y = 2+20*i;
+ if(y < 80) {
+ buttons.add(new InventoryButton(2, 2+20*i, null, false, true, false, 0, ""));
+ } else {
+ buttons.add(new InventoryButton(2, 2+20*i-166, null, false, true, true, 0, ""));
+ }
+ }
+
+ //Top side
+ for(int i=0; i<8; i++) {
+ buttons.add(new InventoryButton(4+21*i, -19, null, false, false, false, 0, ""));
+ }
+
+ //Left side
+ for(int i=0; i<8; i++) {
+ int y = 2+20*i;
+ if(y < 80) {
+ buttons.add(new InventoryButton(-19, 2+20*i, null, false, false, false, 0, ""));
+ } else {
+ buttons.add(new InventoryButton(-19, 2+20*i-166, null, false, false, true, 0, ""));
+ }
+ }
+
+ //Bottom side
+ for(int i=0; i<8; i++) {
+ buttons.add(new InventoryButton(4+21*i, 2, null, false, false, true, 0, ""));
+ }
+ return buttons;
+ }
+
+ public static class InventoryButton {
+ @Expose public int x;
+ @Expose public int y;
+ @Expose public boolean playerInvOnly;
+
+ @Expose public boolean anchorRight;
+ @Expose public boolean anchorBottom;
+
+ @Expose public int backgroundIndex;
+ @Expose public String command;
+ @Expose public String icon;
+
+ public boolean isActive() {
+ return command.trim().length() > 0;
+ }
+
+ public InventoryButton(int x, int y, String icon, boolean playerInvOnly, boolean anchorRight, boolean anchorBottom, int backgroundIndex, String command) {
+ this.x = x;
+ this.y = y;
+ this.icon = icon;
+ this.playerInvOnly = playerInvOnly;
+ this.anchorRight = anchorRight;
+ this.anchorBottom = anchorBottom;
+ this.backgroundIndex = backgroundIndex;
+ this.command = command;
+ }
+ }
+
+}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Fishing.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Fishing.java
index 3275ad46..61fcc559 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Fishing.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Fishing.java
@@ -22,22 +22,21 @@ public class Fishing {
@Expose
@ConfigOption(
- name = "Incoming Fish Warning",
- desc = "Display a yellow '!' when a fish is incoming and a red '!' when you need to pull the fish up. " +
- "The red '!' also takes your ping into account"
+ name = "Fish Warning (R)",
+ desc = "Display a red '!' when you need to pull the fish up. The warning takes your ping into account"
)
@ConfigEditorBoolean
@ConfigAccordionId(id = 3)
- public boolean incomingFishWarning = true;
+ public boolean incomingFishWarningR = true;
@Expose
@ConfigOption(
- name = "Auto Fish",
- desc = "shitty auto fish"
+ name = "Fish Warning (Y)",
+ desc = "Display a yellow '!' when a fish is approaching your bobber"
)
@ConfigEditorBoolean
@ConfigAccordionId(id = 3)
- public boolean autoFish = true;
+ public boolean incomingFishWarning = true;
@Expose
@ConfigOption(
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java
index e54bd2f3..17c25117 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java
@@ -15,7 +15,7 @@ public class StorageGUI {
@Expose
@ConfigOption(
name = "Enable Storage GUI",
- desc = "Show a custom storage overlay when accessing /storage." +
+ desc = "Show a custom storage overlay when accessing /storage. " +
"Makes switching between pages much easier and also allows for searching through all storages"
)
@ConfigEditorBoolean
@@ -62,7 +62,7 @@ public class StorageGUI {
)
@ConfigEditorBoolean
@ConfigAccordionId(id = 1)
- public boolean backpackPreview = false;
+ public boolean backpackPreview = true;
@Expose
@ConfigOption(
@@ -73,6 +73,36 @@ public class StorageGUI {
@ConfigAccordionId(id = 1)
public boolean masonryMode = false;
+ @Expose
+ @ConfigOption(
+ name = "Fancy Glass Panes",
+ desc = "Replace the glass pane textures in your storage containers with a fancy connected texture"
+ )
+ @ConfigEditorDropdown(
+ values = {"On", "Locked", "Off"}
+ )
+ @ConfigAccordionId(id = 1)
+ public int fancyPanes = 0;
+
+ @Expose
+ @ConfigOption(
+ name = "Search Bar Autofocus",
+ desc = "Automatically focus the search bar when pressing keys"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 1)
+ public boolean searchBarAutofocus = true;
+
+ @Expose
+ @ConfigOption(
+ name = "Selected Storage Colour",
+ desc = "Change the colour used to draw the selected backpack border"
+ )
+ @ConfigEditorColour
+ @ConfigAccordionId(id = 1)
+ public String selectedStorageColour = "0:255:255:223:0";
+
+
@ConfigOption(
name = "Inventory Backpacks",
desc = ""
@@ -90,6 +120,14 @@ public class StorageGUI {
public boolean showInvBackpack = false;
//public boolean showInvBackpack = false;
+ @Expose
+ @ConfigOption(
+ name = "Scroll to Backpack",
+ desc = "Allow scrolling to the backpack using the mouse wheel. If you have the hotkey enabled (default: KEY_GRAVE), you can still use that"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 0)
+ public boolean scrollToBackpack = false;
@Expose
@ConfigOption(
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java
index 2cdbc0ab..3719e120 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java
@@ -18,7 +18,7 @@ public class Toolbar {
desc = "Show QuickCommands\u2122 in the NEU toolbar"
)
@ConfigEditorBoolean
- public boolean quickCommands = true;
+ public boolean quickCommands = false;
@Expose
@ConfigOption(
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java
index a486c773..f9853cb1 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java
@@ -36,7 +36,7 @@ public class MiningOverlay extends TextOverlay {
super(position, dummyStrings, styleSupplier);
}
- private static final Pattern NUMBER_PATTERN = Pattern.compile("\\d+");
+ private static final Pattern NUMBER_PATTERN = Pattern.compile("\\d+(?: |$)");
private static Map<String, Integer> commissionMaxes = new HashMap<>();
public static Map<String, Float> commissionProgress = new LinkedHashMap<>();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
index acdd4cb4..37e9c600 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
@@ -67,7 +67,7 @@ import java.util.regex.Pattern;
public class Utils {
- private static boolean hasEffectOverride = false;
+ public static boolean hasEffectOverride = false;
public static boolean disableCustomDungColours = false;
private static LinkedList<Integer> guiScales = new LinkedList<>();
private static ScaledResolution lastScale = new ScaledResolution(Minecraft.getMinecraft());
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java
index cde93ddf..fc5d3e38 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java
@@ -37,7 +37,8 @@ public class XPInformation {
private static Splitter SPACE_SPLITTER = Splitter.on(" ").omitEmptyStrings().trimResults();
private static Pattern SKILL_PATTERN = Pattern.compile("\\+(\\d+(?:,\\d+)*(?:\\.\\d+)?) (.+) \\((\\d+(?:,\\d+)*(?:\\.\\d+)?)/(\\d+(?:,\\d+)*(?:\\.\\d+)?)\\)");
- private static Pattern SKILL_PATTERN_ALT = Pattern.compile("\\+(\\d+(?:,\\d+)*(?:\\.\\d+)?) (.+) \\((\\d\\d?(?:\\.\\d\\d?)?)%\\)");
+ private static Pattern SKILL_PATTERN_MULTIPLIER = Pattern.compile("\\+(\\d+(?:,\\d+)*(?:\\.\\d+)?) (.+) \\((\\d+(?:,\\d+)*(?:\\.\\d+)?)/(\\d+(?:k|m|b))\\)");
+ private static Pattern SKILL_PATTERN_PERCENTAGE = Pattern.compile("\\+(\\d+(?:,\\d+)*(?:\\.\\d+)?) (.+) \\((\\d\\d?(?:\\.\\d\\d?)?)%\\)");
public HashMap<String, SkillInfo> getSkillInfoMap() {
return skillInfoMap;
@@ -47,13 +48,22 @@ public class XPInformation {
return skillInfoMap.get(skillName.toLowerCase());
}
+ private String lastActionBar = null;
+
@SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
public void onChatReceived(ClientChatReceivedEvent event) {
if(event.type == 2) {
JsonObject leveling = Constants.LEVELING;
if(leveling == null) return;
- List<String> components = SPACE_SPLITTER.splitToList(StringUtils.cleanColour(event.message.getUnformattedText()));
+ String actionBar = StringUtils.cleanColour(event.message.getUnformattedText());
+
+ if(lastActionBar != null && lastActionBar.equalsIgnoreCase(actionBar)) {
+ return;
+ }
+ lastActionBar = actionBar;
+
+ List<String> components = SPACE_SPLITTER.splitToList(actionBar);
for(String component : components) {
Matcher matcher = SKILL_PATTERN.matcher(component);
@@ -83,14 +93,57 @@ public class XPInformation {
skillInfoMap.put(skillS.toLowerCase(), skillInfo);
return;
- }
- matcher = SKILL_PATTERN_ALT.matcher(component);
- if(matcher.matches()) {
- String skillS = matcher.group(2);
- String xpPercentageS = matcher.group(3).replace(",","");
-
- float xpPercentage = Float.parseFloat(xpPercentageS);
- updateWithPercentage.put(skillS.toLowerCase(), xpPercentage);
+ } else {
+ matcher = SKILL_PATTERN_PERCENTAGE.matcher(component);
+ if(matcher.matches()) {
+ String skillS = matcher.group(2);
+ String xpPercentageS = matcher.group(3).replace(",","");
+
+ float xpPercentage = Float.parseFloat(xpPercentageS);
+ updateWithPercentage.put(skillS.toLowerCase(), xpPercentage);
+ } else {
+ matcher = SKILL_PATTERN_MULTIPLIER.matcher(component);
+
+ if(matcher.matches()) {
+ String skillS = matcher.group(2);
+ String currentXpS = matcher.group(3).replace(",","");
+ String maxXpS = matcher.group(4).replace(",","");
+
+ float maxMult = 1;
+ if(maxXpS.endsWith("k")) {
+ maxMult = 1000;
+ maxXpS = maxXpS.substring(0, maxXpS.length()-1);
+ } else if(maxXpS.endsWith("m")) {
+ maxMult = 1000000;
+ maxXpS = maxXpS.substring(0, maxXpS.length()-1);
+ } else if(maxXpS.endsWith("b")) {
+ maxMult = 1000000000;
+ maxXpS = maxXpS.substring(0, maxXpS.length()-1);
+ }
+
+ float currentXp = Float.parseFloat(currentXpS);
+ float maxXp = Float.parseFloat(maxXpS) * maxMult;
+
+ SkillInfo skillInfo = new SkillInfo();
+ skillInfo.currentXp = currentXp;
+ skillInfo.currentXpMax = maxXp;
+ skillInfo.totalXp = currentXp;
+
+ JsonArray levelingArray = leveling.getAsJsonArray("leveling_xp");
+ for(int i=0; i<levelingArray.size(); i++) {
+ float cap = levelingArray.get(i).getAsFloat();
+ if(maxXp > 0 && maxXp <= cap) {
+ break;
+ }
+
+ skillInfo.totalXp += cap;
+ skillInfo.level++;
+ }
+
+ skillInfoMap.put(skillS.toLowerCase(), skillInfo);
+ return;
+ }
+ }
}
}
}
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png
index ef0fc12c..45e4bb3a 100644
--- a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png
index 1ab12908..d9703226 100644
--- a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png
index 3c68ca71..5b016cea 100644
--- a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png
index e5fecb5e..f6c3e88e 100644
--- a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png
new file mode 100644
index 00000000..429e7a28
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png
index 901f0690..8e435046 100644
--- a/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg
new file mode 100644
index 00000000..48d7a47f
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg
new file mode 100644
index 00000000..ace0d1a0
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg
new file mode 100644
index 00000000..afed0c9b
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg
new file mode 100644
index 00000000..0b03bbfb
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg
new file mode 100644
index 00000000..b7142650
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg
new file mode 100644
index 00000000..8e62f742
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg
new file mode 100644
index 00000000..6f296154
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg
new file mode 100644
index 00000000..682aae45
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg
new file mode 100644
index 00000000..ea4efa72
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg
new file mode 100644
index 00000000..9be04bea
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg
new file mode 100644
index 00000000..d2f1e372
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg
new file mode 100644
index 00000000..11598aec
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg
new file mode 100644
index 00000000..6c8a53e7
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg
new file mode 100644
index 00000000..c78a311f
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg
new file mode 100644
index 00000000..48080f68
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg
new file mode 100644
index 00000000..382082e2
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg
new file mode 100644
index 00000000..7f3576fe
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg
new file mode 100644
index 00000000..de065e28
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg
Binary files differ
diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg
new file mode 100644
index 00000000..29fdfc1b
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg
Binary files differ
diff --git a/src/main/resources/mixins.notenoughupdates.json b/src/main/resources/mixins.notenoughupdates.json
index 1fd1b7ae..0d415976 100644
--- a/src/main/resources/mixins.notenoughupdates.json
+++ b/src/main/resources/mixins.notenoughupdates.json
@@ -9,7 +9,6 @@
"MixinEntityPlayer",
"MixinEntityPlayerSP",
"MixinEntityRenderer",
- "MixinFontRenderer",
"MixinGuiChest",
"MixinGuiContainer",
"MixinGuiIngame",