aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0933-Expanded-Hopper-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0933-Expanded-Hopper-API.patch')
-rw-r--r--patches/server/0933-Expanded-Hopper-API.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/patches/server/0933-Expanded-Hopper-API.patch b/patches/server/0933-Expanded-Hopper-API.patch
new file mode 100644
index 0000000000..2b59ac9974
--- /dev/null
+++ b/patches/server/0933-Expanded-Hopper-API.patch
@@ -0,0 +1,31 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: vicisacat <[email protected]>
+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 2995b407415c77288a54c3f4eb8cb93e1a289283..f3c4d3835a18475e2cd2f519ac3dd9d9b59c454d 100644
+--- a/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
+@@ -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
+ }