Experimental annotation changes (#10914)

* Experimental annotation changes

* wind charge damage type is not experimental anymore
This commit is contained in:
Lulu13022002 2024-06-20 18:03:09 +02:00 committed by GitHub
parent cf60574a2f
commit 666bc4dbb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 141 additions and 30 deletions

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Sat, 9 Dec 2023 11:47:53 -0800
Subject: [PATCH] add missing Experimental annotations
Subject: [PATCH] Experimental annotations change
diff --git a/src/main/java/org/bukkit/FeatureFlag.java b/src/main/java/org/bukkit/FeatureFlag.java
@ -68,6 +68,132 @@ index 8bfec649f7c6dda956bc388a21b489f3565ff384..a303bb1a8d8b5749de5d69d079383e6d
Tag<EntityType> ENTITY_TYPES_CAN_TURN_IN_BOATS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_turn_in_boats"), EntityType.class);
/**
* Vanilla tag representing all entities sensitive to illager enchantments.
diff --git a/src/main/java/org/bukkit/block/Crafter.java b/src/main/java/org/bukkit/block/Crafter.java
index 8d2dd78fc588a6817dfede8040b9909a7d5bde67..f737a2aae3f57a1bfe4cf68ea66f603da4eebd47 100644
--- a/src/main/java/org/bukkit/block/Crafter.java
+++ b/src/main/java/org/bukkit/block/Crafter.java
@@ -6,7 +6,6 @@ import org.jetbrains.annotations.ApiStatus;
/**
* Represents a captured state of a crafter.
*/
-@ApiStatus.Experimental
public interface Crafter extends Container, com.destroystokyo.paper.loottable.LootableBlockInventory { // Paper - LootTable API
/**
diff --git a/src/main/java/org/bukkit/block/TrialSpawner.java b/src/main/java/org/bukkit/block/TrialSpawner.java
index 901fea45682ee6be3de3986322509d39f65c7bf6..1c1a91658892941f54934037319ca8f93d764198 100644
--- a/src/main/java/org/bukkit/block/TrialSpawner.java
+++ b/src/main/java/org/bukkit/block/TrialSpawner.java
@@ -5,6 +5,5 @@ import org.jetbrains.annotations.ApiStatus;
/**
* Represents a captured state of a trial spawner.
*/
-@ApiStatus.Experimental
public interface TrialSpawner extends TileState {
}
diff --git a/src/main/java/org/bukkit/block/Vault.java b/src/main/java/org/bukkit/block/Vault.java
index f0c5d27f6f1ff56ffe4b88dfdce8d0b7f06d19e1..375f41fe4aebdbf140497b5ba1e54e1c72f0cdfc 100644
--- a/src/main/java/org/bukkit/block/Vault.java
+++ b/src/main/java/org/bukkit/block/Vault.java
@@ -5,6 +5,5 @@ import org.jetbrains.annotations.ApiStatus;
/**
* Represents a captured state of a trial spawner.
*/
-@ApiStatus.Experimental
public interface Vault extends TileState {
}
diff --git a/src/main/java/org/bukkit/entity/AbstractWindCharge.java b/src/main/java/org/bukkit/entity/AbstractWindCharge.java
index 60fbacee263e55f91ac977f020e390d46024723a..ecff691c3a0878659fb051926ef769ce1e339c48 100644
--- a/src/main/java/org/bukkit/entity/AbstractWindCharge.java
+++ b/src/main/java/org/bukkit/entity/AbstractWindCharge.java
@@ -5,7 +5,6 @@ import org.jetbrains.annotations.ApiStatus;
/**
* Represents a Wind Charge.
*/
-@ApiStatus.Experimental
public interface AbstractWindCharge extends Fireball {
/**
diff --git a/src/main/java/org/bukkit/entity/Bogged.java b/src/main/java/org/bukkit/entity/Bogged.java
index a36bb84c17120bc578ab01d45f6f12fb1faf9548..719bccf8638f8ad358d37fa7eeccbc4c08d32868 100644
--- a/src/main/java/org/bukkit/entity/Bogged.java
+++ b/src/main/java/org/bukkit/entity/Bogged.java
@@ -5,6 +5,5 @@ import org.jetbrains.annotations.ApiStatus;
/**
* Represents a Bogged Skeleton.
*/
-@ApiStatus.Experimental
public interface Bogged extends AbstractSkeleton, io.papermc.paper.entity.Shearable { // Paper - Shear API
}
diff --git a/src/main/java/org/bukkit/entity/Breeze.java b/src/main/java/org/bukkit/entity/Breeze.java
index a75e725805c193a408683885cba83ca168347165..254bc6e18961a72f471334cc0535e3c7a9d70012 100644
--- a/src/main/java/org/bukkit/entity/Breeze.java
+++ b/src/main/java/org/bukkit/entity/Breeze.java
@@ -5,6 +5,5 @@ import org.jetbrains.annotations.ApiStatus;
/**
* Represents a Breeze. Whoosh!
*/
-@ApiStatus.Experimental
public interface Breeze extends Monster {
}
diff --git a/src/main/java/org/bukkit/entity/BreezeWindCharge.java b/src/main/java/org/bukkit/entity/BreezeWindCharge.java
index 06ca3dc4b0b69cbaefa96464dce484cea93e0717..748e58eb93c7882e15d9cbdd56d11bb14808698b 100644
--- a/src/main/java/org/bukkit/entity/BreezeWindCharge.java
+++ b/src/main/java/org/bukkit/entity/BreezeWindCharge.java
@@ -5,7 +5,6 @@ import org.jetbrains.annotations.ApiStatus;
/**
* Represents a Wind Charge.
*/
-@ApiStatus.Experimental
public interface BreezeWindCharge extends AbstractWindCharge {
}
diff --git a/src/main/java/org/bukkit/entity/OminousItemSpawner.java b/src/main/java/org/bukkit/entity/OminousItemSpawner.java
index 60522888bc320ba0a55655532e19185fac816bd1..764e058c37eeedaff617c2672b8c446d2a1d6848 100644
--- a/src/main/java/org/bukkit/entity/OminousItemSpawner.java
+++ b/src/main/java/org/bukkit/entity/OminousItemSpawner.java
@@ -7,7 +7,6 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents an ominous item spawner.
*/
-@ApiStatus.Experimental
public interface OminousItemSpawner extends Entity {
/**
diff --git a/src/main/java/org/bukkit/entity/WindCharge.java b/src/main/java/org/bukkit/entity/WindCharge.java
index 4adc91ba3dff00ab44303778e9d4499f7808ad00..beb62426490a361af793fb530106d8547a83ae03 100644
--- a/src/main/java/org/bukkit/entity/WindCharge.java
+++ b/src/main/java/org/bukkit/entity/WindCharge.java
@@ -5,7 +5,6 @@ import org.jetbrains.annotations.ApiStatus;
/**
* Represents a Wind Charge.
*/
-@ApiStatus.Experimental
public interface WindCharge extends AbstractWindCharge {
}
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
index fbdbd2f4da5e09d4b111ddcf72e2d7dd59046bd7..126d60a4d0b3b140b922fb24aa425e805892ad32 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -146,7 +146,6 @@ public enum InventoryType {
/**
* A crafter inventory, with 9 CRAFTING slots.
*/
- @ApiStatus.Experimental
CRAFTER(9, "Crafter"),
/**
* The new smithing inventory, with 3 CRAFTING slots and 1 RESULT slot.
diff --git a/src/main/java/org/bukkit/inventory/CrafterInventory.java b/src/main/java/org/bukkit/inventory/CrafterInventory.java
index bb1fb5e0518c6a62ef8b206733ee51d831f1f85b..49d0a37bbeb0b8fa9207164c74245ef05485467c 100644
--- a/src/main/java/org/bukkit/inventory/CrafterInventory.java
+++ b/src/main/java/org/bukkit/inventory/CrafterInventory.java
@@ -5,5 +5,4 @@ import org.jetbrains.annotations.ApiStatus;
/**
* Interface to the inventory of a Crafter.
*/
-@ApiStatus.Experimental
public interface CrafterInventory extends Inventory { }
diff --git a/src/main/java/org/bukkit/inventory/meta/BundleMeta.java b/src/main/java/org/bukkit/inventory/meta/BundleMeta.java
index e404cd1e2ba44e4c2d09524bc7cf730d8ffbdabd..cea0ebf50876dd32ab7fba6025b30f297d0a69c4 100644
--- a/src/main/java/org/bukkit/inventory/meta/BundleMeta.java
@ -81,10 +207,10 @@ index e404cd1e2ba44e4c2d09524bc7cf730d8ffbdabd..cea0ebf50876dd32ab7fba6025b30f29
public interface BundleMeta extends ItemMeta {
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index 82993302cb3cf62ad4a94a0ebaa7711cc4d8e550..44773ab211f11e924aadea14b965ec52b0483377 100644
index 82993302cb3cf62ad4a94a0ebaa7711cc4d8e550..bd37310d27e73bfe65d680594f3a9be8577a72a0 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -309,12 +309,25 @@ public final class MapCursor {
@@ -309,12 +309,26 @@ public final class MapCursor {
BANNER_RED(24, "banner_red"),
BANNER_BLACK(25, "banner_black"),
RED_X(26, "red_x"),
@ -107,6 +233,7 @@ index 82993302cb3cf62ad4a94a0ebaa7711cc4d8e550..44773ab211f11e924aadea14b965ec52
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
JUNGLE_TEMPLE(32, "jungle_temple"),
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
SWAMP_HUT(33, "swamp_hut"),
TRIAL_CHAMBERS(34, "trial_chambers")
;

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add missing InventoryType
Upstream did not add a DECORATED_POT inventory type
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
index fbdbd2f4da5e09d4b111ddcf72e2d7dd59046bd7..851e40dc8af6dcb5670785e006b078af7e72fb76 100644
index 126d60a4d0b3b140b922fb24aa425e805892ad32..398f74ba0d2e890fb556cd964f61da7c623a7c6d 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -143,6 +143,12 @@ public enum InventoryType {

View File

@ -5,30 +5,14 @@ Subject: [PATCH] Add missing wind charge damage type
diff --git a/src/main/java/org/bukkit/damage/DamageType.java b/src/main/java/org/bukkit/damage/DamageType.java
index 69abda41ef3a1d8948982d16b193a9a565fafa38..9ec1abbd741198705d2a7685bbd2e2660679461d 100644
index 69abda41ef3a1d8948982d16b193a9a565fafa38..387f04a8201d62ab86450de043772049212a8bce 100644
--- a/src/main/java/org/bukkit/damage/DamageType.java
+++ b/src/main/java/org/bukkit/damage/DamageType.java
@@ -66,6 +66,10 @@ public interface DamageType extends Keyed, Translatable {
@@ -66,6 +66,7 @@ public interface DamageType extends Keyed, Translatable {
public static final DamageType BAD_RESPAWN_POINT = getDamageType("bad_respawn_point");
public static final DamageType OUTSIDE_BORDER = getDamageType("outside_border");
public static final DamageType GENERIC_KILL = getDamageType("generic_kill");
+ // Paper start
+ @org.jetbrains.annotations.Nullable
+ DamageType WIND_CHARGE = getExperimentalDamageType("wind_charge");
+ // Paper end
+ DamageType WIND_CHARGE = getDamageType("wind_charge"); // Paper
@NotNull
private static DamageType getDamageType(@NotNull String key) {
@@ -73,6 +77,12 @@ public interface DamageType extends Keyed, Translatable {
return Preconditions.checkNotNull(Registry.DAMAGE_TYPE.get(namespacedKey), "No DamageType found for %s. This is a bug.", namespacedKey);
}
+ // Paper start
+ private static @org.jetbrains.annotations.Nullable DamageType getExperimentalDamageType(@NotNull String key) {
+ return Registry.DAMAGE_TYPE.get(NamespacedKey.minecraft(key));
+ }
+ // Paper end
+
/**
* {@inheritDoc}
* <p>

View File

@ -23,7 +23,7 @@ index 76daccf4ea502e1747a6f9176dc16fd20c561286..2945dde566682f977e84fde5d473a6c6
diff --git a/src/main/java/io/papermc/paper/registry/data/EnchantmentRegistryEntry.java b/src/main/java/io/papermc/paper/registry/data/EnchantmentRegistryEntry.java
new file mode 100644
index 0000000000000000000000000000000000000000..4e010d213c165abbdbf784431bf0b78179d079be
index 0000000000000000000000000000000000000000..6c7d8b98103909428bb4dcf14825fe188db6d12f
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/data/EnchantmentRegistryEntry.java
@@ -0,0 +1,332 @@
@ -74,11 +74,11 @@ index 0000000000000000000000000000000000000000..4e010d213c165abbdbf784431bf0b781
+ * Provides the registry key set referencing the item types this enchantment can be applied to when
+ * enchanting in an enchantment table.
+ * <p>
+ * If this value is null, {@link #supportedItems()} will be sourced instead in the context of an enchantment table.
+ * If this value is {@code null}, {@link #supportedItems()} will be sourced instead in the context of an enchantment table.
+ * Additionally, the tag {@link io.papermc.paper.registry.keys.tags.EnchantmentTagKeys#IN_ENCHANTING_TABLE} defines
+ * which enchantments can even show up in an enchantment table.
+ *
+ * @return the tag key.
+ * @return the registry key set.
+ */
+ @Nullable RegistryKeySet<ItemType> primaryItems();
+
@ -127,7 +127,7 @@ index 0000000000000000000000000000000000000000..4e010d213c165abbdbf784431bf0b781
+ * information.
+ * </p>
+ *
+ * @return The anvil cost of this enchantment
+ * @return the anvil cost of this enchantment
+ */
+ @Range(from = 0, to = Integer.MAX_VALUE) int anvilCost();
+
@ -189,7 +189,7 @@ index 0000000000000000000000000000000000000000..4e010d213c165abbdbf784431bf0b781
+ * {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_ARMOR} and
+ * {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_SWORD}.
+ *
+ * @param supportedItems the tag key representing the supported items.
+ * @param supportedItems the registry key set representing the supported items.
+ * @return this builder.
+ * @see RegistrySet#keySet(RegistryKey, TypedKey[])
+ * @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
@ -210,7 +210,7 @@ index 0000000000000000000000000000000000000000..4e010d213c165abbdbf784431bf0b781
+ * Additionally, the tag {@link io.papermc.paper.registry.keys.tags.EnchantmentTagKeys#IN_ENCHANTING_TABLE} defines
+ * which enchantments can even show up in an enchantment table.
+ *
+ * @param primaryItems the tag key representing the primary items.
+ * @param primaryItems the registry key set representing the primary items.
+ * @return this builder.
+ * @see RegistrySet#keySet(RegistryKey, TypedKey[])
+ * @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
@ -270,7 +270,7 @@ index 0000000000000000000000000000000000000000..4e010d213c165abbdbf784431bf0b781
+ * See <a href="https://minecraft.wiki/w/Anvil_mechanics">https://minecraft.wiki/w/Anvil_mechanics</a> for more information.
+ * </p>
+ *
+ * @param anvilCost The anvil cost of this enchantment
+ * @param anvilCost the anvil cost of this enchantment
+ * @return this builder.
+ * @see Enchantment#getAnvilCost()
+ */