Skip to content

Commit

Permalink
ProgWidgetLegacyConv: can't use JsonObject#isEmpty for now
Browse files Browse the repository at this point in the history
It's in NeoForge, but not when the vanilla launcher is used... yay

#1338
  • Loading branch information
desht committed Aug 30, 2024
1 parent 9ce9e9b commit 6926604
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,11 @@ private static void convertV2toV3(JsonObject json) {

// add all the sub-objects
newEntry.add("pos", pos);
if (!digPlace.isEmpty()) newEntry.add("dig_place", digPlace);
if (!inv.isEmpty()) newEntry.add("inv", inv);
if (!cond.isEmpty()) newEntry.add("cond", cond);
if (!droneCond.isEmpty()) newEntry.add("drone_cond", cond);
// TODO: .isEmpty() can't be used right now: https://github.com/neoforged/NeoForge/issues/1380
if (digPlace.size() > 0) newEntry.add("dig_place", digPlace);
if (inv.size() > 0) newEntry.add("inv", inv);
if (cond.size() > 0) newEntry.add("cond", cond);
if (droneCond.size() > 0) newEntry.add("drone_cond", cond);

// phew, done
newDoc.add(newEntry);
Expand Down

0 comments on commit 6926604

Please sign in to comment.