From 94444cebc3e5e109e139df4f9a614f14c54d9cef Mon Sep 17 00:00:00 2001 From: Newwind Date: Sun, 25 Aug 2024 18:42:15 +0100 Subject: [PATCH] Fix incorrect timestamp in region file header recalculation (#11318) --- ...Attempt-to-recalculate-regionfile-header-if-it-is-co.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/1038-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/1038-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch index 3b391d165a..114443675b 100644 --- a/patches/server/1038-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch +++ b/patches/server/1038-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch @@ -74,7 +74,7 @@ index a23dc2f8f4475de1ee35bf18a7a8a53233ccac12..226af44fd469053451a0403a95ffb446 this.used.set(start, start + size); } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -index e761b63eebc1e76b2bb1cb887d83d0b63ad6ec90..eb0389ad86300665b6e057bcfa1d7c068dc6c6ab 100644 +index e761b63eebc1e76b2bb1cb887d83d0b63ad6ec90..1e0439cf3f4008fa430acb90b45f5bc4cdd6d7f2 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java @@ -51,6 +51,354 @@ public class RegionFile implements AutoCloseable { @@ -411,7 +411,7 @@ index e761b63eebc1e76b2bb1cb887d83d0b63ad6ec90..eb0389ad86300665b6e057bcfa1d7c06 + // simply destroy the timestamp header, it's not used + + for (int i = 0; i < 32 * 32; ++i) { -+ this.timestamps.put(i, calculatedOffsets[i] != 0 ? (int)System.currentTimeMillis() : 0); // write a valid timestamp for valid chunks, I do not want to find out whatever dumb program actually checks this ++ this.timestamps.put(i, calculatedOffsets[i] != 0 ? RegionFile.getTimestamp() : 0); // write a valid timestamp for valid chunks, I do not want to find out whatever dumb program actually checks this + } + + // write new header