Add missing experimental field and annotations (#10653)

This commit is contained in:
Lulu13022002 2024-05-05 18:00:54 +02:00
parent 252c489f15
commit b94c74495e
3 changed files with 214 additions and 4 deletions

View file

@ -0,0 +1,36 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Date: Fri, 3 May 2024 22:56:12 +0200
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/damage/DamageType.java
+++ b/src/main/java/org/bukkit/damage/DamageType.java
@@ -0,0 +0,0 @@ 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.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21)
+ @ApiStatus.Experimental
+ @org.jetbrains.annotations.Nullable
+ DamageType WIND_CHARGE = getExperimentalDamageType("wind_charge");
+ // Paper end
@NotNull
private static DamageType getDamageType(@NotNull String key) {
@@ -0,0 +0,0 @@ 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

@ -281,6 +281,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
MACE(4771, 1, 250),
ITEM_FRAME(27318),
GLOW_ITEM_FRAME(26473),
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
MOJANG_BANNER_PATTERN(11903, 1),
GLOBE_BANNER_PATTERN(27753, 1),
PIGLIN_BANNER_PATTERN(22028, 1),
+ @MinecraftExperimental(Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
FLOW_BANNER_PATTERN(32683, 1),
+ @MinecraftExperimental(Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
GUSTER_BANNER_PATTERN(27267, 1),
GOAT_HORN(28237, 1),
/**
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
RAISER_ARMOR_TRIM_SMITHING_TEMPLATE(29116),
HOST_ARMOR_TRIM_SMITHING_TEMPLATE(12165),
@ -784,10 +796,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ENTITY_WITCH_AMBIENT("entity.witch.ambient"),
ENTITY_WITCH_CELEBRATE("entity.witch.celebrate"),
@@ -0,0 +0,0 @@ public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type { // Pa
ENTITY_ZOMBIFIED_PIGLIN_ANGRY("entity.zombified_piglin.angry"),
ENTITY_ZOMBIFIED_PIGLIN_DEATH("entity.zombified_piglin.death"),
ENTITY_ZOMBIFIED_PIGLIN_HURT("entity.zombified_piglin.hurt"),
@MinecraftExperimental(Requires.UPDATE_1_21)
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
- @MinecraftExperimental(Requires.UPDATE_1_21)
EVENT_MOB_EFFECT_BAD_OMEN("event.mob_effect.bad_omen"),
@MinecraftExperimental(Requires.UPDATE_1_21)
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
@ -851,11 +863,30 @@ diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.ja
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/Tag.java
+++ b/src/main/java/org/bukkit/Tag.java
@@ -0,0 +0,0 @@ public interface Tag<T extends Keyed> extends Keyed {
/**
* Vanilla block tag representing all blocks which block wind charge explosions.
*/
+ @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
Tag<Material> BLOCKS_WIND_CHARGE_EXPLOSIONS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("blocks_wind_charge_explosions"), Material.class);
/**
* Vanilla block tag representing solid blocks which do not block hopper operation.
@@ -0,0 +0,0 @@ public interface Tag<T extends Keyed> extends Keyed {
/**
* Vanilla item tag representing all items enchantable with mace enchantments.
*/
+ @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
Tag<Material> ITEMS_ENCHANTABLE_MACE = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/mace"), Material.class);
/**
* Vanilla item tag representing all items that confer freeze immunity on
@@ -0,0 +0,0 @@ public interface Tag<T extends Keyed> extends Keyed {
/**
* Vanilla tag representing entities which deflect projectiles.
*/
+ @org.jetbrains.annotations.ApiStatus.Experimental @MinecraftExperimental(value = MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
Tag<EntityType> ENTITY_TYPES_DEFLECTS_PROJECTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("deflects_projectiles"), EntityType.class);
/**
* Vanilla tag representing entities which deflect arrows.
@ -863,10 +894,73 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
* Vanilla tag representing entities which can turn in boats.
*/
+ @org.jetbrains.annotations.ApiStatus.Experimental @MinecraftExperimental(value = MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
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.
@@ -0,0 +0,0 @@ public interface Tag<T extends Keyed> extends Keyed {
/**
* Vanilla tag representing all entities which do not receive anger from wind charges.
*/
+ @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
Tag<EntityType> ENTITY_TYPES_NO_ANGER_FROM_WIND_CHARGE = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("no_anger_from_wind_charge"), EntityType.class);
/**
* Vanilla tag representing all entities which are immune from the oozing effect.
*/
+ @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
Tag<EntityType> ENTITY_TYPES_IMMUNE_TO_OOZING = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("immune_to_oozing"), EntityType.class);
/**
* Vanilla tag representing all entities which are immune from the infested effect.
*/
+ @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
Tag<EntityType> ENTITY_TYPES_IMMUNE_TO_INFESTED = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("immune_to_infested"), EntityType.class);
/**
* Vanilla tag representing all projectiles which can be punched back.
diff --git a/src/main/java/org/bukkit/block/banner/PatternType.java b/src/main/java/org/bukkit/block/banner/PatternType.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/block/banner/PatternType.java
+++ b/src/main/java/org/bukkit/block/banner/PatternType.java
@@ -0,0 +0,0 @@ public enum PatternType implements Keyed {
GLOBE("glb", "globe"),
PIGLIN("pig", "piglin"),
@MinecraftExperimental(Requires.UPDATE_1_21)
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
FLOW("flw", "flow"),
@MinecraftExperimental(Requires.UPDATE_1_21)
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
GUSTER("gus", "guster");
private final String identifier;
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
@@ -0,0 +0,0 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
* Increases fall damage of maces
*/
@MinecraftExperimental(Requires.UPDATE_1_21)
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final Enchantment DENSITY = getEnchantment("density");
/**
* Reduces armor effectiveness against maces
*/
@MinecraftExperimental(Requires.UPDATE_1_21)
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final Enchantment BREACH = getEnchantment("breach");
/**
* Emits wind burst upon hitting enemy
*/
@MinecraftExperimental(Requires.UPDATE_1_21)
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final Enchantment WIND_BURST = getEnchantment("wind_burst");
/**
diff --git a/src/main/java/org/bukkit/generator/structure/Structure.java b/src/main/java/org/bukkit/generator/structure/Structure.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/generator/structure/Structure.java
@ -879,6 +973,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public static final Structure TRIAL_CHAMBERS = getStructure("trial_chambers");
private static Structure getStructure(String name) {
diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
+++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
@@ -0,0 +0,0 @@ public interface TrimPattern extends Keyed, Translatable {
/**
* {@link Material#FLOW_ARMOR_TRIM_SMITHING_TEMPLATE}.
*/
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final TrimPattern FLOW = Registry.TRIM_PATTERN.get(NamespacedKey.minecraft("flow"));
/**
* {@link Material#BOLT_ARMOR_TRIM_SMITHING_TEMPLATE}.
*/
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final TrimPattern BOLT = Registry.TRIM_PATTERN.get(NamespacedKey.minecraft("bolt"));
// Paper start - adventure
diff --git a/src/main/java/org/bukkit/loot/LootTables.java b/src/main/java/org/bukkit/loot/LootTables.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/loot/LootTables.java
@ -968,6 +1081,54 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
TRIAL_CHAMBER_ITEMS_TO_DROP_WHEN_OMINOUS("spawners/trial_chamber/items_to_drop_when_ominous"),
// Shearing
SHEARING_BOGGED("shearing/bogged"),
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
+++ b/src/main/java/org/bukkit/potion/PotionEffectType.java
@@ -0,0 +0,0 @@ public abstract class PotionEffectType implements Keyed, Translatable, net.kyori
/**
* Causes trial spawners to become ominous.
*/
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final PotionEffectType TRIAL_OMEN = getPotionEffectType(34, "trial_omen");
/**
* Triggers a raid when a player enters a village.
*/
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final PotionEffectType RAID_OMEN = getPotionEffectType(35, "raid_omen");
/**
* Emits a wind burst upon death.
*/
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final PotionEffectType WIND_CHARGED = getPotionEffectType(36, "wind_charged");
/**
* Creates cobwebs upon death.
*/
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final PotionEffectType WEAVING = getPotionEffectType(37, "weaving");
/**
* Causes slimes to spawn upon death.
*/
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final PotionEffectType OOZING = getPotionEffectType(38, "oozing");
/**
* Chance of spawning silverfish when hurt.
*/
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final PotionEffectType INFESTED = getPotionEffectType(39, "infested");
@NotNull
diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/potion/PotionType.java

View file

@ -337,6 +337,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+public @interface MethodParameterSource {
+ String[] value() default {};
+}
diff --git a/src/test/java/org/bukkit/registry/RegistryConstantsTest.java b/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
+++ b/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
@@ -0,0 +0,0 @@ public class RegistryConstantsTest extends AbstractTestingBase {
@Test
public void testDamageType() {
this.testExcessConstants(DamageType.class, Registry.DAMAGE_TYPE);
- // this.testMissingConstants(DamageType.class, Registries.DAMAGE_TYPE); // WIND_CHARGE not registered
+ this.testMissingConstants(DamageType.class, Registries.DAMAGE_TYPE); // Paper - re-enable this one
}
@Test
diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/support/DummyServer.java