diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-04-12 14:46:16 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-04-13 00:36:35 -0500 |
commit | 8590492680b58ca5aa3e5743052d4c3e0b4fab24 (patch) | |
tree | 11db139c11567ae4052d5c4124cd2ca22c3d03e7 /src/main | |
parent | 5cc4fbd712f1c81306b6cedcf9bbceb276d01ebd (diff) | |
download | craftbukkit-8590492680b58ca5aa3e5743052d4c3e0b4fab24.tar craftbukkit-8590492680b58ca5aa3e5743052d4c3e0b4fab24.tar.gz craftbukkit-8590492680b58ca5aa3e5743052d4c3e0b4fab24.tar.lz craftbukkit-8590492680b58ca5aa3e5743052d4c3e0b4fab24.tar.xz craftbukkit-8590492680b58ca5aa3e5743052d4c3e0b4fab24.zip |
Add delay to hopper even if it doesn't do anything. Fixes BUKKIT-4061
If a hopper is unable to perform any action during a tick it attempts to do
so every tick from then on. Once it is able to do so it then sets a delay
before attempting to do something again. To avoid excessive CPU usage for
hoppers sitting idle we now apply this delay regardless of the success of
the action.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/TileEntityHopper.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java index f6d269d6..faeafef5 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -180,8 +180,11 @@ public class TileEntityHopper extends TileEntity implements IHopper { if (!this.l() && BlockHopper.d(this.p())) { boolean flag = this.u() | suckInItems(this); + // CraftBukkit start - Move delay out of if block + this.c(8); + if (flag) { - this.c(8); + // CraftBukkit end this.update(); return true; } |