From 02d927cc4d988dbfae6ad99f8f1d224396b764da Mon Sep 17 00:00:00 2001 From: TheMode Date: Mon, 6 Sep 2021 13:32:52 +0200 Subject: [PATCH] Rename internal registry constant holder interfaces Signed-off-by: TheMode --- .../java/net/minestom/codegen/Generators.java | 18 +++++++++--------- ...tityTypeConstants.java => EntityTypes.java} | 2 +- .../block/{BlockConstants.java => Blocks.java} | 2 +- ...antmentConstants.java => Enchantments.java} | 2 +- .../{MaterialConstants.java => Materials.java} | 2 +- .../{ParticleConstants.java => Particles.java} | 2 +- ...EffectConstants.java => PotionEffects.java} | 2 +- ...tionTypeConstants.java => PotionTypes.java} | 2 +- ...undEventConstants.java => SoundEvents.java} | 2 +- ...cTypeConstants.java => StatisticTypes.java} | 2 +- .../net/minestom/server/entity/EntityType.java | 2 +- .../minestom/server/instance/block/Block.java | 2 +- .../net/minestom/server/item/Enchantment.java | 2 +- .../net/minestom/server/item/Material.java | 2 +- .../net/minestom/server/particle/Particle.java | 2 +- .../minestom/server/potion/PotionEffect.java | 2 +- .../net/minestom/server/potion/PotionType.java | 2 +- .../net/minestom/server/sound/SoundEvent.java | 2 +- .../server/statistic/StatisticType.java | 2 +- 19 files changed, 27 insertions(+), 27 deletions(-) rename src/autogenerated/java/net/minestom/server/entity/{EntityTypeConstants.java => EntityTypes.java} (99%) rename src/autogenerated/java/net/minestom/server/instance/block/{BlockConstants.java => Blocks.java} (99%) rename src/autogenerated/java/net/minestom/server/item/{EnchantmentConstants.java => Enchantments.java} (98%) rename src/autogenerated/java/net/minestom/server/item/{MaterialConstants.java => Materials.java} (99%) rename src/autogenerated/java/net/minestom/server/particle/{ParticleConstants.java => Particles.java} (99%) rename src/autogenerated/java/net/minestom/server/potion/{PotionEffectConstants.java => PotionEffects.java} (98%) rename src/autogenerated/java/net/minestom/server/potion/{PotionTypeConstants.java => PotionTypes.java} (99%) rename src/autogenerated/java/net/minestom/server/sound/{SoundEventConstants.java => SoundEvents.java} (99%) rename src/autogenerated/java/net/minestom/server/statistic/{StatisticTypeConstants.java => StatisticTypes.java} (99%) diff --git a/code-generators/src/main/java/net/minestom/codegen/Generators.java b/code-generators/src/main/java/net/minestom/codegen/Generators.java index af91d4506..285a579ca 100644 --- a/code-generators/src/main/java/net/minestom/codegen/Generators.java +++ b/code-generators/src/main/java/net/minestom/codegen/Generators.java @@ -17,15 +17,15 @@ public class Generators { } File outputFolder = new File(args[0]); var generator = new CodeGenerator(outputFolder); - generator.generate(resource("blocks.json"), "net.minestom.server.instance.block", "Block", "BlockImpl", "BlockConstants"); - generator.generate(resource("items.json"), "net.minestom.server.item", "Material", "MaterialImpl", "MaterialConstants"); - generator.generate(resource("entities.json"), "net.minestom.server.entity", "EntityType", "EntityTypeImpl", "EntityTypeConstants"); - generator.generate(resource("enchantments.json"), "net.minestom.server.item", "Enchantment", "EnchantmentImpl", "EnchantmentConstants"); - generator.generate(resource("potion_effects.json"), "net.minestom.server.potion", "PotionEffect", "PotionEffectImpl", "PotionEffectConstants"); - generator.generate(resource("potions.json"), "net.minestom.server.potion", "PotionType", "PotionTypeImpl", "PotionTypeConstants"); - generator.generate(resource("particles.json"), "net.minestom.server.particle", "Particle", "ParticleImpl", "ParticleConstants"); - generator.generate(resource("sounds.json"), "net.minestom.server.sound", "SoundEvent", "SoundEventImpl", "SoundEventConstants"); - generator.generate(resource("custom_statistics.json"), "net.minestom.server.statistic", "StatisticType", "StatisticTypeImpl", "StatisticTypeConstants"); + generator.generate(resource("blocks.json"), "net.minestom.server.instance.block", "Block", "BlockImpl", "Blocks"); + generator.generate(resource("items.json"), "net.minestom.server.item", "Material", "MaterialImpl", "Materials"); + generator.generate(resource("entities.json"), "net.minestom.server.entity", "EntityType", "EntityTypeImpl", "EntityTypes"); + generator.generate(resource("enchantments.json"), "net.minestom.server.item", "Enchantment", "EnchantmentImpl", "Enchantments"); + generator.generate(resource("potion_effects.json"), "net.minestom.server.potion", "PotionEffect", "PotionEffectImpl", "PotionEffects"); + generator.generate(resource("potions.json"), "net.minestom.server.potion", "PotionType", "PotionTypeImpl", "PotionTypes"); + generator.generate(resource("particles.json"), "net.minestom.server.particle", "Particle", "ParticleImpl", "Particles"); + generator.generate(resource("sounds.json"), "net.minestom.server.sound", "SoundEvent", "SoundEventImpl", "SoundEvents"); + generator.generate(resource("custom_statistics.json"), "net.minestom.server.statistic", "StatisticType", "StatisticTypeImpl", "StatisticTypes"); // Generate fluids new FluidGenerator(resource("fluids.json"), outputFolder).generate(); diff --git a/src/autogenerated/java/net/minestom/server/entity/EntityTypeConstants.java b/src/autogenerated/java/net/minestom/server/entity/EntityTypes.java similarity index 99% rename from src/autogenerated/java/net/minestom/server/entity/EntityTypeConstants.java rename to src/autogenerated/java/net/minestom/server/entity/EntityTypes.java index f756c1024..310701719 100644 --- a/src/autogenerated/java/net/minestom/server/entity/EntityTypeConstants.java +++ b/src/autogenerated/java/net/minestom/server/entity/EntityTypes.java @@ -4,7 +4,7 @@ package net.minestom.server.entity; * Code autogenerated, do not edit! */ @SuppressWarnings("unused") -interface EntityTypeConstants { +interface EntityTypes { EntityType AREA_EFFECT_CLOUD = EntityTypeImpl.get("minecraft:area_effect_cloud"); EntityType ARMOR_STAND = EntityTypeImpl.get("minecraft:armor_stand"); diff --git a/src/autogenerated/java/net/minestom/server/instance/block/BlockConstants.java b/src/autogenerated/java/net/minestom/server/instance/block/Blocks.java similarity index 99% rename from src/autogenerated/java/net/minestom/server/instance/block/BlockConstants.java rename to src/autogenerated/java/net/minestom/server/instance/block/Blocks.java index 15edfae1c..efaa0d900 100644 --- a/src/autogenerated/java/net/minestom/server/instance/block/BlockConstants.java +++ b/src/autogenerated/java/net/minestom/server/instance/block/Blocks.java @@ -4,7 +4,7 @@ package net.minestom.server.instance.block; * Code autogenerated, do not edit! */ @SuppressWarnings("unused") -interface BlockConstants { +interface Blocks { Block AIR = BlockImpl.get("minecraft:air"); Block STONE = BlockImpl.get("minecraft:stone"); diff --git a/src/autogenerated/java/net/minestom/server/item/EnchantmentConstants.java b/src/autogenerated/java/net/minestom/server/item/Enchantments.java similarity index 98% rename from src/autogenerated/java/net/minestom/server/item/EnchantmentConstants.java rename to src/autogenerated/java/net/minestom/server/item/Enchantments.java index d1ec6c75f..469874132 100644 --- a/src/autogenerated/java/net/minestom/server/item/EnchantmentConstants.java +++ b/src/autogenerated/java/net/minestom/server/item/Enchantments.java @@ -4,7 +4,7 @@ package net.minestom.server.item; * Code autogenerated, do not edit! */ @SuppressWarnings("unused") -interface EnchantmentConstants { +interface Enchantments { Enchantment PROTECTION = EnchantmentImpl.get("minecraft:protection"); Enchantment FIRE_PROTECTION = EnchantmentImpl.get("minecraft:fire_protection"); diff --git a/src/autogenerated/java/net/minestom/server/item/MaterialConstants.java b/src/autogenerated/java/net/minestom/server/item/Materials.java similarity index 99% rename from src/autogenerated/java/net/minestom/server/item/MaterialConstants.java rename to src/autogenerated/java/net/minestom/server/item/Materials.java index 808d42acc..c04d28b69 100644 --- a/src/autogenerated/java/net/minestom/server/item/MaterialConstants.java +++ b/src/autogenerated/java/net/minestom/server/item/Materials.java @@ -4,7 +4,7 @@ package net.minestom.server.item; * Code autogenerated, do not edit! */ @SuppressWarnings("unused") -interface MaterialConstants { +interface Materials { Material AIR = MaterialImpl.get("minecraft:air"); Material STONE = MaterialImpl.get("minecraft:stone"); diff --git a/src/autogenerated/java/net/minestom/server/particle/ParticleConstants.java b/src/autogenerated/java/net/minestom/server/particle/Particles.java similarity index 99% rename from src/autogenerated/java/net/minestom/server/particle/ParticleConstants.java rename to src/autogenerated/java/net/minestom/server/particle/Particles.java index ff6a479f6..51829adf1 100644 --- a/src/autogenerated/java/net/minestom/server/particle/ParticleConstants.java +++ b/src/autogenerated/java/net/minestom/server/particle/Particles.java @@ -4,7 +4,7 @@ package net.minestom.server.particle; * Code autogenerated, do not edit! */ @SuppressWarnings("unused") -interface ParticleConstants { +interface Particles { Particle AMBIENT_ENTITY_EFFECT = ParticleImpl.get("minecraft:ambient_entity_effect"); Particle ANGRY_VILLAGER = ParticleImpl.get("minecraft:angry_villager"); diff --git a/src/autogenerated/java/net/minestom/server/potion/PotionEffectConstants.java b/src/autogenerated/java/net/minestom/server/potion/PotionEffects.java similarity index 98% rename from src/autogenerated/java/net/minestom/server/potion/PotionEffectConstants.java rename to src/autogenerated/java/net/minestom/server/potion/PotionEffects.java index bf5908eb3..33d94d878 100644 --- a/src/autogenerated/java/net/minestom/server/potion/PotionEffectConstants.java +++ b/src/autogenerated/java/net/minestom/server/potion/PotionEffects.java @@ -4,7 +4,7 @@ package net.minestom.server.potion; * Code autogenerated, do not edit! */ @SuppressWarnings("unused") -interface PotionEffectConstants { +interface PotionEffects { PotionEffect SPEED = PotionEffectImpl.get("minecraft:speed"); PotionEffect SLOWNESS = PotionEffectImpl.get("minecraft:slowness"); diff --git a/src/autogenerated/java/net/minestom/server/potion/PotionTypeConstants.java b/src/autogenerated/java/net/minestom/server/potion/PotionTypes.java similarity index 99% rename from src/autogenerated/java/net/minestom/server/potion/PotionTypeConstants.java rename to src/autogenerated/java/net/minestom/server/potion/PotionTypes.java index e34e71666..91430a100 100644 --- a/src/autogenerated/java/net/minestom/server/potion/PotionTypeConstants.java +++ b/src/autogenerated/java/net/minestom/server/potion/PotionTypes.java @@ -4,7 +4,7 @@ package net.minestom.server.potion; * Code autogenerated, do not edit! */ @SuppressWarnings("unused") -interface PotionTypeConstants { +interface PotionTypes { PotionType EMPTY = PotionTypeImpl.get("minecraft:empty"); PotionType WATER = PotionTypeImpl.get("minecraft:water"); diff --git a/src/autogenerated/java/net/minestom/server/sound/SoundEventConstants.java b/src/autogenerated/java/net/minestom/server/sound/SoundEvents.java similarity index 99% rename from src/autogenerated/java/net/minestom/server/sound/SoundEventConstants.java rename to src/autogenerated/java/net/minestom/server/sound/SoundEvents.java index e04b474cb..e2976e78c 100644 --- a/src/autogenerated/java/net/minestom/server/sound/SoundEventConstants.java +++ b/src/autogenerated/java/net/minestom/server/sound/SoundEvents.java @@ -4,7 +4,7 @@ package net.minestom.server.sound; * Code autogenerated, do not edit! */ @SuppressWarnings("unused") -interface SoundEventConstants { +interface SoundEvents { SoundEvent AMBIENT_CAVE = SoundEventImpl.get("minecraft:ambient.cave"); SoundEvent AMBIENT_BASALT_DELTAS_ADDITIONS = SoundEventImpl.get("minecraft:ambient.basalt_deltas.additions"); diff --git a/src/autogenerated/java/net/minestom/server/statistic/StatisticTypeConstants.java b/src/autogenerated/java/net/minestom/server/statistic/StatisticTypes.java similarity index 99% rename from src/autogenerated/java/net/minestom/server/statistic/StatisticTypeConstants.java rename to src/autogenerated/java/net/minestom/server/statistic/StatisticTypes.java index a5ee17edb..2332ade04 100644 --- a/src/autogenerated/java/net/minestom/server/statistic/StatisticTypeConstants.java +++ b/src/autogenerated/java/net/minestom/server/statistic/StatisticTypes.java @@ -4,7 +4,7 @@ package net.minestom.server.statistic; * Code autogenerated, do not edit! */ @SuppressWarnings("unused") -interface StatisticTypeConstants { +interface StatisticTypes { StatisticType LEAVE_GAME = StatisticTypeImpl.get("minecraft:leave_game"); StatisticType PLAY_TIME = StatisticTypeImpl.get("minecraft:play_time"); diff --git a/src/main/java/net/minestom/server/entity/EntityType.java b/src/main/java/net/minestom/server/entity/EntityType.java index fb9c423f9..850a081dd 100644 --- a/src/main/java/net/minestom/server/entity/EntityType.java +++ b/src/main/java/net/minestom/server/entity/EntityType.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Collection; @ApiStatus.NonExtendable -public interface EntityType extends ProtocolObject, EntityTypeConstants { +public interface EntityType extends ProtocolObject, EntityTypes { /** * Returns the entity registry. * diff --git a/src/main/java/net/minestom/server/instance/block/Block.java b/src/main/java/net/minestom/server/instance/block/Block.java index e622dfa14..9aa98ad7a 100644 --- a/src/main/java/net/minestom/server/instance/block/Block.java +++ b/src/main/java/net/minestom/server/instance/block/Block.java @@ -20,7 +20,7 @@ import java.util.function.BiPredicate; * Implementations are expected to be immutable. */ @ApiStatus.NonExtendable -public interface Block extends ProtocolObject, TagReadable, BlockConstants { +public interface Block extends ProtocolObject, TagReadable, Blocks { /** * Creates a new block with the the property {@code property} sets to {@code value}. diff --git a/src/main/java/net/minestom/server/item/Enchantment.java b/src/main/java/net/minestom/server/item/Enchantment.java index 160744268..4ff511a47 100644 --- a/src/main/java/net/minestom/server/item/Enchantment.java +++ b/src/main/java/net/minestom/server/item/Enchantment.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Collection; @ApiStatus.NonExtendable -public interface Enchantment extends ProtocolObject, EnchantmentConstants { +public interface Enchantment extends ProtocolObject, Enchantments { /** * Returns the enchantment registry. diff --git a/src/main/java/net/minestom/server/item/Material.java b/src/main/java/net/minestom/server/item/Material.java index 31bc4a353..b92eb1f87 100644 --- a/src/main/java/net/minestom/server/item/Material.java +++ b/src/main/java/net/minestom/server/item/Material.java @@ -12,7 +12,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Collection; @ApiStatus.NonExtendable -public interface Material extends ProtocolObject, MaterialConstants { +public interface Material extends ProtocolObject, Materials { /** * Returns the material registry. diff --git a/src/main/java/net/minestom/server/particle/Particle.java b/src/main/java/net/minestom/server/particle/Particle.java index 24ddf695b..454fb2a5c 100644 --- a/src/main/java/net/minestom/server/particle/Particle.java +++ b/src/main/java/net/minestom/server/particle/Particle.java @@ -9,7 +9,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Collection; @ApiStatus.NonExtendable -public interface Particle extends ProtocolObject, ParticleConstants { +public interface Particle extends ProtocolObject, Particles { static @NotNull Collection<@NotNull Particle> values() { return ParticleImpl.values(); diff --git a/src/main/java/net/minestom/server/potion/PotionEffect.java b/src/main/java/net/minestom/server/potion/PotionEffect.java index 4db81303e..3ab11f856 100644 --- a/src/main/java/net/minestom/server/potion/PotionEffect.java +++ b/src/main/java/net/minestom/server/potion/PotionEffect.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Collection; @ApiStatus.NonExtendable -public interface PotionEffect extends ProtocolObject, PotionEffectConstants { +public interface PotionEffect extends ProtocolObject, PotionEffects { @Contract(pure = true) @NotNull Registry.PotionEffectEntry registry(); diff --git a/src/main/java/net/minestom/server/potion/PotionType.java b/src/main/java/net/minestom/server/potion/PotionType.java index fc4eb9f84..5bea3eca9 100644 --- a/src/main/java/net/minestom/server/potion/PotionType.java +++ b/src/main/java/net/minestom/server/potion/PotionType.java @@ -9,7 +9,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Collection; @ApiStatus.NonExtendable -public interface PotionType extends ProtocolObject, PotionTypeConstants { +public interface PotionType extends ProtocolObject, PotionTypes { static @NotNull Collection<@NotNull PotionType> values() { return PotionTypeImpl.values(); diff --git a/src/main/java/net/minestom/server/sound/SoundEvent.java b/src/main/java/net/minestom/server/sound/SoundEvent.java index 61db8cfed..8260df268 100644 --- a/src/main/java/net/minestom/server/sound/SoundEvent.java +++ b/src/main/java/net/minestom/server/sound/SoundEvent.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Collection; @ApiStatus.NonExtendable -public interface SoundEvent extends ProtocolObject, Sound.Type, SoundEventConstants { +public interface SoundEvent extends ProtocolObject, Sound.Type, SoundEvents { static @NotNull Collection<@NotNull SoundEvent> values() { return SoundEventImpl.values(); diff --git a/src/main/java/net/minestom/server/statistic/StatisticType.java b/src/main/java/net/minestom/server/statistic/StatisticType.java index 338c14d96..877b62da7 100644 --- a/src/main/java/net/minestom/server/statistic/StatisticType.java +++ b/src/main/java/net/minestom/server/statistic/StatisticType.java @@ -9,7 +9,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Collection; @ApiStatus.NonExtendable -public interface StatisticType extends ProtocolObject, StatisticTypeConstants { +public interface StatisticType extends ProtocolObject, StatisticTypes { static @NotNull Collection<@NotNull StatisticType> values() { return StatisticTypeImpl.values();