PaperMC/paper-server/patches/sources/net/minecraft/world/item/ItemCooldowns.java.patch
2024-12-14 12:50:23 -08:00

16 lines
651 B
Diff

--- 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);
}