From d95ac585d4fe48c0b6e66d3c0f1ac8aca0d1cc62 Mon Sep 17 00:00:00 2001 From: drXor 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. --- .../0004-Player-affects-spawning-API.patch | 3 +- .../0032-Player-affects-spawning-API.patch | 3 +- .../0033-Configurable-hanging-tick.patch | 38 +++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 Spigot-Server-Patches/0033-Configurable-hanging-tick.patch diff --git a/Spigot-API-Patches/0004-Player-affects-spawning-API.patch b/Spigot-API-Patches/0004-Player-affects-spawning-API.patch index 12abc6874d..48e629af60 100644 --- a/Spigot-API-Patches/0004-Player-affects-spawning-API.patch +++ b/Spigot-API-Patches/0004-Player-affects-spawning-API.patch @@ -1,4 +1,4 @@ -From 759908be8944103e051eefd95710f9dfe39b532e Mon Sep 17 00:00:00 2001 +From 9be819202ea6ab85a9acca973e090495fb40893a Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Fri, 8 Aug 2014 22:51:26 -0500 Subject: [PATCH] Player affects spawning API @@ -39,3 +39,4 @@ index b2ad5b7..b2a8e2e 100644 Spigot spigot(); -- 1.9.1 + diff --git a/Spigot-Server-Patches/0032-Player-affects-spawning-API.patch b/Spigot-Server-Patches/0032-Player-affects-spawning-API.patch index 12385f2d1b..8b63c42d87 100644 --- a/Spigot-Server-Patches/0032-Player-affects-spawning-API.patch +++ b/Spigot-Server-Patches/0032-Player-affects-spawning-API.patch @@ -1,4 +1,4 @@ -From 3648075534d8e6fd4bff464c7481557ed7256fae Mon Sep 17 00:00:00 2001 +From 7829ffe30ea4dc9b409cd5140140b84a3372cc27 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Fri, 8 Aug 2014 22:51:26 -0500 Subject: [PATCH] Player affects spawning API @@ -128,3 +128,4 @@ index 849b971..ddda795 100644 public Player.Spigot spigot() -- 1.9.1 + diff --git a/Spigot-Server-Patches/0033-Configurable-hanging-tick.patch b/Spigot-Server-Patches/0033-Configurable-hanging-tick.patch new file mode 100644 index 0000000000..ad132f0c7b --- /dev/null +++ b/Spigot-Server-Patches/0033-Configurable-hanging-tick.patch @@ -0,0 +1,38 @@ +From ee7f178f022584989b8dd9d27b456e8d832ae0ca Mon Sep 17 00:00:00 2001 +From: drXor +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 eec465b..3b6d152 100644 +--- a/src/main/java/net/minecraft/server/EntityHanging.java ++++ b/src/main/java/net/minecraft/server/EntityHanging.java +@@ -102,7 +102,7 @@ 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 256316e..16eb1ca 100644 +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -163,4 +163,11 @@ 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); ++ } + } +-- +1.9.1 +