Fix NPE with enchantable (#11557)
This commit is contained in:
@@ -223,11 +223,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
* Attribute.
|
||||
*
|
||||
* @see Attribute
|
||||
+ * @deprecated use {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)} with {@link io.papermc.paper.registry.RegistryKey#ATTRIBUTE}
|
||||
*/
|
||||
- Registry<Attribute> ATTRIBUTE = Objects.requireNonNull(Bukkit.getRegistry(Attribute.class), "No registry present for Attribute. This is a bug.");
|
||||
+ @Deprecated(since = "1.21.3") // Paper
|
||||
+ Registry<Attribute> ATTRIBUTE = Objects.requireNonNull(io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(Attribute.class), "No registry present for Attribute. This is a bug.");
|
||||
+ Registry<Attribute> ATTRIBUTE = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.ATTRIBUTE); // Paper
|
||||
/**
|
||||
* Server banner patterns.
|
||||
*
|
||||
@@ -277,11 +275,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
* Server entity types.
|
||||
*
|
||||
@@ -0,0 +0,0 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
* Server instruments.
|
||||
*
|
||||
* @see MusicInstrument
|
||||
+ * @deprecated use {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)} with {@link io.papermc.paper.registry.RegistryKey#INSTRUMENT}
|
||||
*/
|
||||
- Registry<MusicInstrument> INSTRUMENT = Objects.requireNonNull(Bukkit.getRegistry(MusicInstrument.class), "No registry present for MusicInstrument. This is a bug.");
|
||||
+ Registry<MusicInstrument> INSTRUMENT = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.INSTRUMENT); // Paper
|
||||
+ @Deprecated(since = "1.21.2")
|
||||
+ Registry<MusicInstrument> INSTRUMENT = Objects.requireNonNull(io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(MusicInstrument.class), "No registry present for Instruments. This is a bug."); // Paper
|
||||
/**
|
||||
* Server item types.
|
||||
*
|
||||
@@ -389,14 +390,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
* Memory Keys.
|
||||
*
|
||||
@@ -0,0 +0,0 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
* Server fluids.
|
||||
*
|
||||
* @see Fluid
|
||||
+ * @deprecated use {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)} with {@link io.papermc.paper.registry.RegistryKey#FLUID}
|
||||
*/
|
||||
- Registry<Fluid> FLUID = Objects.requireNonNull(Bukkit.getRegistry(Fluid.class), "No registry present for Fluid. This is a bug.");
|
||||
+ @Deprecated(since = "1.21.3")
|
||||
+ Registry<Fluid> FLUID = Objects.requireNonNull(io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(Fluid.class), "No registry present for Fluid. This is a bug.");
|
||||
+ Registry<Fluid> FLUID = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.FLUID); // Paper
|
||||
/**
|
||||
* Frog variants.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user