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/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.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/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.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 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/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.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/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.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