aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2021-08-30 13:05:10 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2021-08-30 13:05:10 +0200
commitb0164aa3994e4b74c6d7a15c1fe5d03f16dcba2e (patch)
tree0c5bb2eb4ec6c291f6eea4efda22ac5b6ae369e6 /src/main/java/io
parent60f942503864ac897484f7dd31a21c1cb03a04a2 (diff)
downloadNotEnoughUpdates-b0164aa3994e4b74c6d7a15c1fe5d03f16dcba2e.tar.gz
NotEnoughUpdates-b0164aa3994e4b74c6d7a15c1fe5d03f16dcba2e.tar.bz2
NotEnoughUpdates-b0164aa3994e4b74c6d7a15c1fe5d03f16dcba2e.zip
last thing
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java10
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java6
2 files changed, 13 insertions, 3 deletions
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 530833f9..3a3aec6d 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java
@@ -380,6 +380,16 @@ public class StorageManager {
public int getDisplayIdForStorageId(int storageId) {
if(storageId < 0) return -1;
+ for(Map.Entry<Integer, Integer> entry : storageConfig.displayToStorageIdMap.entrySet()) {
+ if(entry.getValue() == storageId) {
+ return entry.getKey();
+ }
+ }
+ return -1;
+ }
+
+ public int getDisplayIdForStorageIdRender(int storageId) {
+ if(storageId < 0) return -1;
for(Map.Entry<Integer, Integer> entry : storageConfig.displayToStorageIdMapRender.entrySet()) {
if(entry.getValue() == storageId) {
return entry.getKey();
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 bc96b732..d80a5daf 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
@@ -1705,7 +1705,7 @@ public class StorageOverlay extends GuiElement {
} else if(Mouse.getEventButtonState() && Mouse.getEventButton() == 0) {
for(int i=0; i<9; i++) {
int storageId = i;
- int displayId = StorageManager.getInstance().getDisplayIdForStorageId(i);
+ int displayId = StorageManager.getInstance().getDisplayIdForStorageIdRender(i);
StorageManager.StoragePage page = StorageManager.getInstance().getPage(storageId, false);
if(page != null) {
@@ -1722,7 +1722,7 @@ public class StorageOverlay extends GuiElement {
}
for(int i=0; i<18; i++) {
int storageId = i+StorageManager.MAX_ENDER_CHEST_PAGES;
- int displayId = StorageManager.getInstance().getDisplayIdForStorageId(i);
+ int displayId = StorageManager.getInstance().getDisplayIdForStorageIdRender(i);
StorageManager.StoragePage page = StorageManager.getInstance().getPage(storageId, false);
if(page != null) {
@@ -1805,7 +1805,7 @@ public class StorageOverlay extends GuiElement {
}
} else {
int currentPage = StorageManager.getInstance().getCurrentPageId();
- int displayId = StorageManager.getInstance().getDisplayIdForStorageId(currentPage);
+ int displayId = StorageManager.getInstance().getDisplayIdForStorageIdRender(currentPage);
if(displayId >= 0) {
IntPair pageCoords = getPageCoords(displayId);