2424 */
2525package org .spongepowered .api .entity .living .player ;
2626
27+ import org .spongepowered .api .ResourceKey ;
2728import org .spongepowered .api .item .ItemType ;
29+ import org .spongepowered .api .item .inventory .ItemStack ;
2830import org .spongepowered .api .util .Ticks ;
2931
3032import java .util .Optional ;
@@ -42,7 +44,8 @@ public interface CooldownTracker {
4244 * @param type The item type to check is on cooldown
4345 * @return Whether or not the specified item type is cooldown
4446 */
45- boolean hasCooldown (ItemType type );
47+ boolean hasCooldown (ItemStack stack );
48+ boolean hasCooldown (ResourceKey group );
4649
4750 /**
4851 * Gets the cooldown of the specified {@link ItemType} in ticks for the
@@ -52,7 +55,8 @@ public interface CooldownTracker {
5255 * @return The cooldown remaining for this item type in ticks, if not
5356 * on cooldown
5457 */
55- Optional <Ticks > cooldown (ItemType type );
58+ Optional <Ticks > cooldown (ItemStack stack );
59+ Optional <Ticks > cooldown (ResourceKey group );
5660
5761 /**
5862 * Sets the cooldown for the specified {@link ItemType} for the
@@ -63,7 +67,8 @@ public interface CooldownTracker {
6367 * @return False if setting the cooldown failed, possibly due to the event
6468 * being cancelled
6569 */
66- boolean setCooldown (ItemType type , Ticks ticks );
70+ boolean setCooldown (ItemStack stack , Ticks ticks );
71+ boolean setCooldown (ResourceKey group , Ticks ticks );
6772
6873 /**
6974 * Resets the cooldown of the specified {@link ItemType} for the
@@ -73,7 +78,8 @@ public interface CooldownTracker {
7378 * @return False if setting the cooldown failed, possibly due to the event
7479 * being cancelled
7580 */
76- boolean resetCooldown (ItemType type );
81+ boolean resetCooldown (ItemStack stack );
82+ boolean resetCooldown (ResourceKey group );
7783
7884 /**
7985 * Gets the fraction of the specified {@link ItemType}'s cooldown that
@@ -85,6 +91,7 @@ public interface CooldownTracker {
8591 * @param type The item type to get the cooldown fraction remaining
8692 * @return The fraction of cooldown remaining for the specified item type
8793 */
88- OptionalDouble fractionRemaining (ItemType type );
94+ OptionalDouble fractionRemaining (ItemStack stack );
95+ OptionalDouble fractionRemaining (ResourceKey group );
8996
9097}
0 commit comments