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:
vicisacat 2024-03-15 17:35:40 +01:00
parent 61c73ee83e
commit 93c49bbe31

View file

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