diff options
author | DoKM <mcazzyman@gmail.com> | 2021-07-21 13:16:21 +0200 |
---|---|---|
committer | DoKM <mcazzyman@gmail.com> | 2021-07-21 13:16:21 +0200 |
commit | 2b1d5ba9b51d8a6afbf9c9f7b2cd3f244a5cd65d (patch) | |
tree | 25e23cff6245d700bdedc5d6430761c033b39a78 /src | |
parent | e6a69de9a95e9ecaa8b91c7846cc4003cb1e6578 (diff) | |
download | NotEnoughUpdates-2b1d5ba9b51d8a6afbf9c9f7b2cd3f244a5cd65d.tar.gz NotEnoughUpdates-2b1d5ba9b51d8a6afbf9c9f7b2cd3f244a5cd65d.tar.bz2 NotEnoughUpdates-2b1d5ba9b51d8a6afbf9c9f7b2cd3f244a5cd65d.zip |
Add working backpack viewer to /pv
also change the max size of enderchest to represent the in game view more
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java index 8f1b47d1..fd70dadc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -1665,6 +1665,8 @@ public class GuiProfileViewer extends GuiScreen { return 4;
case "backpack_contents":
return 5;
+ case "ender_chest_contents":
+ return 5;
}
return 6;
}
@@ -1759,22 +1761,27 @@ public class GuiProfileViewer extends GuiScreen { ItemStack[][][] inventories = new ItemStack[numInventories][][];
//int availableSlots = getAvailableSlotsForInventory(inventoryInfo, collectionInfo, invName);
+ int startNumberJ = 0;
for(int i=0; i<numInventories; i++) {
int thisRows = Math.min(maxRowsPerPage, rows-maxRowsPerPage*i);
+ int invSize =0;
+
+
if(invName.equals("backpack_contents")) {
thisRows = backPackSizes.get(i).getAsInt()/9;
+ invSize = startNumberJ+(thisRows*9);
+ maxInvSize = thisRows*9;
+ } else {
+ startNumberJ = maxInvSize*i;
+ invSize = Math.min(jsonInvSize, maxInvSize + maxInvSize * i);
}
if(thisRows <= 0) break;
ItemStack[][] items = new ItemStack[thisRows][rowSize];
- int invSize =0;
- invSize = Math.min(jsonInvSize, maxInvSize + maxInvSize * i);
+ for(int j=startNumberJ; j<invSize; j++) {
-
-
- for(int j=maxInvSize*i; j<invSize; j++) {
int xIndex = (j%maxInvSize)%rowSize;
int yIndex = (j%maxInvSize)/rowSize;
if(invName.equals("inv_contents")) {
@@ -1815,9 +1822,13 @@ public class GuiProfileViewer extends GuiScreen { stack.setTagCompound(tag);
}
}
+
items[yIndex][xIndex] = stack;
}
inventories[i] = items;
+ if(invName.equals("backpack_contents")) {
+ startNumberJ = startNumberJ + backPackSizes.get(i).getAsInt();
+ }
}
inventoryItems.put(invName, inventories);
|