2013-12-02 23:05:49 +01:00
|
|
|
From 8a1d964f7cb36ae4498be6c3c3335001bfec5bff Mon Sep 17 00:00:00 2001
|
2013-09-09 06:40:16 +02:00
|
|
|
From: erocs <github@erocs.org>
|
|
|
|
Date: Sun, 8 Sep 2013 12:06:15 -0700
|
2013-06-20 11:44:06 +02:00
|
|
|
Subject: [PATCH] Hopper Cooldowns
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
2013-12-01 06:00:50 +01:00
|
|
|
index 730eb78..a68b748 100644
|
2013-06-20 11:44:06 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
2013-09-09 06:40:16 +02:00
|
|
|
@@ -182,12 +182,17 @@ public class TileEntityHopper extends TileEntity implements IHopper {
|
2013-06-20 11:44:06 +02:00
|
|
|
|
2013-07-02 05:03:56 +02:00
|
|
|
flag = suckInItems(this) || flag;
|
2013-06-20 11:44:06 +02:00
|
|
|
if (flag) {
|
|
|
|
- this.c(8);
|
|
|
|
+ this.c(world.spigotConfig.hopperTransfer); // Spigot
|
|
|
|
this.update();
|
|
|
|
return true;
|
|
|
|
}
|
2013-09-09 06:40:16 +02:00
|
|
|
}
|
|
|
|
-
|
|
|
|
+ // Spigot start
|
2013-12-01 06:00:50 +01:00
|
|
|
+ if ( !this.j() )
|
2013-09-09 06:40:16 +02:00
|
|
|
+ {
|
|
|
|
+ this.c( world.spigotConfig.hopperCheck );
|
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
@@ -218,7 +223,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
|
2013-06-20 11:44:06 +02:00
|
|
|
this.getWorld().getServer().getPluginManager().callEvent(event);
|
|
|
|
if (event.isCancelled()) {
|
|
|
|
this.setItem(i, itemstack);
|
|
|
|
- this.c(8); // Delay hopper checks
|
|
|
|
+ this.c(world.spigotConfig.hopperTransfer); // Spigot
|
|
|
|
return false;
|
|
|
|
}
|
2013-12-01 04:40:53 +01:00
|
|
|
ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), Facing.OPPOSITE_FACING[BlockHopper.b(this.p())]);
|
2013-09-09 06:40:16 +02:00
|
|
|
@@ -299,9 +304,9 @@ public class TileEntityHopper extends TileEntity implements IHopper {
|
2013-06-20 11:44:06 +02:00
|
|
|
iinventory.setItem(i, itemstack1);
|
|
|
|
|
|
|
|
if (ihopper instanceof TileEntityHopper) {
|
|
|
|
- ((TileEntityHopper) ihopper).c(8); // Delay hopper checks
|
|
|
|
+ ((TileEntityHopper) ihopper).c(ihopper.getWorld().spigotConfig.hopperTransfer); // Spigot
|
|
|
|
} else if (ihopper instanceof EntityMinecartHopper) {
|
2013-07-02 05:03:56 +02:00
|
|
|
- ((EntityMinecartHopper) ihopper).l(4); // Delay hopper minecart checks
|
2013-07-02 05:45:51 +02:00
|
|
|
+ ((EntityMinecartHopper) ihopper).l(ihopper.getWorld().spigotConfig.hopperTransfer / 2); // Spigot
|
2013-06-20 11:44:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2013-09-09 06:40:16 +02:00
|
|
|
@@ -405,7 +410,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
|
2013-06-20 11:44:06 +02:00
|
|
|
|
|
|
|
if (flag) {
|
|
|
|
if (iinventory instanceof TileEntityHopper) {
|
|
|
|
- ((TileEntityHopper) iinventory).c(8);
|
|
|
|
+ ((TileEntityHopper) iinventory).c(((TileEntityHopper) iinventory).world.spigotConfig.hopperTransfer); // Spigot
|
2013-07-02 05:03:56 +02:00
|
|
|
iinventory.update();
|
2013-06-20 11:44:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2013-12-02 23:05:49 +01:00
|
|
|
index d6e8433..4e4db0a 100644
|
2013-06-20 11:44:06 +02:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2013-12-02 23:05:49 +01:00
|
|
|
@@ -186,4 +186,17 @@ public class SpigotWorldConfig
|
2013-06-20 11:44:06 +02:00
|
|
|
maxTrackingRange = getInt( "entity-tracking-range.other", maxTrackingRange );
|
|
|
|
log( "Entity Tracking Range: Pl " + playerTrackingRange + " / An " + animalTrackingRange + " / Mo " + monsterTrackingRange + " / Mi " + miscTrackingRange + " / Other " + maxTrackingRange );
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public int hopperTransfer = 8;
|
2013-09-09 06:40:16 +02:00
|
|
|
+ public int hopperCheck = 8;
|
2013-06-20 11:44:06 +02:00
|
|
|
+ private void hoppers()
|
|
|
|
+ {
|
2013-09-09 06:40:16 +02:00
|
|
|
+ // Set the tick delay between hopper item movements
|
2013-06-20 11:44:06 +02:00
|
|
|
+ hopperTransfer = getInt( "ticks-per.hopper-transfer", hopperTransfer );
|
2013-09-09 06:40:16 +02:00
|
|
|
+ // Set the tick delay between checking for items after the associated
|
|
|
|
+ // container is empty. Default to the hopperTransfer value to prevent
|
|
|
|
+ // hopper sorting machines from becoming out of sync.
|
|
|
|
+ hopperCheck = getInt( "ticks-per.hopper-check", hopperTransfer );
|
|
|
|
+ log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck );
|
2013-06-20 11:44:06 +02:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2013-12-01 04:40:53 +01:00
|
|
|
1.8.3.2
|
2013-06-20 11:44:06 +02:00
|
|
|
|