From 8b53b538debb6285ab85877939b66f872c991f32 Mon Sep 17 00:00:00 2001 From: efefury <69400149+efefury@users.noreply.github.com> Date: Fri, 9 Sep 2022 06:07:07 +0000 Subject: fixed jani thing (#260) Co-authored-by: Lorenz --- .../moulberry/notenoughupdates/itemeditor/NEUItemEditor.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/io') 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; -- cgit