mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
Update getKey impls for inlineable types
This commit is contained in:
parent
04df9cac25
commit
e7ac163b76
1 changed files with 60 additions and 0 deletions
|
@ -4,6 +4,30 @@ Date: Wed, 20 Dec 2023 02:03:05 -0800
|
|||
Subject: [PATCH] Improve Registry
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftArt.java b/src/main/java/org/bukkit/craftbukkit/CraftArt.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftArt.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftArt.java
|
||||
@@ -0,0 +0,0 @@ public class CraftArt implements Art, Handleable<PaintingVariant> {
|
||||
@NotNull
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
+ if (true) return java.util.Objects.requireNonNull(org.bukkit.Registry.ART.getKey(this), () -> this + " doesn't have a key"); // Paper
|
||||
return this.key;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftMusicInstrument.java b/src/main/java/org/bukkit/craftbukkit/CraftMusicInstrument.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftMusicInstrument.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftMusicInstrument.java
|
||||
@@ -0,0 +0,0 @@ public class CraftMusicInstrument extends MusicInstrument implements Handleable<
|
||||
@NotNull
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
+ if (true) return java.util.Objects.requireNonNull(org.bukkit.Registry.INSTRUMENT.getKey(this), () -> this + " doesn't have a key"); // Paper
|
||||
return this.key;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
|
@ -36,6 +60,42 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ // Paper end - improve Registry
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
@@ -0,0 +0,0 @@ public class CraftSound implements Sound, Handleable<SoundEvent> {
|
||||
@NotNull
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
+ if (true) return java.util.Objects.requireNonNull(org.bukkit.Registry.SOUNDS.getKey(this), () -> this + " doesn't have a key"); // Paper
|
||||
return this.key;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/banner/CraftPatternType.java b/src/main/java/org/bukkit/craftbukkit/block/banner/CraftPatternType.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/banner/CraftPatternType.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/banner/CraftPatternType.java
|
||||
@@ -0,0 +0,0 @@ public class CraftPatternType implements PatternType, Handleable<BannerPattern>
|
||||
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
+ if (true) return java.util.Objects.requireNonNull(org.bukkit.Registry.BANNER_PATTERN.getKey(this), () -> this + " doesn't have a key"); // Paper
|
||||
return this.key;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/structure/CraftStructure.java b/src/main/java/org/bukkit/craftbukkit/generator/structure/CraftStructure.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/generator/structure/CraftStructure.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/generator/structure/CraftStructure.java
|
||||
@@ -0,0 +0,0 @@ public class CraftStructure extends Structure implements Handleable<net.minecraf
|
||||
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
+ if (true) return java.util.Objects.requireNonNull(org.bukkit.Registry.STRUCTURE.getKey(this), () -> this + " doesn't have a key"); // Paper
|
||||
return this.key;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMaterial.java b/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMaterial.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMaterial.java
|
||||
|
|
Loading…
Reference in a new issue