From 4b0c614847606d8ecbfabad77ec1cce5309024de Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Mon, 3 Apr 2023 19:13:29 -0700 Subject: [PATCH] Calculate correct redstone offset when merging regions It should be offset = to - from, not from - to. This should fix redstone freezing randomly when merging regions. Fixes https://github.com/PaperMC/Folia/issues/35 --- patches/server/0005-Threaded-Regions.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0005-Threaded-Regions.patch b/patches/server/0005-Threaded-Regions.patch index ccbec54..9a0cbde 100644 --- a/patches/server/0005-Threaded-Regions.patch +++ b/patches/server/0005-Threaded-Regions.patch @@ -5171,7 +5171,7 @@ index 0000000000000000000000000000000000000000..ac043fbc74874c205b821c3d2d011b92 +} diff --git a/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java b/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java new file mode 100644 -index 0000000000000000000000000000000000000000..82788131d513c1cc23de93fd4e3c44ea610ca66c +index 0000000000000000000000000000000000000000..f8eae93448d1d1c70bff68ff106139b61f0171c4 --- /dev/null +++ b/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java @@ -0,0 +1,649 @@ @@ -5247,7 +5247,7 @@ index 0000000000000000000000000000000000000000..82788131d513c1cc23de93fd4e3c44ea + into.connections.add(conn); + } + // time -+ final long fromRedstoneTimeOffset = from.redstoneTime - into.redstoneTime; ++ final long fromRedstoneTimeOffset = into.redstoneTime - from.redstoneTime; + // entities + for (final ServerPlayer player : from.localPlayers) { + into.localPlayers.add(player);