aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java12
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;