Skip to content

Commit 0b3188c

Browse files
committed
rename to ItemAction
1 parent e0debb6 commit 0b3188c

File tree

5 files changed

+43
-43
lines changed

5 files changed

+43
-43
lines changed

src/main/java/org/spongepowered/api/data/Keys.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
import org.spongepowered.api.data.type.HorseColor;
7171
import org.spongepowered.api.data.type.HorseStyle;
7272
import org.spongepowered.api.data.type.InstrumentType;
73-
import org.spongepowered.api.data.type.ItemActionEffect;
73+
import org.spongepowered.api.data.type.ItemAction;
7474
import org.spongepowered.api.data.type.ItemTier;
7575
import org.spongepowered.api.data.type.LlamaType;
7676
import org.spongepowered.api.data.type.MatterType;
@@ -774,9 +774,9 @@ public final class Keys {
774774
public static final Key<SetValue<Direction>> CONNECTED_DIRECTIONS = Keys.setKey(ResourceKey.sponge("connected_directions"), Direction.class);
775775

776776
/**
777-
* The {@link ItemActionEffect}s an {@link ItemStack} will apply when consumed.
777+
* The {@link ItemAction}s an {@link ItemStack} will apply when consumed.
778778
*/
779-
public static final Key<ListValue<ItemActionEffect>> CONSUME_EFFECTS = Keys.listKey(ResourceKey.sponge("consume_effects"), ItemActionEffect.class);
779+
public static final Key<ListValue<ItemAction>> CONSUME_ACTIONS = Keys.listKey(ResourceKey.sponge("consume_effects"), ItemAction.class);
780780

781781
/**
782782
* The container {@link ItemType} of an {@link ItemStack}.
@@ -929,9 +929,9 @@ public final class Keys {
929929
public static final Key<Value<Double>> DAMAGE_PER_BLOCK = Keys.key(ResourceKey.sponge("damage_per_block"), Double.class);
930930

931931
/**
932-
* The {@link ItemActionEffect}s an {@link ItemStack} will apply on death.
932+
* The {@link ItemAction}s an {@link ItemStack} will apply on death.
933933
*/
934-
public static final Key<ListValue<ItemActionEffect>> DEATH_PROTECTION_EFFECTS = Keys.listKey(ResourceKey.sponge("death_protection_effects"), ItemActionEffect.class);
934+
public static final Key<ListValue<ItemAction>> DEATH_PROTECTION_ACTIONS = Keys.listKey(ResourceKey.sponge("death_protection_effects"), ItemAction.class);
935935

936936
/**
937937
* The distance at which a {@link BlockState} will decay.

src/main/java/org/spongepowered/api/data/type/ItemActionEffect.java renamed to src/main/java/org/spongepowered/api/data/type/ItemAction.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,60 +42,60 @@
4242
import 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

src/main/java/org/spongepowered/api/data/type/ItemActionEffectType.java renamed to src/main/java/org/spongepowered/api/data/type/ItemActionType.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import org.spongepowered.api.util.annotation.CatalogedBy;
2929

3030
/**
31-
* Represents a possible type of {@link ItemActionEffect}.
31+
* Represents a possible type of {@link ItemAction}.
3232
*/
33-
@CatalogedBy(ConsumeEffectTypes.class)
34-
public interface ItemActionEffectType extends DefaultedRegistryValue {
33+
@CatalogedBy(ItemActionTypes.class)
34+
public interface ItemActionType extends DefaultedRegistryValue {
3535
}

src/main/java/org/spongepowered/api/data/type/ConsumeEffectTypes.java renamed to src/main/java/org/spongepowered/api/data/type/ItemActionTypes.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,26 @@
3838
*/
3939
@SuppressWarnings("unused")
4040
@RegistryScopes(scopes = RegistryScope.GAME)
41-
public final class ConsumeEffectTypes {
41+
public final class ItemActionTypes {
4242

43-
public static final DefaultedRegistryReference<ItemActionEffectType> APPLY_EFFECTS = ConsumeEffectTypes.key(ResourceKey.minecraft("apply_effects"));
43+
public static final DefaultedRegistryReference<ItemActionType> APPLY_EFFECTS = ItemActionTypes.key(ResourceKey.minecraft("apply_effects"));
4444

45-
public static final DefaultedRegistryReference<ItemActionEffectType> CLEAR_ALL_EFFECTS = ConsumeEffectTypes.key(ResourceKey.minecraft("clear_all_effects"));
45+
public static final DefaultedRegistryReference<ItemActionType> CLEAR_ALL_EFFECTS = ItemActionTypes.key(ResourceKey.minecraft("clear_all_effects"));
4646

47-
public static final DefaultedRegistryReference<ItemActionEffectType> PLAY_SOUND = ConsumeEffectTypes.key(ResourceKey.minecraft("play_sound"));
47+
public static final DefaultedRegistryReference<ItemActionType> PLAY_SOUND = ItemActionTypes.key(ResourceKey.minecraft("play_sound"));
4848

49-
public static final DefaultedRegistryReference<ItemActionEffectType> REMOVE_EFFECTS = ConsumeEffectTypes.key(ResourceKey.minecraft("remove_effects"));
49+
public static final DefaultedRegistryReference<ItemActionType> REMOVE_EFFECTS = ItemActionTypes.key(ResourceKey.minecraft("remove_effects"));
5050

51-
public static final DefaultedRegistryReference<ItemActionEffectType> TELEPORT_RANDOMLY = ConsumeEffectTypes.key(ResourceKey.minecraft("teleport_randomly"));
51+
public static final DefaultedRegistryReference<ItemActionType> TELEPORT_RANDOMLY = ItemActionTypes.key(ResourceKey.minecraft("teleport_randomly"));
5252

53-
private ConsumeEffectTypes() {
53+
private ItemActionTypes() {
5454
}
5555

56-
public static Registry<ItemActionEffectType> registry() {
57-
return Sponge.game().registry(RegistryTypes.ITEM_ACTION_EFFECT_TYPE);
56+
public static Registry<ItemActionType> registry() {
57+
return Sponge.game().registry(RegistryTypes.ITEM_ACTION_TYPE);
5858
}
5959

60-
private static DefaultedRegistryReference<ItemActionEffectType> key(final ResourceKey location) {
61-
return RegistryKey.of(RegistryTypes.ITEM_ACTION_EFFECT_TYPE, location).asDefaultedReference(Sponge::game);
60+
private static DefaultedRegistryReference<ItemActionType> key(final ResourceKey location) {
61+
return RegistryKey.of(RegistryTypes.ITEM_ACTION_TYPE, location).asDefaultedReference(Sponge::game);
6262
}
6363
}

src/main/java/org/spongepowered/api/registry/RegistryTypes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
import org.spongepowered.api.data.type.HorseColor;
6767
import org.spongepowered.api.data.type.HorseStyle;
6868
import org.spongepowered.api.data.type.InstrumentType;
69-
import org.spongepowered.api.data.type.ItemActionEffectType;
69+
import org.spongepowered.api.data.type.ItemActionType;
7070
import org.spongepowered.api.data.type.ItemTier;
7171
import org.spongepowered.api.data.type.JigsawBlockOrientation;
7272
import org.spongepowered.api.data.type.LlamaType;
@@ -227,7 +227,7 @@ public final class RegistryTypes {
227227

228228
public static final DefaultedRegistryType<ChunkState> CHUNK_STATE = RegistryTypes.minecraftKeyInGame("chunk_status");
229229

230-
public static final DefaultedRegistryType<ItemActionEffectType> ITEM_ACTION_EFFECT_TYPE = RegistryTypes.minecraftKeyInGame("consume_effect_type");
230+
public static final DefaultedRegistryType<ItemActionType> ITEM_ACTION_TYPE = RegistryTypes.minecraftKeyInGame("consume_effect_type");
231231

232232
public static final DefaultedRegistryType<ContainerType> CONTAINER_TYPE = RegistryTypes.minecraftKeyInGame("menu");
233233

0 commit comments

Comments
 (0)