mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 13:42:25 -07:00
#1029: Trial changing a small number of inner enums to classes/interfaces to better support custom values
This PR is a subset of the enum PR #660 and is designed as a low impact trial run of the design and backwards compatibility to inform subsequent development. Additional plugin compatibility features may be available by setting `settings.compatibility.enum-compatibility-mode` to `true` in `bukkit.yml`. By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -134,7 +134,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
*
|
||||
* @see Cat.Type
|
||||
*/
|
||||
Registry<Cat.Type> CAT_VARIANT = new SimpleRegistry<>(Cat.Type.class);
|
||||
Registry<Cat.Type> CAT_VARIANT = Objects.requireNonNull(Bukkit.getRegistry(Cat.Type.class), "No registry present for Cat Type. This is a bug.");
|
||||
/**
|
||||
* Server enchantments.
|
||||
*
|
||||
@@ -248,13 +248,13 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
*
|
||||
* @see Villager.Profession
|
||||
*/
|
||||
Registry<Villager.Profession> VILLAGER_PROFESSION = new SimpleRegistry<>(Villager.Profession.class);
|
||||
Registry<Villager.Profession> VILLAGER_PROFESSION = Objects.requireNonNull(Bukkit.getRegistry(Villager.Profession.class), "No registry present for Villager Profession. This is a bug.");
|
||||
/**
|
||||
* Villager type.
|
||||
*
|
||||
* @see Villager.Type
|
||||
*/
|
||||
Registry<Villager.Type> VILLAGER_TYPE = new SimpleRegistry<>(Villager.Type.class);
|
||||
Registry<Villager.Type> VILLAGER_TYPE = Objects.requireNonNull(Bukkit.getRegistry(Villager.Type.class), "No registry present for Villager Type. This is a bug.");
|
||||
/**
|
||||
* Memory Keys.
|
||||
*
|
||||
@@ -291,7 +291,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
*
|
||||
* @see Frog.Variant
|
||||
*/
|
||||
Registry<Frog.Variant> FROG_VARIANT = new SimpleRegistry<>(Frog.Variant.class);
|
||||
Registry<Frog.Variant> FROG_VARIANT = Objects.requireNonNull(Bukkit.getRegistry(Frog.Variant.class), "No registry present for Frog Variant. This is a bug.");
|
||||
/**
|
||||
* Wolf variants.
|
||||
*
|
||||
@@ -304,7 +304,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
* @see MapCursor.Type
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
Registry<MapCursor.Type> MAP_DECORATION_TYPE = new SimpleRegistry<>(MapCursor.Type.class);
|
||||
Registry<MapCursor.Type> MAP_DECORATION_TYPE = Objects.requireNonNull(Bukkit.getRegistry(MapCursor.Type.class), "No registry present for MapCursor Type. This is a bug.");
|
||||
/**
|
||||
* Game events.
|
||||
*
|
||||
|
Reference in New Issue
Block a user