Make OldEnum and Particle interface for easier implementation

This commit is contained in:
DerFrZocker 2024-06-05 20:47:58 +02:00
parent 15a7261c13
commit 2abfcc4958
No known key found for this signature in database
GPG key ID: 713F71FFFE1DDF91
13 changed files with 134 additions and 134 deletions

View file

@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable;
* Represents the art on a painting. * Represents the art on a painting.
* Listed Arts are present at the default server. * Listed Arts are present at the default server.
*/ */
public abstract class Art extends OldEnum<Art> implements Keyed { public abstract class Art implements OldEnum<Art>, Keyed {
@Deprecated @Deprecated
private static final Map<Integer, Art> BY_ID = Maps.newHashMap(); private static final Map<Integer, Art> BY_ID = Maps.newHashMap();

View file

@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
/** /**
* Represents a fluid type. * Represents a fluid type.
*/ */
public abstract class Fluid extends OldEnum<Fluid> implements Keyed { public abstract class Fluid implements OldEnum<Fluid>, Keyed {
/** /**
* Empty. * Empty.

View file

@ -10,14 +10,14 @@ import org.bukkit.util.OldEnum;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
public abstract class Particle extends OldEnum<Particle> implements Keyed { public interface Particle extends OldEnum<Particle>, Keyed {
/** /**
* Typed represents a subtype of {@link Particle particles} that have a data type. * Typed represents a subtype of {@link Particle particles} that have a data type.
* *
* @param <D> the generic data type of the particle. * @param <D> the generic data type of the particle.
*/ */
public abstract static class Typed<D> extends Particle { interface Typed<D> extends Particle {
/** /**
* Returns the required data type for the particle * Returns the required data type for the particle
@ -26,178 +26,178 @@ public abstract class Particle extends OldEnum<Particle> implements Keyed {
*/ */
@NotNull @NotNull
@Override @Override
public abstract Class<D> getDataType(); Class<D> getDataType();
} }
public static final Particle POOF = getParticle("poof"); Particle POOF = getParticle("poof");
public static final Particle EXPLOSION = getParticle("explosion"); Particle EXPLOSION = getParticle("explosion");
public static final Particle EXPLOSION_EMITTER = getParticle("explosion_emitter"); Particle EXPLOSION_EMITTER = getParticle("explosion_emitter");
public static final Particle FIREWORK = getParticle("firework"); Particle FIREWORK = getParticle("firework");
public static final Particle BUBBLE = getParticle("bubble"); Particle BUBBLE = getParticle("bubble");
public static final Particle SPLASH = getParticle("splash"); Particle SPLASH = getParticle("splash");
public static final Particle FISHING = getParticle("fishing"); Particle FISHING = getParticle("fishing");
public static final Particle UNDERWATER = getParticle("underwater"); Particle UNDERWATER = getParticle("underwater");
public static final Particle CRIT = getParticle("crit"); Particle CRIT = getParticle("crit");
public static final Particle ENCHANTED_HIT = getParticle("enchanted_hit"); Particle ENCHANTED_HIT = getParticle("enchanted_hit");
public static final Particle SMOKE = getParticle("smoke"); Particle SMOKE = getParticle("smoke");
public static final Particle LARGE_SMOKE = getParticle("large_smoke"); Particle LARGE_SMOKE = getParticle("large_smoke");
public static final Particle EFFECT = getParticle("effect"); Particle EFFECT = getParticle("effect");
public static final Particle INSTANT_EFFECT = getParticle("instant_effect"); Particle INSTANT_EFFECT = getParticle("instant_effect");
/** /**
* Uses {@link Color} as DataType * Uses {@link Color} as DataType
*/ */
public static final Particle.Typed<Color> ENTITY_EFFECT = getParticle("entity_effect"); Particle.Typed<Color> ENTITY_EFFECT = getParticle("entity_effect");
public static final Particle AMBIENT_ENTITY_EFFECT = getParticle("ambient_entity_effect"); Particle AMBIENT_ENTITY_EFFECT = getParticle("ambient_entity_effect");
public static final Particle WITCH = getParticle("witch"); Particle WITCH = getParticle("witch");
public static final Particle DRIPPING_WATER = getParticle("dripping_water"); Particle DRIPPING_WATER = getParticle("dripping_water");
public static final Particle DRIPPING_LAVA = getParticle("dripping_lava"); Particle DRIPPING_LAVA = getParticle("dripping_lava");
public static final Particle ANGRY_VILLAGER = getParticle("angry_villager"); Particle ANGRY_VILLAGER = getParticle("angry_villager");
public static final Particle HAPPY_VILLAGER = getParticle("happy_villager"); Particle HAPPY_VILLAGER = getParticle("happy_villager");
public static final Particle MYCELIUM = getParticle("mycelium"); Particle MYCELIUM = getParticle("mycelium");
public static final Particle NOTE = getParticle("note"); Particle NOTE = getParticle("note");
public static final Particle PORTAL = getParticle("portal"); Particle PORTAL = getParticle("portal");
public static final Particle ENCHANT = getParticle("enchant"); Particle ENCHANT = getParticle("enchant");
public static final Particle FLAME = getParticle("flame"); Particle FLAME = getParticle("flame");
public static final Particle LAVA = getParticle("lava"); Particle LAVA = getParticle("lava");
public static final Particle CLOUD = getParticle("cloud"); Particle CLOUD = getParticle("cloud");
/** /**
* Uses {@link Particle.DustOptions} as DataType * Uses {@link Particle.DustOptions} as DataType
*/ */
public static final Particle.Typed<DustOptions> DUST = getParticle("dust"); Particle.Typed<DustOptions> DUST = getParticle("dust");
public static final Particle ITEM_SNOWBALL = getParticle("item_snowball"); Particle ITEM_SNOWBALL = getParticle("item_snowball");
public static final Particle ITEM_SLIME = getParticle("item_slime"); Particle ITEM_SLIME = getParticle("item_slime");
public static final Particle HEART = getParticle("heart"); Particle HEART = getParticle("heart");
/** /**
* Uses {@link ItemStack} as DataType * Uses {@link ItemStack} as DataType
*/ */
public static final Particle.Typed<ItemStack> ITEM = getParticle("item"); Particle.Typed<ItemStack> ITEM = getParticle("item");
/** /**
* Uses {@link BlockData} as DataType * Uses {@link BlockData} as DataType
*/ */
public static final Particle.Typed<BlockData> BLOCK = getParticle("block"); Particle.Typed<BlockData> BLOCK = getParticle("block");
public static final Particle RAIN = getParticle("rain"); Particle RAIN = getParticle("rain");
public static final Particle ELDER_GUARDIAN = getParticle("elder_guardian"); Particle ELDER_GUARDIAN = getParticle("elder_guardian");
public static final Particle DRAGON_BREATH = getParticle("dragon_breath"); Particle DRAGON_BREATH = getParticle("dragon_breath");
public static final Particle END_ROD = getParticle("end_rod"); Particle END_ROD = getParticle("end_rod");
public static final Particle DAMAGE_INDICATOR = getParticle("damage_indicator"); Particle DAMAGE_INDICATOR = getParticle("damage_indicator");
public static final Particle SWEEP_ATTACK = getParticle("sweep_attack"); Particle SWEEP_ATTACK = getParticle("sweep_attack");
/** /**
* Uses {@link BlockData} as DataType * Uses {@link BlockData} as DataType
*/ */
public static final Particle.Typed<BlockData> FALLING_DUST = getParticle("falling_dust"); Particle.Typed<BlockData> FALLING_DUST = getParticle("falling_dust");
public static final Particle TOTEM_OF_UNDYING = getParticle("totem_of_undying"); Particle TOTEM_OF_UNDYING = getParticle("totem_of_undying");
public static final Particle SPIT = getParticle("spit"); Particle SPIT = getParticle("spit");
public static final Particle SQUID_INK = getParticle("squid_ink"); Particle SQUID_INK = getParticle("squid_ink");
public static final Particle BUBBLE_POP = getParticle("bubble_pop"); Particle BUBBLE_POP = getParticle("bubble_pop");
public static final Particle CURRENT_DOWN = getParticle("current_down"); Particle CURRENT_DOWN = getParticle("current_down");
public static final Particle BUBBLE_COLUMN_UP = getParticle("bubble_column_up"); Particle BUBBLE_COLUMN_UP = getParticle("bubble_column_up");
public static final Particle NAUTILUS = getParticle("nautilus"); Particle NAUTILUS = getParticle("nautilus");
public static final Particle DOLPHIN = getParticle("dolphin"); Particle DOLPHIN = getParticle("dolphin");
public static final Particle SNEEZE = getParticle("sneeze"); Particle SNEEZE = getParticle("sneeze");
public static final Particle CAMPFIRE_COSY_SMOKE = getParticle("campfire_cosy_smoke"); Particle CAMPFIRE_COSY_SMOKE = getParticle("campfire_cosy_smoke");
public static final Particle CAMPFIRE_SIGNAL_SMOKE = getParticle("campfire_signal_smoke"); Particle CAMPFIRE_SIGNAL_SMOKE = getParticle("campfire_signal_smoke");
public static final Particle COMPOSTER = getParticle("composter"); Particle COMPOSTER = getParticle("composter");
public static final Particle FLASH = getParticle("flash"); Particle FLASH = getParticle("flash");
public static final Particle FALLING_LAVA = getParticle("falling_lava"); Particle FALLING_LAVA = getParticle("falling_lava");
public static final Particle LANDING_LAVA = getParticle("landing_lava"); Particle LANDING_LAVA = getParticle("landing_lava");
public static final Particle FALLING_WATER = getParticle("falling_water"); Particle FALLING_WATER = getParticle("falling_water");
public static final Particle DRIPPING_HONEY = getParticle("dripping_honey"); Particle DRIPPING_HONEY = getParticle("dripping_honey");
public static final Particle FALLING_HONEY = getParticle("falling_honey"); Particle FALLING_HONEY = getParticle("falling_honey");
public static final Particle LANDING_HONEY = getParticle("landing_honey"); Particle LANDING_HONEY = getParticle("landing_honey");
public static final Particle FALLING_NECTAR = getParticle("falling_nectar"); Particle FALLING_NECTAR = getParticle("falling_nectar");
public static final Particle SOUL_FIRE_FLAME = getParticle("soul_fire_flame"); Particle SOUL_FIRE_FLAME = getParticle("soul_fire_flame");
public static final Particle ASH = getParticle("ash"); Particle ASH = getParticle("ash");
public static final Particle CRIMSON_SPORE = getParticle("crimson_spore"); Particle CRIMSON_SPORE = getParticle("crimson_spore");
public static final Particle WARPED_SPORE = getParticle("warped_spore"); Particle WARPED_SPORE = getParticle("warped_spore");
public static final Particle SOUL = getParticle("soul"); Particle SOUL = getParticle("soul");
public static final Particle DRIPPING_OBSIDIAN_TEAR = getParticle("dripping_obsidian_tear"); Particle DRIPPING_OBSIDIAN_TEAR = getParticle("dripping_obsidian_tear");
public static final Particle FALLING_OBSIDIAN_TEAR = getParticle("falling_obsidian_tear"); Particle FALLING_OBSIDIAN_TEAR = getParticle("falling_obsidian_tear");
public static final Particle LANDING_OBSIDIAN_TEAR = getParticle("landing_obsidian_tear"); Particle LANDING_OBSIDIAN_TEAR = getParticle("landing_obsidian_tear");
public static final Particle REVERSE_PORTAL = getParticle("reverse_portal"); Particle REVERSE_PORTAL = getParticle("reverse_portal");
public static final Particle WHITE_ASH = getParticle("white_ash"); Particle WHITE_ASH = getParticle("white_ash");
/** /**
* Uses {@link DustTransition} as DataType * Uses {@link DustTransition} as DataType
*/ */
public static final Particle.Typed<DustTransition> DUST_COLOR_TRANSITION = getParticle("dust_color_transition"); Particle.Typed<DustTransition> DUST_COLOR_TRANSITION = getParticle("dust_color_transition");
/** /**
* Uses {@link Vibration} as DataType * Uses {@link Vibration} as DataType
*/ */
public static final Particle.Typed<Vibration> VIBRATION = getParticle("vibration"); Particle.Typed<Vibration> VIBRATION = getParticle("vibration");
public static final Particle FALLING_SPORE_BLOSSOM = getParticle("falling_spore_blossom"); Particle FALLING_SPORE_BLOSSOM = getParticle("falling_spore_blossom");
public static final Particle SPORE_BLOSSOM_AIR = getParticle("spore_blossom_air"); Particle SPORE_BLOSSOM_AIR = getParticle("spore_blossom_air");
public static final Particle SMALL_FLAME = getParticle("small_flame"); Particle SMALL_FLAME = getParticle("small_flame");
public static final Particle SNOWFLAKE = getParticle("snowflake"); Particle SNOWFLAKE = getParticle("snowflake");
public static final Particle DRIPPING_DRIPSTONE_LAVA = getParticle("dripping_dripstone_lava"); Particle DRIPPING_DRIPSTONE_LAVA = getParticle("dripping_dripstone_lava");
public static final Particle FALLING_DRIPSTONE_LAVA = getParticle("falling_dripstone_lava"); Particle FALLING_DRIPSTONE_LAVA = getParticle("falling_dripstone_lava");
public static final Particle DRIPPING_DRIPSTONE_WATER = getParticle("dripping_dripstone_water"); Particle DRIPPING_DRIPSTONE_WATER = getParticle("dripping_dripstone_water");
public static final Particle FALLING_DRIPSTONE_WATER = getParticle("falling_dripstone_water"); Particle FALLING_DRIPSTONE_WATER = getParticle("falling_dripstone_water");
public static final Particle GLOW_SQUID_INK = getParticle("glow_squid_ink"); Particle GLOW_SQUID_INK = getParticle("glow_squid_ink");
public static final Particle GLOW = getParticle("glow"); Particle GLOW = getParticle("glow");
public static final Particle WAX_ON = getParticle("wax_on"); Particle WAX_ON = getParticle("wax_on");
public static final Particle WAX_OFF = getParticle("wax_off"); Particle WAX_OFF = getParticle("wax_off");
public static final Particle ELECTRIC_SPARK = getParticle("electric_spark"); Particle ELECTRIC_SPARK = getParticle("electric_spark");
public static final Particle SCRAPE = getParticle("scrape"); Particle SCRAPE = getParticle("scrape");
public static final Particle SONIC_BOOM = getParticle("sonic_boom"); Particle SONIC_BOOM = getParticle("sonic_boom");
public static final Particle SCULK_SOUL = getParticle("sculk_soul"); Particle SCULK_SOUL = getParticle("sculk_soul");
/** /**
* Use {@link Float} as DataType * Use {@link Float} as DataType
*/ */
public static final Particle.Typed<Float> SCULK_CHARGE = getParticle("sculk_charge"); Particle.Typed<Float> SCULK_CHARGE = getParticle("sculk_charge");
public static final Particle SCULK_CHARGE_POP = getParticle("sculk_charge_pop"); Particle SCULK_CHARGE_POP = getParticle("sculk_charge_pop");
/** /**
* Use {@link Integer} as DataType * Use {@link Integer} as DataType
*/ */
public static final Particle.Typed<Integer> SHRIEK = getParticle("shriek"); Particle.Typed<Integer> SHRIEK = getParticle("shriek");
public static final Particle CHERRY_LEAVES = getParticle("cherry_leaves"); Particle CHERRY_LEAVES = getParticle("cherry_leaves");
public static final Particle EGG_CRACK = getParticle("egg_crack"); Particle EGG_CRACK = getParticle("egg_crack");
public static final Particle DUST_PLUME = getParticle("dust_plume"); Particle DUST_PLUME = getParticle("dust_plume");
public static final Particle WHITE_SMOKE = getParticle("white_smoke"); Particle WHITE_SMOKE = getParticle("white_smoke");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle GUST = getParticle("gust"); Particle GUST = getParticle("gust");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle SMALL_GUST = getParticle("small_gust"); Particle SMALL_GUST = getParticle("small_gust");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle GUST_EMITTER_LARGE = getParticle("gust_emitter_large"); Particle GUST_EMITTER_LARGE = getParticle("gust_emitter_large");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle GUST_EMITTER_SMALL = getParticle("gust_emitter_small"); Particle GUST_EMITTER_SMALL = getParticle("gust_emitter_small");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle TRIAL_SPAWNER_DETECTION = getParticle("trial_spawner_detection"); Particle TRIAL_SPAWNER_DETECTION = getParticle("trial_spawner_detection");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle TRIAL_SPAWNER_DETECTION_OMINOUS = getParticle("trial_spawner_detection_ominous"); Particle TRIAL_SPAWNER_DETECTION_OMINOUS = getParticle("trial_spawner_detection_ominous");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle VAULT_CONNECTION = getParticle("vault_connection"); Particle VAULT_CONNECTION = getParticle("vault_connection");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle INFESTED = getParticle("infested"); Particle INFESTED = getParticle("infested");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle ITEM_COBWEB = getParticle("item_cobweb"); Particle ITEM_COBWEB = getParticle("item_cobweb");
/** /**
* Uses {@link BlockData} as DataType * Uses {@link BlockData} as DataType
*/ */
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle.Typed<BlockData> DUST_PILLAR = getParticle("dust_pillar"); Particle.Typed<BlockData> DUST_PILLAR = getParticle("dust_pillar");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle OMINOUS_SPAWNING = getParticle("ominous_spawning"); Particle OMINOUS_SPAWNING = getParticle("ominous_spawning");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle RAID_OMEN = getParticle("raid_omen"); Particle RAID_OMEN = getParticle("raid_omen");
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(Requires.UPDATE_1_21) @MinecraftExperimental(Requires.UPDATE_1_21)
public static final Particle TRIAL_OMEN = getParticle("trial_omen"); Particle TRIAL_OMEN = getParticle("trial_omen");
/** /**
* Uses {@link BlockData} as DataType * Uses {@link BlockData} as DataType
*/ */
public static final Particle.Typed<BlockData> BLOCK_MARKER = getParticle("block_marker"); Particle.Typed<BlockData> BLOCK_MARKER = getParticle("block_marker");
@NotNull @NotNull
private static <P extends Particle> P getParticle(@NotNull String key) { private static <P extends Particle> P getParticle(@NotNull String key) {
@ -220,7 +220,7 @@ public abstract class Particle extends OldEnum<Particle> implements Keyed {
* @see #getDataType() * @see #getDataType()
*/ */
@NotNull @NotNull
public abstract <D> Particle.Typed<D> typed(@NotNull Class<D> dataType); <D> Particle.Typed<D> typed(@NotNull Class<D> dataType);
/** /**
* Returns true if this Particle is typed and requires extra data when spawning it. * Returns true if this Particle is typed and requires extra data when spawning it.
@ -229,7 +229,7 @@ public abstract class Particle extends OldEnum<Particle> implements Keyed {
* @see #getDataType() * @see #getDataType()
* @see #typed(Class) * @see #typed(Class)
*/ */
public abstract boolean isTyped(); boolean isTyped();
/** /**
* Returns the required data type for the particle * Returns the required data type for the particle
@ -240,7 +240,7 @@ public abstract class Particle extends OldEnum<Particle> implements Keyed {
* @see #typed(Class) * @see #typed(Class)
*/ */
@NotNull @NotNull
public abstract Class<?> getDataType(); Class<?> getDataType();
/** /**
* Options which can be applied to redstone dust particles - a particle * Options which can be applied to redstone dust particles - a particle
@ -309,7 +309,7 @@ public abstract class Particle extends OldEnum<Particle> implements Keyed {
*/ */
@NotNull @NotNull
@Deprecated @Deprecated
public static Particle valueOf(@NotNull String name) { static Particle valueOf(@NotNull String name) {
Particle particle = Registry.PARTICLE_TYPE.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); Particle particle = Registry.PARTICLE_TYPE.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(particle != null, "No particle found with the name %s", name); Preconditions.checkArgument(particle != null, "No particle found with the name %s", name);
return particle; return particle;
@ -321,7 +321,7 @@ public abstract class Particle extends OldEnum<Particle> implements Keyed {
*/ */
@NotNull @NotNull
@Deprecated @Deprecated
public static Particle[] values() { static Particle[] values() {
return Lists.newArrayList(Registry.PARTICLE_TYPE).toArray(new Particle[0]); return Lists.newArrayList(Registry.PARTICLE_TYPE).toArray(new Particle[0]);
} }
} }

View file

@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
/** /**
* Represents a countable statistic, which is tracked by the server. * Represents a countable statistic, which is tracked by the server.
*/ */
public abstract class Statistic extends OldEnum<Statistic> implements Keyed { public abstract class Statistic implements OldEnum<Statistic>, Keyed {
public static final Statistic DAMAGE_DEALT = getStatistic("damage_dealt"); public static final Statistic DAMAGE_DEALT = getStatistic("damage_dealt");
public static final Statistic DAMAGE_TAKEN = getStatistic("damage_taken"); public static final Statistic DAMAGE_TAKEN = getStatistic("damage_taken");

View file

@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
/** /**
* Types of attributes which may be present on an {@link Attributable}. * Types of attributes which may be present on an {@link Attributable}.
*/ */
public abstract class Attribute extends OldEnum<Attribute> implements Keyed, Translatable { public abstract class Attribute implements OldEnum<Attribute>, Keyed, Translatable {
/** /**
* Maximum health of an Entity. * Maximum health of an Entity.

View file

@ -16,7 +16,7 @@ import org.jetbrains.annotations.NotNull;
* Depending on the server there might be additional biomes present (for example biomes created by data packs), * Depending on the server there might be additional biomes present (for example biomes created by data packs),
* which you can get via {@link Registry#BIOME}. * which you can get via {@link Registry#BIOME}.
*/ */
public abstract class Biome extends OldEnum<Biome> implements Keyed { public abstract class Biome implements OldEnum<Biome>, Keyed {
public static final Biome OCEAN = getBiome("ocean"); public static final Biome OCEAN = getBiome("ocean");
public static final Biome PLAINS = getBiome("plains"); public static final Biome PLAINS = getBiome("plains");

View file

@ -15,7 +15,7 @@ import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public abstract class PatternType extends OldEnum<PatternType> implements Keyed { public abstract class PatternType implements OldEnum<PatternType>, Keyed {
public static final PatternType BASE = getPatternType("base"); public static final PatternType BASE = getPatternType("base");
public static final PatternType SQUARE_BOTTOM_LEFT = getPatternType("square_bottom_left"); public static final PatternType SQUARE_BOTTOM_LEFT = getPatternType("square_bottom_left");
public static final PatternType SQUARE_BOTTOM_RIGHT = getPatternType("square_bottom_right"); public static final PatternType SQUARE_BOTTOM_RIGHT = getPatternType("square_bottom_right");

View file

@ -48,7 +48,7 @@ public interface Cat extends Tameable, Sittable {
/** /**
* Represents the various different cat types there are. * Represents the various different cat types there are.
*/ */
abstract class Type extends OldEnum<Type> implements Keyed { abstract class Type implements OldEnum<Type>, Keyed {
public static final Type TABBY = getType("tabby"); public static final Type TABBY = getType("tabby");
public static final Type BLACK = getType("black"); public static final Type BLACK = getType("black");
public static final Type RED = getType("red"); public static final Type RED = getType("red");

View file

@ -30,7 +30,7 @@ import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public abstract class EntityType extends OldEnum<EntityType> implements Keyed, Translatable { public abstract class EntityType implements OldEnum<EntityType>, Keyed, Translatable {
private static final BiMap<Short, EntityType> ID_MAP = HashBiMap.create(); private static final BiMap<Short, EntityType> ID_MAP = HashBiMap.create();
/** /**

View file

@ -48,7 +48,7 @@ public interface Frog extends Animals {
/** /**
* Represents the variant of a frog - ie its color. * Represents the variant of a frog - ie its color.
*/ */
abstract class Variant extends OldEnum<Variant> implements Keyed { abstract class Variant implements OldEnum<Variant>, Keyed {
/** /**
* Temperate (brown-orange) frog. * Temperate (brown-orange) frog.

View file

@ -122,7 +122,7 @@ public interface Villager extends AbstractVillager {
* Represents Villager type, usually corresponding to what biome they spawn * Represents Villager type, usually corresponding to what biome they spawn
* in. * in.
*/ */
public abstract class Type extends OldEnum<Type> implements Keyed { public abstract class Type implements OldEnum<Type>, Keyed {
public static final Type DESERT = getType("desert"); public static final Type DESERT = getType("desert");
public static final Type JUNGLE = getType("jungle"); public static final Type JUNGLE = getType("jungle");
@ -168,7 +168,7 @@ public interface Villager extends AbstractVillager {
* Represents the various different Villager professions there may be. * Represents the various different Villager professions there may be.
* Villagers have different trading options depending on their profession, * Villagers have different trading options depending on their profession,
*/ */
public abstract class Profession extends OldEnum<Profession> implements Keyed { public abstract class Profession implements OldEnum<Profession>, Keyed {
public static final Profession NONE = getProfession("none"); public static final Profession NONE = getProfession("none");
/** /**
* Armorer profession. Wears a black apron. Armorers primarily trade for * Armorer profession. Wears a black apron. Armorers primarily trade for

View file

@ -17,7 +17,7 @@ import org.jetbrains.annotations.Nullable;
* This class reflects and matches each potion state that can be obtained from * This class reflects and matches each potion state that can be obtained from
* the Creative mode inventory * the Creative mode inventory
*/ */
public abstract class PotionType extends OldEnum<PotionType> implements Keyed { public abstract class PotionType implements OldEnum<PotionType>, Keyed {
public static final PotionType EMPTY = getPotionType("empty"); public static final PotionType EMPTY = getPotionType("empty");
public static final PotionType WATER = getPotionType("water"); public static final PotionType WATER = getPotionType("water");
public static final PotionType MUNDANE = getPotionType("mundane"); public static final PotionType MUNDANE = getPotionType("mundane");

View file

@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull;
* @deprecated only for backwards compatibility. * @deprecated only for backwards compatibility.
*/ */
@Deprecated @Deprecated
public abstract class OldEnum<T extends OldEnum<T>> implements Comparable<T> { public interface OldEnum<T extends OldEnum<T>> extends Comparable<T> {
/** /**
* @param other to compare to. * @param other to compare to.
* @return negative if this old enum is lower, zero if equal and positive if higher than the given old enum. * @return negative if this old enum is lower, zero if equal and positive if higher than the given old enum.
@ -16,7 +16,7 @@ public abstract class OldEnum<T extends OldEnum<T>> implements Comparable<T> {
*/ */
@Deprecated @Deprecated
@Override @Override
public abstract int compareTo(@NotNull T other); int compareTo(@NotNull T other);
/** /**
* @return the name of the old enum. * @return the name of the old enum.
@ -24,12 +24,12 @@ public abstract class OldEnum<T extends OldEnum<T>> implements Comparable<T> {
*/ */
@NotNull @NotNull
@Deprecated @Deprecated
public abstract String name(); String name();
/** /**
* @return the ordinal of the old enum. * @return the ordinal of the old enum.
* @deprecated only for backwards compatibility, it is not guaranteed that an old enum always has the same ordinal. * @deprecated only for backwards compatibility, it is not guaranteed that an old enum always has the same ordinal.
*/ */
@Deprecated @Deprecated
public abstract int ordinal(); int ordinal();
} }