diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2022-06-12 05:21:52 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-11 15:21:52 -0400 |
commit | b3a62c57c3bb5f2e2bb033bb08e085a30be8e570 (patch) | |
tree | 604fc808a7a1a2abe2207d8bc2587bda0bd19825 /src/main/java/io | |
parent | ce23654aff4c315fde75d57c0cfde5b9e2d4bfe0 (diff) | |
download | NotEnoughUpdates-b3a62c57c3bb5f2e2bb033bb08e085a30be8e570.tar.gz NotEnoughUpdates-b3a62c57c3bb5f2e2bb033bb08e085a30be8e570.tar.bz2 NotEnoughUpdates-b3a62c57c3bb5f2e2bb033bb08e085a30be8e570.zip |
added social and equipment to pv (#158)
* Added equippment to pv
* not working :thumn up :trollface:
* working i think
* i forgot
* 2.1md gaming
* Fixing offset i think?
* Rename social_xp -> social
* thank you hy pixel for making equipemnt in a different order to armoru
Co-authored-by: jani270 <jani270@gmx.de>
Co-authored-by: jani270 <69345714+jani270@users.noreply.github.com>
Co-authored-by: kr45732 <52721908+kr45732@users.noreply.github.com>
Diffstat (limited to 'src/main/java/io')
3 files changed, 48 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java index 408c8a6d..0aade4b0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java @@ -174,6 +174,7 @@ public class ChatListener { ); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( EnumChatFormatting.YELLOW + "[NEU] API Key automatically configured")); + NotEnoughUpdates.INSTANCE.saveConfig(); } else if (unformatted.startsWith("Player List Info is now disabled!")) { SBInfo.getInstance().hasNewTab = false; } else if (unformatted.startsWith("Player List Info is now enabled!")) { 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 e4014ca3..3f131465 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -265,6 +265,7 @@ public class GuiProfileViewer extends GuiScreen { private ItemStack[] bestWeapons = null; private ItemStack[] bestRods = null; private ItemStack[] armorItems = null; + private ItemStack[] equipmentItems = null; private HashMap<String, ItemStack[][][]> inventoryItems = new HashMap<>(); private String selectedInventory = "inv_contents"; private int currentInventoryIndex = 0; @@ -2936,6 +2937,32 @@ public class GuiProfileViewer extends GuiScreen { } } + if (equipmentItems == null) { + equipmentItems = new ItemStack[4]; + JsonArray equippment = Utils.getElement(inventoryInfo, "equippment_contents").getAsJsonArray(); + for (int i = 0; i < equippment.size(); i++) { + if (equippment.get(i) == null || !equippment.get(i).isJsonObject()) continue; + equipmentItems[i] = NotEnoughUpdates.INSTANCE.manager.jsonToStack(equippment.get(i).getAsJsonObject(), false); + } + } + + for (int i = 0; i < equipmentItems.length; i++) { + ItemStack stack = equipmentItems[i]; + if (stack != null) { + Utils.drawItemStack(stack, guiLeft + 192, guiTop + 13 + 18 * i); + if (stack != fillerStack) { + if (mouseX >= guiLeft + 192 - 1 && mouseX <= guiLeft + 192 + 16 + 1) { + if (mouseY >= guiTop + 13 + 18 * i - 1 && mouseY <= guiTop + 13 + 18 * i + 16 + 1) { + tooltipToDisplay = stack.getTooltip( + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips + ); + } + } + } + } + } + ItemStack[][][] inventories = getItemsForInventory(inventoryInfo, selectedInventory); if (currentInventoryIndex >= inventories.length) currentInventoryIndex = inventories.length - 1; if (currentInventoryIndex < 0) currentInventoryIndex = 0; @@ -5236,6 +5263,7 @@ public class GuiProfileViewer extends GuiScreen { bestWeapons = null; bestRods = null; armorItems = null; + equipmentItems = null; inventoryItems = new HashMap<>(); currentInventoryIndex = 0; arrowCount = -1; 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 5ed84b03..9da55d64 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -84,6 +84,7 @@ public class ProfileViewer { "skill_runecrafting", Utils.createItemStack(Items.magma_cream, EnumChatFormatting.DARK_PURPLE + "Runecrafting") ); + put("skill_social2", Utils.createItemStack(Items.emerald, EnumChatFormatting.DARK_GREEN + "Social")); // put("skill_catacombs", Utils.createItemStack(Item.getItemFromBlock(Blocks.deadbush), EnumChatFormatting.GOLD+"Catacombs")); put("slayer_zombie", Utils.createItemStack(Items.rotten_flesh, EnumChatFormatting.GOLD + "Rev Slayer")); put("slayer_spider", Utils.createItemStack(Items.spider_eye, EnumChatFormatting.GOLD + "Tara Slayer")); @@ -883,6 +884,8 @@ public class ProfileViewer { Utils.getElementAsFloat(Utils.getElement(profileInfo, "experience_skill_alchemy"), 0); float experience_skill_runecrafting = Utils.getElementAsFloat(Utils.getElement(profileInfo, "experience_skill_runecrafting"), 0); + float experience_skill_social = + Utils.getElementAsFloat(Utils.getElement(profileInfo, "experience_skill_social2"), 0); float experience_skill_hotm = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.experience"), 0); float experience_skill_catacombs = @@ -901,7 +904,7 @@ public class ProfileViewer { float totalSkillXP = experience_skill_taming + experience_skill_mining + experience_skill_foraging + experience_skill_enchanting + experience_skill_carpentry + experience_skill_farming + experience_skill_combat + experience_skill_fishing + experience_skill_alchemy - + experience_skill_runecrafting; + + experience_skill_runecrafting + experience_skill_social; if (totalSkillXP <= 0) { return null; @@ -919,6 +922,7 @@ public class ProfileViewer { skillInfo.addProperty("experience_skill_fishing", experience_skill_fishing); skillInfo.addProperty("experience_skill_alchemy", experience_skill_alchemy); skillInfo.addProperty("experience_skill_runecrafting", experience_skill_runecrafting); + skillInfo.addProperty("experience_skill_social2", experience_skill_social); skillInfo.addProperty("experience_skill_hotm", experience_skill_hotm); skillInfo.addProperty("experience_skill_catacombs", experience_skill_catacombs); @@ -948,6 +952,9 @@ public class ProfileViewer { Level level_skill_runecrafting = getLevel(Utils.getElement(leveling, "runecrafting_xp").getAsJsonArray(), experience_skill_runecrafting, getCap(leveling, "runecrafting"), false ); + Level level_skill_social = getLevel(Utils.getElement(leveling, "social").getAsJsonArray(), + experience_skill_social, getCap(leveling, "social"), false + ); Level level_skill_catacombs = getLevel(Utils.getElement(leveling, "catacombs").getAsJsonArray(), experience_skill_catacombs, getCap(leveling, "catacombs"), false ); @@ -978,6 +985,7 @@ public class ProfileViewer { skillInfo.addProperty("level_skill_fishing", level_skill_fishing.level); skillInfo.addProperty("level_skill_alchemy", level_skill_alchemy.level); skillInfo.addProperty("level_skill_runecrafting", level_skill_runecrafting.level); + skillInfo.addProperty("level_skill_social2", level_skill_social.level); skillInfo.addProperty("level_skill_catacombs", level_skill_catacombs.level); @@ -997,6 +1005,7 @@ public class ProfileViewer { skillInfo.addProperty("maxed_skill_fishing", level_skill_fishing.maxed); skillInfo.addProperty("maxed_skill_alchemy", level_skill_alchemy.maxed); skillInfo.addProperty("maxed_skill_runecrafting", level_skill_runecrafting.maxed); + skillInfo.addProperty("maxed_skill_social2", level_skill_social.maxed); skillInfo.addProperty("maxed_skill_catacombs", level_skill_catacombs.maxed); @@ -1016,6 +1025,7 @@ public class ProfileViewer { skillInfo.addProperty("maxxp_skill_fishing", level_skill_fishing.maxXpForLevel); skillInfo.addProperty("maxxp_skill_alchemy", level_skill_alchemy.maxXpForLevel); skillInfo.addProperty("maxxp_skill_runecrafting", level_skill_runecrafting.maxXpForLevel); + skillInfo.addProperty("maxxp_skill_social2", level_skill_social.maxXpForLevel); skillInfo.addProperty("maxxp_skill_catacombs", level_skill_catacombs.maxXpForLevel); @@ -1079,6 +1089,10 @@ public class ProfileViewer { Utils.getElement(profileInfo, "candy_inventory_contents.data"), "Hz8IAAAAAAAAAD9iYD9kYD9kAAMAPwI/Gw0AAAA=" ); + String equipment_contents_bytes = Utils.getElementAsString( + Utils.getElement(profileInfo, "equippment_contents.data"), + "Hz8IAAAAAAAAAD9iYD9kYD9kAAMAPwI/Gw0AAAA=" + ); JsonObject inventoryInfo = new JsonObject(); @@ -1093,7 +1107,8 @@ public class ProfileViewer { "potion_bag", "inv_contents", "talisman_bag", - "candy_inventory_contents" + "candy_inventory_contents", + "equippment_contents" }; String[] inv_bytes = new String[]{ inv_armor_bytes, @@ -1106,7 +1121,8 @@ public class ProfileViewer { potion_bag_bytes, inv_contents_bytes, talisman_bag_bytes, - candy_inventory_contents_bytes + candy_inventory_contents_bytes, + equipment_contents_bytes }; for (int i = 0; i < inv_bytes.length; i++) { try { |