From c885b21024703088087ff53466d514a0b203b045 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Mon, 27 Dec 2021 13:35:09 -0800 Subject: [PATCH] Correctly parse last update for old chunks for regionfile recalc It's required so that comparisons between two chunks can be made --- ...mpt-to-recalculate-regionfile-header-if-it-is-co.patch | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch index 607d116a94..69f5372e05 100644 --- a/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch +++ b/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch @@ -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