Re add hopper checks

This commit is contained in:
erocs 2013-09-09 14:40:16 +10:00 committed by md_5
parent 378fc7a71f
commit f4367af8f5
2 changed files with 33 additions and 16 deletions

View File

@ -1,14 +1,14 @@
From d80ca00523b48852557354d86428b0263ae7b143 Mon Sep 17 00:00:00 2001 From 5eb857158aa0a6114412d88e26a3434b2b556d7e Mon Sep 17 00:00:00 2001
From: DerFlash <bte@freenet.de> From: erocs <github@erocs.org>
Date: Sun, 2 Jun 2013 16:23:46 +1000 Date: Sun, 8 Sep 2013 12:06:15 -0700
Subject: [PATCH] Hopper Cooldowns Subject: [PATCH] Hopper Cooldowns
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index e8cd525..d406fbd 100644 index e8cd525..5793b5c 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java --- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -182,7 +182,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { @@ -182,12 +182,17 @@ public class TileEntityHopper extends TileEntity implements IHopper {
flag = suckInItems(this) || flag; flag = suckInItems(this) || flag;
if (flag) { if (flag) {
@ -17,7 +17,18 @@ index e8cd525..d406fbd 100644
this.update(); this.update();
return true; return true;
} }
@@ -218,7 +218,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { }
-
+ // Spigot start
+ if ( !this.l() )
+ {
+ this.c( world.spigotConfig.hopperCheck );
+ }
+ // Spigot end
return false;
} else {
return false;
@@ -218,7 +223,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
this.getWorld().getServer().getPluginManager().callEvent(event); this.getWorld().getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
this.setItem(i, itemstack); this.setItem(i, itemstack);
@ -26,7 +37,7 @@ index e8cd525..d406fbd 100644
return false; return false;
} }
ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), Facing.OPPOSITE_FACING[BlockHopper.c(this.p())]); ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), Facing.OPPOSITE_FACING[BlockHopper.c(this.p())]);
@@ -299,9 +299,9 @@ public class TileEntityHopper extends TileEntity implements IHopper { @@ -299,9 +304,9 @@ public class TileEntityHopper extends TileEntity implements IHopper {
iinventory.setItem(i, itemstack1); iinventory.setItem(i, itemstack1);
if (ihopper instanceof TileEntityHopper) { if (ihopper instanceof TileEntityHopper) {
@ -38,7 +49,7 @@ index e8cd525..d406fbd 100644
} }
return false; return false;
@@ -405,7 +405,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { @@ -405,7 +410,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
if (flag) { if (flag) {
if (iinventory instanceof TileEntityHopper) { if (iinventory instanceof TileEntityHopper) {
@ -48,19 +59,25 @@ index e8cd525..d406fbd 100644
} }
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 8ef6c6a..e98ac1d 100644 index 8ef6c6a..b63d3ad 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -187,4 +187,11 @@ public class SpigotWorldConfig @@ -187,4 +187,17 @@ public class SpigotWorldConfig
maxTrackingRange = getInt( "entity-tracking-range.other", maxTrackingRange ); maxTrackingRange = getInt( "entity-tracking-range.other", maxTrackingRange );
log( "Entity Tracking Range: Pl " + playerTrackingRange + " / An " + animalTrackingRange + " / Mo " + monsterTrackingRange + " / Mi " + miscTrackingRange + " / Other " + maxTrackingRange ); log( "Entity Tracking Range: Pl " + playerTrackingRange + " / An " + animalTrackingRange + " / Mo " + monsterTrackingRange + " / Mi " + miscTrackingRange + " / Other " + maxTrackingRange );
} }
+ +
+ public int hopperTransfer = 8; + public int hopperTransfer = 8;
+ public int hopperCheck = 8;
+ private void hoppers() + private void hoppers()
+ { + {
+ // Set the tick delay between hopper item movements
+ hopperTransfer = getInt( "ticks-per.hopper-transfer", hopperTransfer ); + hopperTransfer = getInt( "ticks-per.hopper-transfer", hopperTransfer );
+ log( "Hopper Transfer: " + hopperTransfer ); + // 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 );
+ } + }
} }
-- --

View File

@ -1,4 +1,4 @@
From f0961786f74fae30622858a9590bceb7f926d7ff Mon Sep 17 00:00:00 2001 From fd3eff3029737a3cd8ef22f73e64402a412f3119 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sat, 22 Jun 2013 16:12:02 +1000 Date: Sat, 22 Jun 2013 16:12:02 +1000
Subject: [PATCH] Allow Disabling of Random Lighting Updates Subject: [PATCH] Allow Disabling of Random Lighting Updates
@ -18,12 +18,12 @@ index 211127b..8bd7876 100644
entityhuman = (EntityHuman) this.players.get(i); entityhuman = (EntityHuman) this.players.get(i);
j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5; j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index e98ac1d..13a5a33 100644 index b63d3ad..2caafa2 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -194,4 +194,11 @@ public class SpigotWorldConfig @@ -200,4 +200,11 @@ public class SpigotWorldConfig
hopperTransfer = getInt( "ticks-per.hopper-transfer", hopperTransfer ); hopperCheck = getInt( "ticks-per.hopper-check", hopperTransfer );
log( "Hopper Transfer: " + hopperTransfer ); log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck );
} }
+ +
+ public boolean randomLightUpdates; + public boolean randomLightUpdates;