PaperMC/paper-server/patches/sources/net/minecraft/world/item/ItemCooldowns.java.patch
2020-08-25 13:48:33 +02:00

16 lines
662 B
Diff

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