|
100 | 100 | import org.spongepowered.api.data.value.MapValue; |
101 | 101 | import org.spongepowered.api.data.value.SetValue; |
102 | 102 | import org.spongepowered.api.data.value.Value; |
| 103 | +import org.spongepowered.api.data.value.ValueContainer; |
103 | 104 | import org.spongepowered.api.data.value.WeightedCollectionValue; |
104 | 105 | import org.spongepowered.api.effect.VanishState; |
105 | 106 | import org.spongepowered.api.effect.particle.ParticleEffect; |
|
185 | 186 | import org.spongepowered.api.entity.living.monster.spider.Spider; |
186 | 187 | import org.spongepowered.api.entity.living.monster.zombie.ZombieVillager; |
187 | 188 | import org.spongepowered.api.entity.living.monster.zombie.ZombifiedPiglin; |
| 189 | +import org.spongepowered.api.entity.living.player.CooldownTracker; |
188 | 190 | import org.spongepowered.api.entity.living.player.Player; |
189 | 191 | import org.spongepowered.api.entity.living.player.User; |
190 | 192 | import org.spongepowered.api.entity.living.player.chat.ChatVisibility; |
|
223 | 225 | import org.spongepowered.api.item.enchantment.EnchantmentTypes; |
224 | 226 | import org.spongepowered.api.item.inventory.Inventory; |
225 | 227 | import org.spongepowered.api.item.inventory.ItemStack; |
| 228 | +import org.spongepowered.api.item.inventory.ItemStackLike; |
226 | 229 | import org.spongepowered.api.item.inventory.ItemStackSnapshot; |
227 | 230 | import org.spongepowered.api.item.inventory.Slot; |
228 | 231 | import org.spongepowered.api.item.inventory.equipment.EquipmentType; |
|
239 | 242 | import org.spongepowered.api.projectile.source.ProjectileSource; |
240 | 243 | import org.spongepowered.api.raid.Raid; |
241 | 244 | import org.spongepowered.api.raid.RaidWave; |
| 245 | +import org.spongepowered.api.registry.DefaultedRegistryType; |
242 | 246 | import org.spongepowered.api.statistic.Statistic; |
243 | 247 | import org.spongepowered.api.tag.Tag; |
244 | 248 | import org.spongepowered.api.util.Axis; |
@@ -752,9 +756,24 @@ public final class Keys { |
752 | 756 | * The amount of ticks a {@link EndGateway} has to wait for the next teleportation. |
753 | 757 | * or |
754 | 758 | * The amount of ticks a {@link Crafter} has to wait for the next craft. |
| 759 | + * or |
| 760 | + * The amount of ticks an {@link ItemStack} has to wait before being used again, primarily in conjunction |
| 761 | + * with {@link #COOLDOWN_GROUP} in a joined {@link ValueContainer} to be offered as a custom cooldown. Using |
| 762 | + * a {@link DataManipulator#mutableOf( Iterable)} to set this value using {@link Value#mutableOf( Key, Object)} |
| 763 | + * to join together a group is ideal. |
755 | 764 | */ |
756 | 765 | public static final Key<Value<Ticks>> COOLDOWN = Keys.key(ResourceKey.sponge("cooldown"), Ticks.class); |
757 | 766 |
|
| 767 | + /** |
| 768 | + * The {@link ResourceKey group} of an {@link ItemStackLike ItemStack} that would apply a |
| 769 | + * cooldown to the item when used. Note that this affects the {@link CooldownTracker} when |
| 770 | + * a {@link Player} uses the item. Can be used in tandem with the {@link #COOLDOWN} key |
| 771 | + * to apply a cooldown to said group. A group will differentiate a cooldown from the default |
| 772 | + * {@link ItemStackLike ItemStack} cooldown based on the |
| 773 | + * {@link ItemType#key(DefaultedRegistryType) ResourceKey}. |
| 774 | + */ |
| 775 | + public static final Key<Value<ResourceKey>> COOLDOWN_GROUP = Keys.key(ResourceKey.sponge("cooldown_group"), ResourceKey.class); |
| 776 | + |
758 | 777 | /** |
759 | 778 | * The coordinate scale of a {@link WorldType} applied to the coordinates of a {@link ServerPlayer player} |
760 | 779 | * when traveling in between {@link ServerWorld worlds}. |
|
0 commit comments