Correctly parse last update for old chunks for regionfile recalc

It's required so that comparisons between two chunks can be
made
This commit is contained in:
Spottedleaf 2021-12-27 13:35:09 -08:00
parent 2ecc06a8fb
commit c885b21024

View file

@ -20,7 +20,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start
+ // TODO: Check on update
+ public static long getLastWorldSaveTime(CompoundTag chunkData) {
+ return chunkData.getLong("LastUpdate");
+ final int dataVersion = ChunkStorage.getVersion(chunkData);
+ if (dataVersion < 2842) { // Level tag is removed after this version
+ final CompoundTag levelData = chunkData.getCompound("Level");
+ return levelData.getLong("LastUpdate");
+ } else {
+ return chunkData.getLong("LastUpdate");
+ }
+ }
+ // Paper end