diff options
author | efefury <69400149+efefury@users.noreply.github.com> | 2022-09-09 06:07:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 16:07:07 +1000 |
commit | 8b53b538debb6285ab85877939b66f872c991f32 (patch) | |
tree | db6be94cda9c1effbb7478201dae6be2771feedb | |
parent | d1488df319a1d19154d294cb29627b9026deb564 (diff) | |
download | NotEnoughUpdates-8b53b538debb6285ab85877939b66f872c991f32.tar.gz NotEnoughUpdates-8b53b538debb6285ab85877939b66f872c991f32.tar.bz2 NotEnoughUpdates-8b53b538debb6285ab85877939b66f872c991f32.zip |
fixed jani thing (#260)
Co-authored-by: Lorenz <lo.scherf@gmail.com>
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java index 6a080ff8..e08e5369 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java @@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.itemeditor; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.util.Utils; @@ -93,6 +94,17 @@ public class NEUItemEditor extends GuiScreen { extraAttributes.removeTag("uuid"); extraAttributes.removeTag("timestamp"); + if (extraAttributes.hasKey("petInfo")) { + String petInfo = extraAttributes.getString("petInfo"); + JsonObject jsonObject = NotEnoughUpdates.INSTANCE.manager.gson.fromJson(petInfo, JsonObject.class); + + jsonObject.remove("heldItem"); + jsonObject.add("exp", new JsonPrimitive(0)); + jsonObject.add("candyUsed", new JsonPrimitive(0)); + + extraAttributes.setString("petInfo", jsonObject.toString()); + } + savedRepoItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().getOrDefault(internalName, null); internalName = internalName == null ? "" : internalName; |