mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 00:20:44 +01:00
31 lines
1.4 KiB
Diff
31 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: vicisacat <victor.branchu@gmail.com>
|
|
Date: Fri, 15 Mar 2024 17:35:40 +0100
|
|
Subject: [PATCH] Expanded Hopper API
|
|
|
|
== AT ==
|
|
public net.minecraft.world.level.block.entity.HopperBlockEntity setCooldown(I)V
|
|
public net.minecraft.world.level.block.entity.HopperBlockEntity cooldownTime
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java b/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
|
|
@@ -0,0 +0,0 @@ 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
|
|
}
|