From 485b92ecaa14b9c072f31c5ccc925f1bf2c2e2c3 Mon Sep 17 00:00:00 2001 From: DoKM Date: Wed, 21 Jul 2021 14:40:16 +0200 Subject: add mithril/hardstone/gemstone to pv --- .../notenoughupdates/profileviewer/ProfileViewer.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java index 66354dbc..62da3260 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -79,7 +79,7 @@ public class ProfileViewer { collectionCatToCollectionMap.put(CAT_MINING, Utils.createList("COBBLESTONE", "COAL", "IRON_INGOT", "GOLD_INGOT", "DIAMOND", "INK_SACK:4", "EMERALD", "REDSTONE", "QUARTZ", "OBSIDIAN", "GLOWSTONE_DUST", "GRAVEL", "ICE", "NETHERRACK", - "SAND", "ENDER_STONE")); + "SAND", "ENDER_STONE", "MITHRIL_ORE", "HARD_STONE", "GEMSTONE_COLLECTION")); collectionCatToCollectionMap.put(CAT_COMBAT, Utils.createList("ROTTEN_FLESH", "BONE", "STRING", "SPIDER_EYE", "SULPHUR", "ENDER_PEARL", "GHAST_TEAR", "SLIME_BALL", "BLAZE_ROD", "MAGMA_CREAM")); @@ -99,7 +99,7 @@ public class ProfileViewer { collectionCatToMinionMap.put(CAT_MINING, Utils.createList("COBBLESTONE", "COAL", "IRON", "GOLD", "DIAMOND", "LAPIS", "EMERALD", "REDSTONE", "QUARTZ", "OBSIDIAN", "GLOWSTONE", "GRAVEL", "ICE", null, - "SAND", "ENDER_STONE")); + "SAND", "ENDER_STONE", "MITHRIL", "HARD_STONE", null)); collectionCatToMinionMap.put(CAT_COMBAT, Utils.createList("ZOMBIE", "SKELETON", "SPIDER", "CAVESPIDER", "CREEPER", "ENDERMAN", "GHAST", "SLIME", "BLAZE", "MAGMA_CUBE")); @@ -182,6 +182,15 @@ public class ProfileViewer { EnumChatFormatting.GRAY+"Sand")); collectionToCollectionDisplayMap.put("ENDER_STONE", Utils.createItemStack(Item.getItemFromBlock(Blocks.end_stone), EnumChatFormatting.GRAY+"End Stone")); + collectionToCollectionDisplayMap.put("MITHRIL_ORE", Utils.createItemStack(Item.getItemFromBlock(Blocks.prismarine), + EnumChatFormatting.GRAY+"Mithril")); + collectionToCollectionDisplayMap.put("HARD_STONE", Utils.createItemStack(Item.getItemFromBlock(Blocks.stone), + EnumChatFormatting.GRAY+"Hard Stone")); + ItemStack gemstone = Utils.createItemStack(Item.getItemFromBlock(Blocks.stained_glass), + EnumChatFormatting.GRAY+"Gem Stones"); + gemstone.setItemDamage(14); + collectionToCollectionDisplayMap.put("GEMSTONE_COLLECTION", gemstone); + /** COMBAT COLLECTIONS **/ collectionToCollectionDisplayMap.put("ROTTEN_FLESH", Utils.createItemStack(Items.rotten_flesh, -- cgit From 52569e58afb3a2c6be37a3ec81638bf551d6a6dc Mon Sep 17 00:00:00 2001 From: DoKM Date: Wed, 21 Jul 2021 14:47:22 +0200 Subject: change mithril display from block prismarine to item primarine crystals --- .../github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java index 49fa18d9..9d1959ad 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -182,7 +182,7 @@ public class ProfileViewer { EnumChatFormatting.GRAY+"Sand")); collectionToCollectionDisplayMap.put("ENDER_STONE", Utils.createItemStack(Item.getItemFromBlock(Blocks.end_stone), EnumChatFormatting.GRAY+"End Stone")); - collectionToCollectionDisplayMap.put("MITHRIL_ORE", Utils.createItemStack(Item.getItemFromBlock(Blocks.prismarine), + collectionToCollectionDisplayMap.put("MITHRIL_ORE", Utils.createItemStack(Items.prismarine_crystals, EnumChatFormatting.GRAY+"Mithril")); collectionToCollectionDisplayMap.put("HARD_STONE", Utils.createItemStack(Item.getItemFromBlock(Blocks.stone), EnumChatFormatting.GRAY+"Hard Stone")); -- cgit From 5116aead5bf99802c724794dd251ed0ff5604676 Mon Sep 17 00:00:00 2001 From: DoKM Date: Wed, 21 Jul 2021 15:17:52 +0200 Subject: make position of previous/next button static --- .../notenoughupdates/profileviewer/GuiProfileViewer.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java') 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 fd70dadc..51a52109 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -616,8 +616,9 @@ public class GuiProfileViewer extends GuiScreen { int invSizeY = inventoryRows*18+17+7; int y = guiTop+101-invSizeY/2; + int staticSelectorHeight = guiTop+177; - if(mouseY > y+invSizeY && mouseY < y+invSizeY+16) { + if(mouseY > staticSelectorHeight && mouseY < staticSelectorHeight+16) { if(mouseX > guiLeft+320-12 && mouseX < guiLeft+320+12) { if(mouseX < guiLeft+320) { currentInventoryIndex--; @@ -1993,6 +1994,7 @@ public class GuiProfileViewer extends GuiScreen { int x = guiLeft+320-176/2; int y = guiTop+101-invSizeY/2; + int staticSelectorHeight = guiTop+177; this.drawTexturedModalRect(x, y, 0, 0, 176, inventoryRows*18+17); this.drawTexturedModalRect(x, y+inventoryRows*18+17, 0, 215, 176, 7); @@ -2000,7 +2002,7 @@ public class GuiProfileViewer extends GuiScreen { boolean leftHovered = false; boolean rightHovered = false; if(Mouse.isButtonDown(0)) { - if(mouseY > y+invSizeY && mouseY < y+invSizeY+16) { + if(mouseY > staticSelectorHeight && mouseY < staticSelectorHeight+16) { if(mouseX > guiLeft+320-12 && mouseX < guiLeft+320+12) { if(mouseX < guiLeft+320) { leftHovered = true; @@ -2013,11 +2015,11 @@ public class GuiProfileViewer extends GuiScreen { Minecraft.getMinecraft().getTextureManager().bindTexture(resource_packs); if(currentInventoryIndex > 0) { - Utils.drawTexturedRect(guiLeft+320-12, y+invSizeY, 12, 16, + Utils.drawTexturedRect(guiLeft+320-12, staticSelectorHeight, 12, 16, 29/256f, 53/256f, !leftHovered?0:32/256f, !leftHovered?32/256f:64/256f, GL11.GL_NEAREST); } if(currentInventoryIndex < inventories.length-1) { - Utils.drawTexturedRect(guiLeft+320, y+invSizeY, 12, 16, + Utils.drawTexturedRect(guiLeft+320, staticSelectorHeight, 12, 16, 5/256f, 29/256f, !rightHovered?0:32/256f, !rightHovered?32/256f:64/256f, GL11.GL_NEAREST); } -- cgit From c8855f07f6063fa870a8fdd8a3db2bb882a6fe8c Mon Sep 17 00:00:00 2001 From: DoKM Date: Wed, 21 Jul 2021 16:18:43 +0200 Subject: remove forgotten debug message --- .../moulberry/notenoughupdates/profileviewer/ProfileViewer.java | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java index 9d1959ad..b28e290c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -837,17 +837,10 @@ public class ProfileViewer { public JsonObject getBackpackData(JsonObject backpack_contents_json, JsonObject backpack_icons) { - - for (StackTraceElement ste : Thread.currentThread().getStackTrace()) { - System.out.println(ste); - } - JsonArray contents = new JsonArray(); - String[] backpackArray = new String[0]; - //Create backpack array which sizes up for(Map.Entry backpackIcon : backpack_icons.entrySet()) { if(backpackIcon.getValue() instanceof JsonObject){ -- cgit From c838098130bbe868c9b693c8a535b46585e2943d Mon Sep 17 00:00:00 2001 From: DoKM Date: Wed, 21 Jul 2021 18:47:21 +0200 Subject: hot fix for crashing in pv due to me forgetting to check if backpack info is null --- .../notenoughupdates/profileviewer/ProfileViewer.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java index b28e290c..b4fce512 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -835,9 +835,20 @@ public class ProfileViewer { return inventoryInfo; } + public boolean checkIfValidJson(JsonElement element){ + return element != null; + } + public JsonObject getBackpackData(JsonObject backpack_contents_json, JsonObject backpack_icons) { JsonArray contents = new JsonArray(); + if(!(checkIfValidJson(backpack_contents_json) && checkIfValidJson(backpack_icons))){ + JsonObject bundledReturn = new JsonObject(); + bundledReturn.add("contents", new JsonArray()); + bundledReturn.add("backpack_sizes", new JsonArray()); + + return bundledReturn; + } String[] backpackArray = new String[0]; -- cgit From 4cbf55396f509db89a467f8a4817bb652617f3cf Mon Sep 17 00:00:00 2001 From: DoKM Date: Wed, 21 Jul 2021 21:57:12 +0200 Subject: Add Scroll lock for storage gui so people with scrollable tooltips can scroll in storage gui --- .../notenoughupdates/miscgui/StorageOverlay.java | 5 ++++- .../options/seperateSections/StorageGUI.java | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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 b8d6dc38..2dd0fbd1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -40,6 +40,7 @@ import org.lwjgl.util.vector.Vector4f; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.awt.*; +import java.awt.event.KeyEvent; import java.util.*; import java.util.List; @@ -1439,7 +1440,9 @@ public class StorageOverlay extends GuiElement { if(!(Minecraft.getMinecraft().currentScreen instanceof GuiChest)) return false; int dWheel = Mouse.getEventDWheel(); - if(dWheel != 0) { + if(dWheel != 0 && + (((NotEnoughUpdates.INSTANCE.config.storageGUI.scrollLock == 0)|| + (NotEnoughUpdates.INSTANCE.config.storageGUI.scrollLock == 1 && !KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.slotLockKey))))) { if(dWheel < 0) { dWheel = -1; if(scrollVelocity > 0) scrollVelocity = 0; 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 17c25117..2b48bc74 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 @@ -102,6 +102,28 @@ public class StorageGUI { @ConfigAccordionId(id = 1) public String selectedStorageColour = "0:255:255:223:0"; + @Expose + @ConfigOption( + name = "Scroll Lock", + desc = "Stop scrolling when holding the key below.\n"+ + "Usefull for people using scrollable tooltips." + ) + @ConfigEditorDropdown( + values = {"Off", "On"} + ) + @ConfigAccordionId(id = 1) + public int scrollLock = 0; + + @Expose + @ConfigOption( + name = "Scroll Lock Key", + desc = "Hold this keep to stop scrolling in the gui.\n" + + "Don't forget to enable it above." + ) + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_LSHIFT) + @ConfigAccordionId(id = 1) + public int slotLockKey = Keyboard.KEY_LSHIFT; + @ConfigOption( name = "Inventory Backpacks", -- cgit From aebc16a2a5ca9c20affc27eb5a45cd9a95085168 Mon Sep 17 00:00:00 2001 From: DoKM Date: Wed, 21 Jul 2021 22:20:45 +0200 Subject: Small profile viewer fixes Thanks jani for noticing --- .../moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java') 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 51a52109..acd1f99d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -1591,8 +1591,9 @@ public class GuiProfileViewer extends GuiScreen { static { invNameToDisplayMap.put("inv_contents", Utils.createItemStack(Item.getItemFromBlock(Blocks.chest), EnumChatFormatting.GRAY+"Inventory")); invNameToDisplayMap.put("ender_chest_contents", Utils.createItemStack(Item.getItemFromBlock(Blocks.ender_chest), EnumChatFormatting.GRAY+"Ender Chest")); - invNameToDisplayMap.put("backpack_contents", Utils.createItemStack(Item.getItemFromBlock(Blocks.dropper), EnumChatFormatting.GRAY+"Backpacks")); - invNameToDisplayMap.put("personal_vault_contents", Utils.createItemStack(Item.getItemFromBlock(Blocks.dispenser), EnumChatFormatting.GRAY+"Personal vault")); + //invNameToDisplayMap.put("backpack_contents", Utils.createItemStack(Item.getItemFromBlock(Blocks.dropper), EnumChatFormatting.GRAY+"Backpacks")); + invNameToDisplayMap.put("backpack_contents", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("JUMBO_BACKPACK")).setStackDisplayName(EnumChatFormatting.GRAY+"Backpacks")); + invNameToDisplayMap.put("personal_vault_contents", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("IRON_CHEST")).setStackDisplayName(EnumChatFormatting.GRAY+"Personal vault")); invNameToDisplayMap.put("talisman_bag", Utils.createItemStack(Items.golden_apple, EnumChatFormatting.GRAY+"Accessory Bag")); invNameToDisplayMap.put("wardrobe_contents", Utils.createItemStack(Items.leather_chestplate, EnumChatFormatting.GRAY+"Wardrobe")); invNameToDisplayMap.put("fishing_bag", Utils.createItemStack(Items.fish, EnumChatFormatting.GRAY+"Fishing Bag")); @@ -2222,7 +2223,7 @@ public class GuiProfileViewer extends GuiScreen { guiLeft+xStart+xOffset, guiTop+yStartBottom, 76); Utils.renderAlignedString(EnumChatFormatting.DARK_AQUA+"Revenant T4", EnumChatFormatting.WHITE.toString()+(int)zombie_boss_kills_tier_3, guiLeft+xStart+xOffset, guiTop+yStartBottom+yOffset, 76); - Utils.renderAlignedString(EnumChatFormatting.DARK_AQUA+"Revenant T4", EnumChatFormatting.WHITE.toString()+(int)zombie_boss_kills_tier_4, + Utils.renderAlignedString(EnumChatFormatting.DARK_AQUA+"Revenant T5", EnumChatFormatting.WHITE.toString()+(int)zombie_boss_kills_tier_4, guiLeft+xStart+xOffset, guiTop+yStartBottom+yOffset*2, 76); Utils.renderAlignedString(EnumChatFormatting.DARK_AQUA+"Tarantula T3", EnumChatFormatting.WHITE.toString()+(int)spider_boss_kills_tier_2, guiLeft+xStart+xOffset, guiTop+yStartBottom+yOffset*3, 76); -- cgit