4444/**
4545 * Represents an effect that can be applied on {@link ItemStack} consumption.
4646 */
47- public interface ConsumeEffect {
47+ public interface ItemActionEffect {
4848
4949 static ApplyEffects applyEffects (final Collection <PotionEffect > effects ) {
50- return ConsumeEffect .applyEffects (1.0D , effects );
50+ return ItemActionEffect .applyEffects (1.0D , effects );
5151 }
5252
5353 static ApplyEffects applyEffects (final PotionEffect ... effects ) {
54- return ConsumeEffect .applyEffects (1.0D , effects );
54+ return ItemActionEffect .applyEffects (1.0D , effects );
5555 }
5656
5757 static ApplyEffects applyEffects (final double chance , final Collection <PotionEffect > effects ) {
58- return ConsumeEffect .factory ().applyEffects (chance , List .copyOf (effects ));
58+ return ItemActionEffect .factory ().applyEffects (chance , List .copyOf (effects ));
5959 }
6060
6161 static ApplyEffects applyEffects (final double chance , final PotionEffect ... effects ) {
62- return ConsumeEffect .factory ().applyEffects (chance , List .of (effects ));
62+ return ItemActionEffect .factory ().applyEffects (chance , List .of (effects ));
6363 }
6464
6565 static RemoveEffects removeEffects (final Collection <PotionEffectType > effectTypes ) {
66- return ConsumeEffect .factory ().removeEffects (Set .copyOf (effectTypes ));
66+ return ItemActionEffect .factory ().removeEffects (Set .copyOf (effectTypes ));
6767 }
6868
6969 static RemoveEffects removeEffects (final PotionEffectType ... effectTypes ) {
70- return ConsumeEffect .factory ().removeEffects (Set .of (effectTypes ));
70+ return ItemActionEffect .factory ().removeEffects (Set .of (effectTypes ));
7171 }
7272
7373 @ SafeVarargs
7474 static RemoveEffects removeEffects (final Supplier <PotionEffectType >... effectTypes ) {
75- return ConsumeEffect .factory ().removeEffects (Arrays .stream (effectTypes ).map (Supplier ::get ).collect (Collectors .toSet ()));
75+ return ItemActionEffect .factory ().removeEffects (Arrays .stream (effectTypes ).map (Supplier ::get ).collect (Collectors .toSet ()));
7676 }
7777
7878 static RemoveEffects removeEffects (final Tag <PotionEffectType > effectTypeTag ) {
79- return ConsumeEffect .factory ().removeEffects (effectTypeTag );
79+ return ItemActionEffect .factory ().removeEffects (effectTypeTag );
8080 }
8181
8282 static ClearEffects clearEffects () {
83- return ConsumeEffect .factory ().clearEffects ();
83+ return ItemActionEffect .factory ().clearEffects ();
8484 }
8585
8686 static PlaySound playSound (final SoundType soundType ) {
87- return ConsumeEffect .factory ().playSound (soundType );
87+ return ItemActionEffect .factory ().playSound (soundType );
8888 }
8989
9090 static PlaySound playSound (final Supplier <SoundType > soundType ) {
91- return ConsumeEffect .factory ().playSound (soundType .get ());
91+ return ItemActionEffect .factory ().playSound (soundType .get ());
9292 }
9393
9494 static TeleportRandomly teleportRandomly (final double distance ) {
95- return ConsumeEffect .factory ().teleportRandomly (distance );
95+ return ItemActionEffect .factory ().teleportRandomly (distance );
9696 }
9797
9898 private static Factory factory () {
@@ -103,7 +103,7 @@ private static Factory factory() {
103103 * Returns the type of this effect.
104104 * @return The type of this effect
105105 */
106- ConsumeEffectType type ();
106+ ItemActionEffectType type ();
107107
108108 /**
109109 * Tries to apply this effect and returns whether it was successfully applied.
@@ -154,7 +154,7 @@ default boolean apply(final Living entity) {
154154 /**
155155 * Applies {@link PotionEffect}s with chance.
156156 */
157- interface ApplyEffects extends ConsumeEffect {
157+ interface ApplyEffects extends ItemActionEffect {
158158 /**
159159 * Returns the probability for effects to be applied.
160160 * @return The probability for effects to be applied
@@ -171,7 +171,7 @@ interface ApplyEffects extends ConsumeEffect {
171171 /**
172172 * Removes {@link PotionEffect}s with matching {@link PotionEffectType}s.
173173 */
174- interface RemoveEffects extends ConsumeEffect {
174+ interface RemoveEffects extends ItemActionEffect {
175175 /**
176176 * Returns {@link PotionEffectType}s that will be removed.
177177 * @return {@link PotionEffectType}s that will be removed
@@ -182,13 +182,13 @@ interface RemoveEffects extends ConsumeEffect {
182182 /**
183183 * Clears all {@link PotionEffect}s.
184184 */
185- interface ClearEffects extends ConsumeEffect {
185+ interface ClearEffects extends ItemActionEffect {
186186 }
187187
188188 /**
189189 * Plays {@link SoundType}.
190190 */
191- interface PlaySound extends ConsumeEffect {
191+ interface PlaySound extends ItemActionEffect {
192192 /**
193193 * Returns the consumption {@link SoundType}.
194194 * @return The consumption {@link SoundType}
@@ -199,7 +199,7 @@ interface PlaySound extends ConsumeEffect {
199199 /**
200200 * Teleports randomly within maximum distance.
201201 */
202- interface TeleportRandomly extends ConsumeEffect {
202+ interface TeleportRandomly extends ItemActionEffect {
203203 /**
204204 * Returns the maximum distance entity can be teleported.
205205 * @return The maximum distance entity can be teleported
0 commit comments