2021-06-12 21:30:37 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Tue, 5 Jun 2018 23:00:29 -0400
|
|
|
|
Subject: [PATCH] ItemStack#getMaxItemUseDuration
|
|
|
|
|
|
|
|
Allows you to determine how long it takes to use a usable/consumable item
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
2024-04-24 04:21:40 +02:00
|
|
|
index 09c363f483cb12be01afd9a274c541f3bdeb992c..a58e865a047550cc4508d0515cc6f2fc639f9b3d 100644
|
2021-06-12 21:30:37 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
2024-04-24 04:21:40 +02:00
|
|
|
@@ -187,6 +187,13 @@ public final class CraftItemStack extends ItemStack {
|
|
|
|
return (this.handle == null) ? Material.AIR.getMaxStackSize() : this.handle.getMaxStackSize();
|
2021-06-12 21:30:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public int getMaxItemUseDuration() {
|
|
|
|
+ return handle == null ? 0 : handle.getUseDuration();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public void addUnsafeEnchantment(Enchantment ench, int level) {
|
2023-06-13 01:51:45 +02:00
|
|
|
Preconditions.checkArgument(ench != null, "Enchantment cannot be null");
|