2013-08-25 02:24:14 +00:00
|
|
|
From d80ca00523b48852557354d86428b0263ae7b143 Mon Sep 17 00:00:00 2001
|
2013-06-20 09:44:06 +00:00
|
|
|
From: DerFlash <bte@freenet.de>
|
|
|
|
Date: Sun, 2 Jun 2013 16:23:46 +1000
|
|
|
|
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-08-25 02:22:37 +00:00
|
|
|
index e8cd525..d406fbd 100644
|
2013-06-20 09:44:06 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
2013-08-25 02:22:37 +00:00
|
|
|
@@ -182,7 +182,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
|
2013-06-20 09:44:06 +00:00
|
|
|
|
2013-07-02 03:03:56 +00:00
|
|
|
flag = suckInItems(this) || flag;
|
2013-06-20 09:44:06 +00:00
|
|
|
if (flag) {
|
|
|
|
- this.c(8);
|
|
|
|
+ this.c(world.spigotConfig.hopperTransfer); // Spigot
|
|
|
|
this.update();
|
|
|
|
return true;
|
|
|
|
}
|
2013-08-25 02:22:37 +00:00
|
|
|
@@ -218,7 +218,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
|
2013-06-20 09:44:06 +00: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;
|
|
|
|
}
|
|
|
|
ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), Facing.OPPOSITE_FACING[BlockHopper.c(this.p())]);
|
2013-08-25 02:22:37 +00:00
|
|
|
@@ -299,9 +299,9 @@ public class TileEntityHopper extends TileEntity implements IHopper {
|
2013-06-20 09:44:06 +00: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 03:03:56 +00:00
|
|
|
- ((EntityMinecartHopper) ihopper).l(4); // Delay hopper minecart checks
|
2013-07-02 03:45:51 +00:00
|
|
|
+ ((EntityMinecartHopper) ihopper).l(ihopper.getWorld().spigotConfig.hopperTransfer / 2); // Spigot
|
2013-06-20 09:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2013-08-25 02:22:37 +00:00
|
|
|
@@ -405,7 +405,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
|
2013-06-20 09:44:06 +00:00
|
|
|
|
|
|
|
if (flag) {
|
|
|
|
if (iinventory instanceof TileEntityHopper) {
|
|
|
|
- ((TileEntityHopper) iinventory).c(8);
|
|
|
|
+ ((TileEntityHopper) iinventory).c(((TileEntityHopper) iinventory).world.spigotConfig.hopperTransfer); // Spigot
|
2013-07-02 03:03:56 +00:00
|
|
|
iinventory.update();
|
2013-06-20 09:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2013-08-25 02:24:14 +00:00
|
|
|
index 8ef6c6a..e98ac1d 100644
|
2013-06-20 09:44:06 +00:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2013-08-25 02:24:14 +00:00
|
|
|
@@ -187,4 +187,11 @@ public class SpigotWorldConfig
|
2013-06-20 09:44:06 +00: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;
|
|
|
|
+ private void hoppers()
|
|
|
|
+ {
|
|
|
|
+ hopperTransfer = getInt( "ticks-per.hopper-transfer", hopperTransfer );
|
2013-08-25 02:24:14 +00:00
|
|
|
+ log( "Hopper Transfer: " + hopperTransfer );
|
2013-06-20 09:44:06 +00:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
|
|
|
1.8.1.2
|
|
|
|
|