aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-09-23 15:03:52 -0700
committerJake Potrebic <[email protected]>2024-09-23 15:03:52 -0700
commitacdd6d35ad448f5ad06f834c7ef8b0a1a1ab89d9 (patch)
tree617b2794dae854c521b263412218f861091a87ce
parent4514c71a7fb043140b7926c2fa2686f6d56da83d (diff)
downloadPaper-acdd6d35ad448f5ad06f834c7ef8b0a1a1ab89d9.tar.gz
Paper-acdd6d35ad448f5ad06f834c7ef8b0a1a1ab89d9.zip
make MenuType implement FeatureDependant
-rw-r--r--patches/api/0474-Introduce-registry-entry-and-builders.patch9
-rw-r--r--patches/api/0486-Add-FeatureFlag-API.patch13
-rw-r--r--patches/server/1052-Add-FeatureFlag-API.patch18
3 files changed, 35 insertions, 5 deletions
diff --git a/patches/api/0474-Introduce-registry-entry-and-builders.patch b/patches/api/0474-Introduce-registry-entry-and-builders.patch
index 2251dfb44b..89d0b4973e 100644
--- a/patches/api/0474-Introduce-registry-entry-and-builders.patch
+++ b/patches/api/0474-Introduce-registry-entry-and-builders.patch
@@ -361,21 +361,24 @@ index 0000000000000000000000000000000000000000..6c7d8b98103909428bb4dcf14825fe18
+}
diff --git a/src/main/java/io/papermc/paper/registry/data/GameEventRegistryEntry.java b/src/main/java/io/papermc/paper/registry/data/GameEventRegistryEntry.java
new file mode 100644
-index 0000000000000000000000000000000000000000..27b4da08168c7b341b776635011ff4022a12d361
+index 0000000000000000000000000000000000000000..a59620816f8795fc0e585f969741d1940340673a
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/data/GameEventRegistryEntry.java
-@@ -0,0 +1,43 @@
+@@ -0,0 +1,48 @@
+package io.papermc.paper.registry.data;
+
+import io.papermc.paper.registry.RegistryBuilder;
+import org.bukkit.GameEvent;
+import org.checkerframework.checker.nullness.qual.NonNull;
++import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.Range;
+
+/**
+ * A data-centric version-specific registry entry for the {@link GameEvent} type.
+ */
+public interface GameEventRegistryEntry {
+
+ /**
@@ -394,6 +397,8 @@ index 0000000000000000000000000000000000000000..27b4da08168c7b341b776635011ff402
+ * <li>{@link #range(int)}</li>
+ * </ul>
+ */
++ @ApiStatus.Experimental
++ @ApiStatus.NonExtendable
+ interface Builder extends GameEventRegistryEntry, RegistryBuilder<GameEvent> {
+
+ /**
diff --git a/patches/api/0486-Add-FeatureFlag-API.patch b/patches/api/0486-Add-FeatureFlag-API.patch
index e534fd297a..1d1e64605f 100644
--- a/patches/api/0486-Add-FeatureFlag-API.patch
+++ b/patches/api/0486-Add-FeatureFlag-API.patch
@@ -313,6 +313,19 @@ index 0168f0a14a3e899e84c5e36963ff79950ab580fb..5b4449f63595193efcd1329b9df0558c
boolean isEnabledByFeature(@NotNull World world);
/**
+diff --git a/src/main/java/org/bukkit/inventory/MenuType.java b/src/main/java/org/bukkit/inventory/MenuType.java
+index 29dfad691cbdd09d043f6171defc8a7fabbc2b75..5ddc24df90c3a4b9f92a49437e1aa90e3961daf3 100644
+--- a/src/main/java/org/bukkit/inventory/MenuType.java
++++ b/src/main/java/org/bukkit/inventory/MenuType.java
+@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
+ * created and viewed by the player.
+ */
+ @ApiStatus.Experimental
+-public interface MenuType extends Keyed {
++public interface MenuType extends Keyed, io.papermc.paper.world.flag.FeatureDependant { // Paper - make FeatureDependant
+
+ /**
+ * A MenuType which represents a chest with 1 row.
diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java
index 10fa51d116b40450b51af9110d5637f3505ebf65..647452f16e4bf7e5a61520123e62d9408ec9adfb 100644
--- a/src/main/java/org/bukkit/potion/PotionEffectType.java
diff --git a/patches/server/1052-Add-FeatureFlag-API.patch b/patches/server/1052-Add-FeatureFlag-API.patch
index 5f3aa9ba14..9c718a7db4 100644
--- a/patches/server/1052-Add-FeatureFlag-API.patch
+++ b/patches/server/1052-Add-FeatureFlag-API.patch
@@ -233,6 +233,19 @@ index 450c63c31d2f5d056d989aa00452231f50c8224d..b9d9f1df2720c301915c8b07c0bdc129
private final NamespacedKey key;
private final Item item;
+diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMenuType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMenuType.java
+index d658634ea4468c9dbfb29bc12282441c96358566..fbde94b72063da69cc1a1f7934e069c6c8c0f804 100644
+--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMenuType.java
++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMenuType.java
+@@ -18,7 +18,7 @@ import org.bukkit.entity.HumanEntity;
+ import org.bukkit.inventory.InventoryView;
+ import org.bukkit.inventory.MenuType;
+
+-public class CraftMenuType<V extends InventoryView> implements MenuType.Typed<V>, Handleable<net.minecraft.world.inventory.MenuType<?>> {
++public class CraftMenuType<V extends InventoryView> implements MenuType.Typed<V>, Handleable<net.minecraft.world.inventory.MenuType<?>>, io.papermc.paper.world.flag.PaperFeatureDependent { // Paper - make FeatureDependant
+
+ private final NamespacedKey key;
+ private final net.minecraft.world.inventory.MenuType<?> handle;
diff --git a/src/main/java/org/bukkit/craftbukkit/packs/CraftDataPack.java b/src/main/java/org/bukkit/craftbukkit/packs/CraftDataPack.java
index 9525a7d4602b9b98dcc5e5e60dbcb628a656ae53..a0c0ad832726dcf9c8c25c1cfce2a6ddf770bf0f 100644
--- a/src/main/java/org/bukkit/craftbukkit/packs/CraftDataPack.java
@@ -310,10 +323,10 @@ index 0000000000000000000000000000000000000000..c3e6b96013f6dd0b784bd867196552d9
+io.papermc.paper.world.flag.PaperFeatureFlagProviderImpl
diff --git a/src/test/java/io/papermc/paper/world/flag/FeatureFlagTest.java b/src/test/java/io/papermc/paper/world/flag/FeatureFlagTest.java
new file mode 100644
-index 0000000000000000000000000000000000000000..1fd830b148468e1db84e0e27d54c4fd6449fa9d8
+index 0000000000000000000000000000000000000000..4817040741de8b0e12c96994f59b58681c09852d
--- /dev/null
+++ b/src/test/java/io/papermc/paper/world/flag/FeatureFlagTest.java
-@@ -0,0 +1,99 @@
+@@ -0,0 +1,98 @@
+package io.papermc.paper.world.flag;
+
+import io.papermc.paper.adventure.PaperAdventure;
@@ -380,7 +393,6 @@ index 0000000000000000000000000000000000000000..1fd830b148468e1db84e0e27d54c4fd6
+ static Set<RegistryKey<?>> featureFilteredRegistries() {
+ final Set<RegistryKey<?>> registryKeys = new HashSet<>();
+ for (final ResourceKey filteredRegistry : FeatureElement.FILTERED_REGISTRIES) {
-+ if (filteredRegistry == Registries.MENU) continue; // not applicable atm
+ registryKeys.add(PaperRegistries.registryFromNms(filteredRegistry));
+ }
+ return registryKeys;