PaperMC/paper-server/patches/sources/net/minecraft/world/item/ItemCooldowns.java.patch

17 lines
651 B
Diff
Raw Normal View History

2024-12-14 12:50:20 -08:00
--- a/net/minecraft/world/item/ItemCooldowns.java
+++ b/net/minecraft/world/item/ItemCooldowns.java
@@ -56,6 +_,13 @@
}
public void addCooldown(ResourceLocation group, int cooldown) {
+ // Paper start - Item cooldown events
+ this.addCooldown(group, cooldown, true);
+ }
+
+ public void addCooldown(ResourceLocation group, int cooldown, boolean callEvent) {
+ // Event called in server override
+ // Paper end - Item cooldown events
this.cooldowns.put(group, new ItemCooldowns.CooldownInstance(this.tickCount, this.tickCount + cooldown));
this.onCooldownStarted(group, cooldown);
}