mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
Expanded Hopper API
== AT == public net.minecraft.world.level.block.entity.HopperBlockEntity setCooldown(I)V public net.minecraft.world.level.block.entity.HopperBlockEntity cooldownTime
This commit is contained in:
parent
61c73ee83e
commit
93c49bbe31
1 changed files with 13 additions and 0 deletions
|
@ -40,4 +40,17 @@ public class CraftHopper extends CraftLootable<HopperBlockEntity> implements Hop
|
|||
public CraftHopper copy(Location location) {
|
||||
return new CraftHopper(this, location);
|
||||
}
|
||||
|
||||
// Paper start - Expanded Hopper API
|
||||
@Override
|
||||
public void setTransferCooldown(final int cooldown) {
|
||||
com.google.common.base.Preconditions.checkArgument(cooldown >= 0, "Hooper transfer cooldown cannot be negative (" + cooldown + ")");
|
||||
getSnapshot().setCooldown(cooldown);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferCooldown() {
|
||||
return getSnapshot().cooldownTime;
|
||||
}
|
||||
// Paper end - Expanded Hopper API
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue