PaperMC/CraftBukkit-Patches/0157-Configurable-Hanging-Tick.patch
Zach Brown 19972e09b8 Update SpigotMC's patches
5a0150f586ed3eb15fe6f1f596d1a5a7d806f0f9 Fix ITEM_BREAK
e6a3911057bd94d8bd7021cbb4923fb84fb106d1 Upstream merge
d1cdcf8d4c3639f956474f02ed662517cffbe23e Remove old patch
068df64aeee368377e1673667bffc7a6dcf90554 Rebuild all patches
2014-11-30 16:16:48 -06:00

37 lines
1.6 KiB
Diff

From 4d6ea8da056e4930014d6e1b911c7d95c46df555 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/server/EntityHanging.java b/src/main/java/net/minecraft/server/EntityHanging.java
index 76bc12a..d34e5bf 100644
--- a/src/main/java/net/minecraft/server/EntityHanging.java
+++ b/src/main/java/net/minecraft/server/EntityHanging.java
@@ -81,7 +81,7 @@ public abstract class EntityHanging extends Entity {
this.lastX = this.locX;
this.lastY = this.locY;
this.lastZ = this.locZ;
- if (this.c++ == 100 && !this.world.isStatic) {
+ if (this.c++ == this.world.spigotConfig.hangingTickFrequency && !this.world.isStatic) { // Spigot - 100 -> this.world.spigotConfig.hangingTickFrequency
this.c = 0;
if (!this.dead && !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 46377ab..420c584 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -349,4 +349,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.1.0