44
44
/**
45
45
* Represents an effect that can be applied on {@link ItemStack} consumption.
46
46
*/
47
- public interface ConsumeEffect {
47
+ public interface ItemActionEffect {
48
48
49
49
static ApplyEffects applyEffects (final Collection <PotionEffect > effects ) {
50
- return ConsumeEffect .applyEffects (1.0D , effects );
50
+ return ItemActionEffect .applyEffects (1.0D , effects );
51
51
}
52
52
53
53
static ApplyEffects applyEffects (final PotionEffect ... effects ) {
54
- return ConsumeEffect .applyEffects (1.0D , effects );
54
+ return ItemActionEffect .applyEffects (1.0D , effects );
55
55
}
56
56
57
57
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 ));
59
59
}
60
60
61
61
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 ));
63
63
}
64
64
65
65
static RemoveEffects removeEffects (final Collection <PotionEffectType > effectTypes ) {
66
- return ConsumeEffect .factory ().removeEffects (Set .copyOf (effectTypes ));
66
+ return ItemActionEffect .factory ().removeEffects (Set .copyOf (effectTypes ));
67
67
}
68
68
69
69
static RemoveEffects removeEffects (final PotionEffectType ... effectTypes ) {
70
- return ConsumeEffect .factory ().removeEffects (Set .of (effectTypes ));
70
+ return ItemActionEffect .factory ().removeEffects (Set .of (effectTypes ));
71
71
}
72
72
73
73
@ SafeVarargs
74
74
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 ()));
76
76
}
77
77
78
78
static RemoveEffects removeEffects (final Tag <PotionEffectType > effectTypeTag ) {
79
- return ConsumeEffect .factory ().removeEffects (effectTypeTag );
79
+ return ItemActionEffect .factory ().removeEffects (effectTypeTag );
80
80
}
81
81
82
82
static ClearEffects clearEffects () {
83
- return ConsumeEffect .factory ().clearEffects ();
83
+ return ItemActionEffect .factory ().clearEffects ();
84
84
}
85
85
86
86
static PlaySound playSound (final SoundType soundType ) {
87
- return ConsumeEffect .factory ().playSound (soundType );
87
+ return ItemActionEffect .factory ().playSound (soundType );
88
88
}
89
89
90
90
static PlaySound playSound (final Supplier <SoundType > soundType ) {
91
- return ConsumeEffect .factory ().playSound (soundType .get ());
91
+ return ItemActionEffect .factory ().playSound (soundType .get ());
92
92
}
93
93
94
94
static TeleportRandomly teleportRandomly (final double distance ) {
95
- return ConsumeEffect .factory ().teleportRandomly (distance );
95
+ return ItemActionEffect .factory ().teleportRandomly (distance );
96
96
}
97
97
98
98
private static Factory factory () {
@@ -103,7 +103,7 @@ private static Factory factory() {
103
103
* Returns the type of this effect.
104
104
* @return The type of this effect
105
105
*/
106
- ConsumeEffectType type ();
106
+ ItemActionEffectType type ();
107
107
108
108
/**
109
109
* Tries to apply this effect and returns whether it was successfully applied.
@@ -154,7 +154,7 @@ default boolean apply(final Living entity) {
154
154
/**
155
155
* Applies {@link PotionEffect}s with chance.
156
156
*/
157
- interface ApplyEffects extends ConsumeEffect {
157
+ interface ApplyEffects extends ItemActionEffect {
158
158
/**
159
159
* Returns the probability for effects to be applied.
160
160
* @return The probability for effects to be applied
@@ -171,7 +171,7 @@ interface ApplyEffects extends ConsumeEffect {
171
171
/**
172
172
* Removes {@link PotionEffect}s with matching {@link PotionEffectType}s.
173
173
*/
174
- interface RemoveEffects extends ConsumeEffect {
174
+ interface RemoveEffects extends ItemActionEffect {
175
175
/**
176
176
* Returns {@link PotionEffectType}s that will be removed.
177
177
* @return {@link PotionEffectType}s that will be removed
@@ -182,13 +182,13 @@ interface RemoveEffects extends ConsumeEffect {
182
182
/**
183
183
* Clears all {@link PotionEffect}s.
184
184
*/
185
- interface ClearEffects extends ConsumeEffect {
185
+ interface ClearEffects extends ItemActionEffect {
186
186
}
187
187
188
188
/**
189
189
* Plays {@link SoundType}.
190
190
*/
191
- interface PlaySound extends ConsumeEffect {
191
+ interface PlaySound extends ItemActionEffect {
192
192
/**
193
193
* Returns the consumption {@link SoundType}.
194
194
* @return The consumption {@link SoundType}
@@ -199,7 +199,7 @@ interface PlaySound extends ConsumeEffect {
199
199
/**
200
200
* Teleports randomly within maximum distance.
201
201
*/
202
- interface TeleportRandomly extends ConsumeEffect {
202
+ interface TeleportRandomly extends ItemActionEffect {
203
203
/**
204
204
* Returns the maximum distance entity can be teleported.
205
205
* @return The maximum distance entity can be teleported
0 commit comments