0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/spigot.git synced 2024-11-21 20:56:14 +00:00
spigot/CraftBukkit-Patches/0064-Configurable-Hanging-Tick.patch
2024-10-23 02:15:00 +11:00

38 lines
1.6 KiB
Diff

From 832257d6556be7732b20cba0de102f82a1dfd227 Mon Sep 17 00:00:00 2001
From: drXor <mcyoung@mit.edu>
Date: Sat, 9 Aug 2014 13:56:51 -0400
Subject: [PATCH] Configurable Hanging Tick
diff --git a/src/main/java/net/minecraft/world/entity/decoration/BlockAttachedEntity.java b/src/main/java/net/minecraft/world/entity/decoration/BlockAttachedEntity.java
index b53a142519..8887aac614 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/BlockAttachedEntity.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/BlockAttachedEntity.java
@@ -50,7 +50,7 @@ public abstract class BlockAttachedEntity extends Entity {
if (world instanceof WorldServer worldserver) {
this.checkBelowWorld();
- if (this.checkInterval++ == 100) {
+ if (this.checkInterval++ == this.level().spigotConfig.hangingTickFrequency) { // Spigot
this.checkInterval = 0;
if (!this.isRemoved() && !this.survives()) {
// CraftBukkit start - fire break events
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 8411f9e573..76aeff3324 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -367,4 +367,10 @@ public class SpigotWorldConfig
maxTntTicksPerTick = getInt( "max-tnt-per-tick", 100 );
log( "Max TNT Explosions: " + maxTntTicksPerTick );
}
+
+ public int hangingTickFrequency;
+ private void hangingTickFrequency()
+ {
+ hangingTickFrequency = getInt( "hanging-tick-frequency", 100 );
+ }
}
--
2.47.0