From 55213c61293950a2fee1ed0384ed00aa6bb6470b Mon Sep 17 00:00:00 2001 From: Antti Koponen Date: Tue, 6 Jan 2026 02:50:20 +0200 Subject: [PATCH] Prevent ticking virtual world borders multiple times per server tick --- .../world/level/border/WorldBorder.java.patch | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/paper-server/patches/sources/net/minecraft/world/level/border/WorldBorder.java.patch b/paper-server/patches/sources/net/minecraft/world/level/border/WorldBorder.java.patch index 649fae49b6eb..33463ef911fb 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/border/WorldBorder.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/border/WorldBorder.java.patch @@ -1,10 +1,11 @@ --- a/net/minecraft/world/level/border/WorldBorder.java +++ b/net/minecraft/world/level/border/WorldBorder.java -@@ -33,6 +_,7 @@ +@@ -33,6 +_,8 @@ double centerZ; int absoluteMaxSize = 29999984; WorldBorder.BorderExtent extent = new WorldBorder.StaticBorderExtent(5.999997E7F); + public net.minecraft.server.level.@org.jspecify.annotations.Nullable ServerLevel world; // CraftBukkit ++ private int lastTick = -1; // Paper - Prevent ticking virtual world borders multiple times per server tick public WorldBorder() { this(WorldBorder.Settings.DEFAULT); @@ -91,6 +92,19 @@ this.listeners.add(listener); } +@@ -278,6 +_,12 @@ + } + + public void tick() { ++ // Paper start - Prevent ticking virtual world borders multiple times per server tick ++ if (this.lastTick == net.minecraft.server.MinecraftServer.currentTick) { ++ return; ++ } ++ this.lastTick = net.minecraft.server.MinecraftServer.currentTick; ++ // Paper end - Prevent ticking virtual world borders multiple times per server tick + this.extent = this.extent.update(); + } + @@ -298,6 +_,22 @@ } }