From f9e5f659871ee3859bf8257b5896746aecbd1587 Mon Sep 17 00:00:00 2001 From: Sudzzy Date: Thu, 23 Jul 2015 22:06:57 -0700 Subject: [PATCH] Configurable container update tick rate --- ...figurable-container-update-tick-rate.patch | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Spigot-Server-Patches/0070-Configurable-container-update-tick-rate.patch diff --git a/Spigot-Server-Patches/0070-Configurable-container-update-tick-rate.patch b/Spigot-Server-Patches/0070-Configurable-container-update-tick-rate.patch new file mode 100644 index 0000000..d1a50ce --- /dev/null +++ b/Spigot-Server-Patches/0070-Configurable-container-update-tick-rate.patch @@ -0,0 +1,52 @@ +From fa4981a0ce83d10645859aacfcfb1ce509f44f15 Mon Sep 17 00:00:00 2001 +From: Sudzzy +Date: Thu, 23 Jul 2015 22:05:22 -0700 +Subject: [PATCH] Configurable container update tick rate + + +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index baa08c9..a389819 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -65,6 +65,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + // Spigot start + public boolean collidesWithEntities = true; + public int viewDistance; // PaperSpigot - Player view distance API ++ private int containerUpdateDelay; // PaperSpigot + + @Override + public boolean ad() +@@ -197,8 +198,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + if (this.noDamageTicks > 0) { + --this.noDamageTicks; + } +- +- this.activeContainer.b(); ++ ++ // PaperSpigot start - Configurable container update tick rate ++ if (--containerUpdateDelay <= 0) { ++ this.activeContainer.b(); ++ containerUpdateDelay = world.paperSpigotConfig.containerUpdateTickRate; ++ } ++ // PaperSpigot end + if (!this.world.isClientSide && !this.activeContainer.a((EntityHuman) this)) { + this.closeInventory(); + this.activeContainer = this.defaultContainer; +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +index cde11b2..bd1b363 100644 +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -396,4 +396,10 @@ public class PaperSpigotWorldConfig + { + cacheChunkMaps = getBoolean( "cache-chunk-maps", false ); + } ++ ++ public int containerUpdateTickRate; ++ private void containerUpdateTickRate() ++ { ++ containerUpdateTickRate = getInt("container-update-tick-rate", 1); ++ } + } +-- +1.9.5.msysgit.1 +