Paper/patches/api/0452-Expanded-Hopper-API.patch
Bjarne Koll e1c0033552
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
2b4b6d14 PR-1023: Convert InventoryView to interface

CraftBukkit Changes:
68603b1c1 Use expanded interaction ranges for traced interact events
eae9f760c PR-1414: Convert InventoryView to interface
ee9eafe67 Fix Implementation for DamageSource#isIndirect for internal custom causing entity
2024-06-16 17:23:42 +02:00

33 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: vicisacat <victor.branchu@gmail.com>
Date: Fri, 15 Mar 2024 17:35:18 +0100
Subject: [PATCH] Expanded Hopper API
diff --git a/src/main/java/org/bukkit/block/Hopper.java b/src/main/java/org/bukkit/block/Hopper.java
index 7ade312f180b7e30871d3a3240c76325cc369c26..61ea33c1f2dbb546a66f945a01feae437b1381e0 100644
--- a/src/main/java/org/bukkit/block/Hopper.java
+++ b/src/main/java/org/bukkit/block/Hopper.java
@@ -6,4 +6,20 @@ import org.bukkit.loot.Lootable;
/**
* Represents a captured state of a hopper.
*/
-public interface Hopper extends Container, LootableBlockInventory { } // Paper
+public interface Hopper extends Container, LootableBlockInventory { // Paper
+ // Paper start - Expanded Hopper API
+ /**
+ * Sets the cooldown before the hopper transfers or sucks in another item
+ * @param cooldown the cooldown in ticks
+ * @throws IllegalArgumentException if the passed cooldown value is negative.
+ */
+ void setTransferCooldown(@org.jetbrains.annotations.Range(from = 0, to = Integer.MAX_VALUE) int cooldown);
+
+ /**
+ * Returns the cooldown before the hopper transfers or sucks in another item
+ * @return the cooldown in ticks
+ */
+ int getTransferCooldown();
+ // Paper end - Expanded Hopper API
+}
+