From ed45929e5e764d1379cadc12589d7946906d1e9a Mon Sep 17 00:00:00 2001
From: drXor <mcyoung@mit.edu>
Date: Sat, 9 Aug 2014 17:27:35 -0500
Subject: [PATCH] Configurable hanging tick EntityHangings make a somewhat
 extensive calculation ever 100 ticks to check if they should die (obstruction
 etc). This patch makes this magic number configurable, allowing server owners
 to pick how often they want EntityHangings (e.g. ItemFrames) to tick. Higher
 values may provide a performance boost for Hanging-heavy servers.

---
 .../Configurable-hanging-tick.patch           | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 Spigot-Server-Patches/Configurable-hanging-tick.patch

diff --git a/Spigot-Server-Patches/Configurable-hanging-tick.patch b/Spigot-Server-Patches/Configurable-hanging-tick.patch
new file mode 100644
index 0000000000..9bfaa4ec5e
--- /dev/null
+++ b/Spigot-Server-Patches/Configurable-hanging-tick.patch
@@ -0,0 +1,36 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: drXor <mcyoung@mit.edu>
+Date: Sat, 9 Aug 2014 17:24:20 -0500
+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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/EntityHanging.java
++++ b/src/main/java/net/minecraft/server/EntityHanging.java
+@@ -0,0 +0,0 @@ public abstract class EntityHanging extends Entity {
+         this.lastX = this.locX;
+         this.lastY = this.locY;
+         this.lastZ = this.locZ;
+-        if (this.e++ == 100 && !this.world.isStatic) {
++        if (this.e++ == this.world.paperSpigotConfig.hangingTickFrequency && !this.world.isStatic) { // PaperSpigot - 100 -> this.world.paperSpigotConfig.hangingTickFrequency
+             this.e = 0;
+             if (!this.dead && !this.survives()) {
+                 // CraftBukkit start - fire break events
+diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
+         waterOverLavaFlowSpeed = getInt( "water-over-lava-flow-speed", 5 );
+         log( "Water over lava flow speed: " + waterOverLavaFlowSpeed);
+     }
++
++    public int hangingTickFrequency;
++    private void hangingTickSpeed()
++    {
++        hangingTickFrequency = getInt( "hanging-tick-frequency", 100);
++        log( "Hanging entities tick frequency: " + hangingTickFrequency);
++    }
+ }
+--
\ No newline at end of file