2022-01-23 19:12:42 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Sat, 14 Aug 2021 16:19:03 -0700
|
|
|
|
Subject: [PATCH] Expand the Registry API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
|
2022-06-07 17:20:30 +00:00
|
|
|
index 04d7fbd93131b9530add1e99b8443cc4d08be9d2..88b7422f26036b6a44e085c8bbc3174ddc27beda 100644
|
2022-01-23 19:12:42 +00:00
|
|
|
--- a/src/main/java/org/bukkit/Registry.java
|
|
|
|
+++ b/src/main/java/org/bukkit/Registry.java
|
2022-06-07 17:20:30 +00:00
|
|
|
@@ -221,6 +221,25 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
2022-01-23 19:12:42 +00:00
|
|
|
return Arrays.stream(org.bukkit.potion.PotionEffectType.values()).iterator();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Structure types.
|
|
|
|
+ *
|
|
|
|
+ * @see StructureType
|
|
|
|
+ */
|
|
|
|
+ Registry<StructureType> STRUCTURE_TYPE = new Registry<StructureType>() {
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public @Nullable StructureType get(@NotNull NamespacedKey key) {
|
|
|
|
+ return StructureType.getStructureTypes().get(key.getKey());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @NotNull
|
|
|
|
+ @Override
|
|
|
|
+ public Iterator<StructureType> iterator() {
|
|
|
|
+ return StructureType.getStructureTypes().values().iterator();
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
/**
|