Skip to content

Commit

Permalink
Temporary MyWorlds compat
Browse files Browse the repository at this point in the history
Will later be replaced by more robust support for arbitrary non-vanilla NBT tags
  • Loading branch information
Jikoo committed Feb 13, 2024
1 parent 70c1ecf commit f3236f2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ private void revertSpecialValues(@NotNull CompoundTag newData, @Nullable Compoun
newData.put("RootVehicle", oldData.getCompound("RootVehicle"));
}

// TODO: Better-support arbitrary non-vanilla data
// Blacklist vanilla root tags, copy all others
// Should do this BEFORE calling #setExtraData to not clobber additional info from server impl that we should load properly
CompoundTag myWorlds = getTag(oldData, "MyWorlds", CompoundTag.class);
if (myWorlds != null) {
newData.put("MyWorlds", myWorlds);
}

// Revert automatic updates to play timestamps.
copyValue(oldData, newData, "bukkit", "lastPlayed", NumericTag.class);
copyValue(oldData, newData, "Paper", "LastSeen", NumericTag.class);
Expand Down

0 comments on commit f3236f2

Please sign in to comment.