From 5ec1e1bc24ef03e2e4bdd3533997e2b7baf02303 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 9 Aug 2014 13:56:51 -0400 Subject: [PATCH] Configurable Hanging Tick By: drXor --- .../entity/decoration/BlockAttachedEntity.java.patch | 8 ++++++-- .../src/main/java/org/spigotmc/SpigotWorldConfig.java | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/world/entity/decoration/BlockAttachedEntity.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/decoration/BlockAttachedEntity.java.patch index 57331b11fa..0d00e2d56c 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/decoration/BlockAttachedEntity.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/decoration/BlockAttachedEntity.java.patch @@ -30,8 +30,12 @@ public abstract class BlockAttachedEntity extends Entity { -@@ -44,7 +52,25 @@ - if (this.checkInterval++ == 100) { +@@ -41,10 +49,28 @@ + + if (world instanceof ServerLevel worldserver) { + this.checkBelowWorld(); +- if (this.checkInterval++ == 100) { ++ if (this.checkInterval++ == this.level().spigotConfig.hangingTickFrequency) { // Spigot this.checkInterval = 0; if (!this.isRemoved() && !this.survives()) { - this.discard(); diff --git a/paper-server/src/main/java/org/spigotmc/SpigotWorldConfig.java b/paper-server/src/main/java/org/spigotmc/SpigotWorldConfig.java index f0d37fb5bd..e84043528e 100644 --- a/paper-server/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/paper-server/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -367,4 +367,10 @@ public class SpigotWorldConfig this.maxTntTicksPerTick = this.getInt( "max-tnt-per-tick", 100 ); this.log( "Max TNT Explosions: " + this.maxTntTicksPerTick ); } + + public int hangingTickFrequency; + private void hangingTickFrequency() + { + this.hangingTickFrequency = this.getInt( "hanging-tick-frequency", 100 ); + } }