2015-09-19 16:34:17 +02:00
|
|
|
From b3648456c35595d816fc03a27dee08070d9414ef Mon Sep 17 00:00:00 2001
|
2015-07-24 07:06:57 +02:00
|
|
|
From: Sudzzy <originmc@outlook.com>
|
|
|
|
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
|
2015-09-13 02:57:39 +02:00
|
|
|
index 3e4869b..0c49a25 100644
|
2015-07-24 07:06:57 +02:00
|
|
|
--- 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
|
2015-09-13 02:57:39 +02:00
|
|
|
index 49104ff..84cdb12 100644
|
2015-07-24 07:06:57 +02:00
|
|
|
--- 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()
|
|
|
|
+ {
|
2015-08-05 02:47:57 +02:00
|
|
|
+ containerUpdateTickRate = getInt( "container-update-tick-rate", 1 );
|
2015-07-24 07:06:57 +02:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2015-09-13 06:29:23 +02:00
|
|
|
2.5.2
|
2015-07-24 07:06:57 +02:00
|
|
|
|