3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 13:00:06 +01:00

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.
Dieser Commit ist enthalten in:
Travis Watkins 2013-04-12 14:46:16 -05:00 committet von Wesley Wolfe
Ursprung 5cc4fbd712
Commit 8590492680

Datei anzeigen

@ -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;
}