Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 12:30: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:
Ursprung
5cc4fbd712
Commit
8590492680
@ -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;
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren