make MenuType implement FeatureDependant

This commit is contained in:
Jake Potrebic 2024-09-23 15:03:52 -07:00
parent f137f3cf13
commit 660700a1d3
3 changed files with 31 additions and 1 deletions

View File

@ -313,6 +313,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/MenuType.java
+++ b/src/main/java/org/bukkit/inventory/MenuType.java
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/potion/PotionEffectType.java

View File

@ -370,12 +370,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+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.
+ */
+@ApiStatus.Experimental
+@ApiStatus.NonExtendable
+public interface GameEventRegistryEntry {
+
+ /**
@ -394,6 +397,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * <li>{@link #range(int)}</li>
+ * </ul>
+ */
+ @ApiStatus.Experimental
+ @ApiStatus.NonExtendable
+ interface Builder extends GameEventRegistryEntry, RegistryBuilder<GameEvent> {
+
+ /**

View File

@ -233,6 +233,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMenuType.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMenuType.java
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/packs/CraftDataPack.java
@ -380,7 +393,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ 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;