aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
diff options
context:
space:
mode:
authornopothegamer <40329022+nopothegamer@users.noreply.github.com>2021-07-22 09:42:35 +1000
committerGitHub <noreply@github.com>2021-07-22 09:42:35 +1000
commit8d9aeb9e47eba0ef4275b64592bc6dcd7696e0f9 (patch)
tree8bdff2cfe3dc071978576c816f5f29ab39a2284a /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
parent87058a95f50768ccbd1b1fed0a8f0600bf81304e (diff)
parentaebc16a2a5ca9c20affc27eb5a45cd9a95085168 (diff)
downloadnotenoughupdates-8d9aeb9e47eba0ef4275b64592bc6dcd7696e0f9.tar.gz
notenoughupdates-8d9aeb9e47eba0ef4275b64592bc6dcd7696e0f9.tar.bz2
notenoughupdates-8d9aeb9e47eba0ef4275b64592bc6dcd7696e0f9.zip
Merge pull request #1 from DoKM/master
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java29
1 files changed, 21 insertions, 8 deletions
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 5968fdce..b4fce512 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(Items.prismarine_crystals,
+ 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,
@@ -826,19 +835,23 @@ public class ProfileViewer {
return inventoryInfo;
}
- public JsonObject getBackpackData(JsonObject backpack_contents_json, JsonObject backpack_icons) {
-
+ public boolean checkIfValidJson(JsonElement element){
+ return element != null;
+ }
- for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
- System.out.println(ste);
- }
+ 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];
-
//Create backpack array which sizes up
for(Map.Entry<String, JsonElement> backpackIcon : backpack_icons.entrySet()) {
if(backpackIcon.getValue() instanceof JsonObject){