aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2022-09-14 22:36:46 +1000
committerGitHub <noreply@github.com>2022-09-14 22:36:46 +1000
commit66560fdfedb95dcceed64c5d093d4b3703059616 (patch)
tree2c3a0a5f07ea5ea6cf3db771ac609422f0b16c12 /src/main/java
parent989b633329f00d9dd0b02e2ffc4ccf2a5d18bd30 (diff)
downloadNotEnoughUpdates-66560fdfedb95dcceed64c5d093d4b3703059616.tar.gz
NotEnoughUpdates-66560fdfedb95dcceed64c5d093d4b3703059616.tar.bz2
NotEnoughUpdates-66560fdfedb95dcceed64c5d093d4b3703059616.zip
show quiver even when inventory api is disabled (it shows selected arrow) (#277)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java48
1 files changed, 26 insertions, 22 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java
index c98792ee..b4f1da30 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java
@@ -240,28 +240,6 @@ public class InventoriesPage extends GuiProfileViewerPage {
if (currentInventoryIndex < 0) currentInventoryIndex = 0;
ItemStack[][] inventory = inventories[currentInventoryIndex];
- if (inventory == null) {
- if (selectedInventory.equalsIgnoreCase("personal_vault_contents")) {
- Utils.drawStringCentered(
- EnumChatFormatting.RED + "Personal Vault API not enabled!",
- Minecraft.getMinecraft().fontRendererObj,
- guiLeft + 317,
- guiTop + 101,
- true,
- 0
- );
- } else {
- Utils.drawStringCentered(
- EnumChatFormatting.RED + "Inventory API not enabled!",
- Minecraft.getMinecraft().fontRendererObj,
- guiLeft + 317,
- guiTop + 101,
- true,
- 0
- );
- }
- return;
- }
if (bestWeapons == null) {
bestWeapons =
@@ -363,6 +341,32 @@ public class InventoriesPage extends GuiProfileViewerPage {
}
}
+ if (inventory == null) {
+ String strToRender = "Inventory API not enabled!";
+ if (selectedInventory.equalsIgnoreCase("personal_vault_contents")) {
+ strToRender = "Personal Vault API not enabled!";
+ } else if (selectedInventory.equalsIgnoreCase("backpack_contents")) {
+ strToRender = "Inventory API not enabled";
+ Utils.drawStringCentered(
+ EnumChatFormatting.RED + "Or has no backpacks!",
+ Minecraft.getMinecraft().fontRendererObj,
+ guiLeft + 317,
+ guiTop + 112,
+ true,
+ 0
+ );
+ }
+ Utils.drawStringCentered(
+ EnumChatFormatting.RED + strToRender,
+ Minecraft.getMinecraft().fontRendererObj,
+ guiLeft + 317,
+ guiTop + 101,
+ true,
+ 0
+ );
+ return;
+ }
+
int inventoryRows = inventory.length;
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);