4242import java .util .stream .Collectors ;
4343
4444/**
45- * Represents an effect an {@link ItemStack} can apply after some actions .
45+ * Represents an action an {@link ItemStack} can apply to {@link Living} in different circumstances .
4646 *
47- * @see Keys#CONSUME_EFFECTS
48- * @see Keys#DEATH_PROTECTION_EFFECTS
47+ * @see Keys#CONSUME_ACTIONS
48+ * @see Keys#DEATH_PROTECTION_ACTIONS
4949 */
50- public interface ItemActionEffect {
50+ public interface ItemAction {
5151
5252 static ApplyEffects applyEffects (final Collection <PotionEffect > effects ) {
53- return ItemActionEffect .applyEffects (1.0D , effects );
53+ return ItemAction .applyEffects (1.0D , effects );
5454 }
5555
5656 static ApplyEffects applyEffects (final PotionEffect ... effects ) {
57- return ItemActionEffect .applyEffects (1.0D , effects );
57+ return ItemAction .applyEffects (1.0D , effects );
5858 }
5959
6060 static ApplyEffects applyEffects (final double chance , final Collection <PotionEffect > effects ) {
61- return ItemActionEffect .factory ().applyEffects (chance , List .copyOf (effects ));
61+ return ItemAction .factory ().applyEffects (chance , List .copyOf (effects ));
6262 }
6363
6464 static ApplyEffects applyEffects (final double chance , final PotionEffect ... effects ) {
65- return ItemActionEffect .factory ().applyEffects (chance , List .of (effects ));
65+ return ItemAction .factory ().applyEffects (chance , List .of (effects ));
6666 }
6767
6868 static RemoveEffects removeEffects (final Collection <PotionEffectType > effectTypes ) {
69- return ItemActionEffect .factory ().removeEffects (Set .copyOf (effectTypes ));
69+ return ItemAction .factory ().removeEffects (Set .copyOf (effectTypes ));
7070 }
7171
7272 static RemoveEffects removeEffects (final PotionEffectType ... effectTypes ) {
73- return ItemActionEffect .factory ().removeEffects (Set .of (effectTypes ));
73+ return ItemAction .factory ().removeEffects (Set .of (effectTypes ));
7474 }
7575
7676 @ SafeVarargs
7777 static RemoveEffects removeEffects (final Supplier <PotionEffectType >... effectTypes ) {
78- return ItemActionEffect .factory ().removeEffects (Arrays .stream (effectTypes ).map (Supplier ::get ).collect (Collectors .toSet ()));
78+ return ItemAction .factory ().removeEffects (Arrays .stream (effectTypes ).map (Supplier ::get ).collect (Collectors .toSet ()));
7979 }
8080
8181 static RemoveEffects removeEffects (final Tag <PotionEffectType > effectTypeTag ) {
82- return ItemActionEffect .factory ().removeEffects (effectTypeTag );
82+ return ItemAction .factory ().removeEffects (effectTypeTag );
8383 }
8484
8585 static ClearEffects clearEffects () {
86- return ItemActionEffect .factory ().clearEffects ();
86+ return ItemAction .factory ().clearEffects ();
8787 }
8888
8989 static PlaySound playSound (final SoundType soundType ) {
90- return ItemActionEffect .factory ().playSound (soundType );
90+ return ItemAction .factory ().playSound (soundType );
9191 }
9292
9393 static PlaySound playSound (final Supplier <SoundType > soundType ) {
94- return ItemActionEffect .factory ().playSound (soundType .get ());
94+ return ItemAction .factory ().playSound (soundType .get ());
9595 }
9696
9797 static TeleportRandomly teleportRandomly (final double distance ) {
98- return ItemActionEffect .factory ().teleportRandomly (distance );
98+ return ItemAction .factory ().teleportRandomly (distance );
9999 }
100100
101101 private static Factory factory () {
@@ -106,7 +106,7 @@ private static Factory factory() {
106106 * Returns the type of this effect.
107107 * @return The type of this effect
108108 */
109- ItemActionEffectType type ();
109+ ItemActionType type ();
110110
111111 /**
112112 * Tries to apply this effect and returns whether it was successfully applied.
@@ -132,7 +132,7 @@ default boolean apply(final Living entity) {
132132 /**
133133 * Applies {@link PotionEffect}s with chance.
134134 */
135- interface ApplyEffects extends ItemActionEffect {
135+ interface ApplyEffects extends ItemAction {
136136 /**
137137 * Returns the probability for effects to be applied.
138138 * @return The probability for effects to be applied
@@ -149,7 +149,7 @@ interface ApplyEffects extends ItemActionEffect {
149149 /**
150150 * Removes {@link PotionEffect}s with matching {@link PotionEffectType}s.
151151 */
152- interface RemoveEffects extends ItemActionEffect {
152+ interface RemoveEffects extends ItemAction {
153153 /**
154154 * Returns {@link PotionEffectType}s that will be removed.
155155 * @return {@link PotionEffectType}s that will be removed
@@ -160,13 +160,13 @@ interface RemoveEffects extends ItemActionEffect {
160160 /**
161161 * Clears all {@link PotionEffect}s.
162162 */
163- interface ClearEffects extends ItemActionEffect {
163+ interface ClearEffects extends ItemAction {
164164 }
165165
166166 /**
167167 * Plays {@link SoundType}.
168168 */
169- interface PlaySound extends ItemActionEffect {
169+ interface PlaySound extends ItemAction {
170170 /**
171171 * Returns the consumption {@link SoundType}.
172172 * @return The consumption {@link SoundType}
@@ -177,7 +177,7 @@ interface PlaySound extends ItemActionEffect {
177177 /**
178178 * Teleports randomly within maximum distance.
179179 */
180- interface TeleportRandomly extends ItemActionEffect {
180+ interface TeleportRandomly extends ItemAction {
181181 /**
182182 * Returns the maximum distance entity can be teleported.
183183 * @return The maximum distance entity can be teleported
0 commit comments