aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
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);