Skip to content

Commit

Permalink
fixed jani thing (Moulberry#260)
Browse files Browse the repository at this point in the history
Co-authored-by: Lorenz <[email protected]>
  • Loading branch information
efefury and hannibal002 authored Sep 9, 2022
1 parent d1488df commit 8b53b53
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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;
Expand Down Expand Up @@ -93,6 +94,17 @@ public NEUItemEditor(String internalName, JsonObject item) {
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;
Expand Down

0 comments on commit 8b53b53

Please sign in to comment.