Fix a few compile errors

This commit is contained in:
Nassim Jahnke 2024-06-14 13:07:50 +02:00
parent 7289589315
commit 9206b1ea14
15 changed files with 55 additions and 167 deletions

View File

@ -333,8 +333,6 @@ public final class DamageTypeKeys {
* *
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<DamageType> WIND_CHARGE = create(key("wind_charge")); public static final TypedKey<DamageType> WIND_CHARGE = create(key("wind_charge"));
/** /**

View File

@ -61,7 +61,6 @@ public final class EnchantmentKeys {
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<Enchantment> BREACH = create(key("breach")); public static final TypedKey<Enchantment> BREACH = create(key("breach"));
/** /**
@ -77,7 +76,6 @@ public final class EnchantmentKeys {
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<Enchantment> DENSITY = create(key("density")); public static final TypedKey<Enchantment> DENSITY = create(key("density"));
/** /**
@ -323,8 +321,6 @@ public final class EnchantmentKeys {
* *
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<Enchantment> WIND_BURST = create(key("wind_burst")); public static final TypedKey<Enchantment> WIND_BURST = create(key("wind_burst"));
private EnchantmentKeys() { private EnchantmentKeys() {

View File

@ -117,7 +117,6 @@ public final class MobEffectKeys {
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<PotionEffectType> INFESTED = create(key("infested")); public static final TypedKey<PotionEffectType> INFESTED = create(key("infested"));
/** /**
@ -188,8 +187,6 @@ public final class MobEffectKeys {
* *
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<PotionEffectType> OOZING = create(key("oozing")); public static final TypedKey<PotionEffectType> OOZING = create(key("oozing"));
/** /**
@ -204,8 +201,6 @@ public final class MobEffectKeys {
* *
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<PotionEffectType> RAID_OMEN = create(key("raid_omen")); public static final TypedKey<PotionEffectType> RAID_OMEN = create(key("raid_omen"));
/** /**
@ -263,7 +258,6 @@ public final class MobEffectKeys {
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<PotionEffectType> TRIAL_OMEN = create(key("trial_omen")); public static final TypedKey<PotionEffectType> TRIAL_OMEN = create(key("trial_omen"));
/** /**
@ -293,7 +287,6 @@ public final class MobEffectKeys {
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<PotionEffectType> WEAVING = create(key("weaving")); public static final TypedKey<PotionEffectType> WEAVING = create(key("weaving"));
/** /**
@ -302,7 +295,6 @@ public final class MobEffectKeys {
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<PotionEffectType> WIND_CHARGED = create(key("wind_charged")); public static final TypedKey<PotionEffectType> WIND_CHARGED = create(key("wind_charged"));
/** /**

View File

@ -228,8 +228,6 @@ public final class StructureKeys {
* *
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<Structure> TRIAL_CHAMBERS = create(key("trial_chambers")); public static final TypedKey<Structure> TRIAL_CHAMBERS = create(key("trial_chambers"));
/** /**

View File

@ -33,7 +33,6 @@ public final class TrimPatternKeys {
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental @ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<TrimPattern> BOLT = create(key("bolt")); public static final TypedKey<TrimPattern> BOLT = create(key("bolt"));
/** /**
@ -62,8 +61,6 @@ public final class TrimPatternKeys {
* *
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<TrimPattern> FLOW = create(key("flow")); public static final TypedKey<TrimPattern> FLOW = create(key("flow"));
/** /**

View File

@ -13,8 +13,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public static final DamageType OUTSIDE_BORDER = getDamageType("outside_border"); public static final DamageType OUTSIDE_BORDER = getDamageType("outside_border");
public static final DamageType GENERIC_KILL = getDamageType("generic_kill"); public static final DamageType GENERIC_KILL = getDamageType("generic_kill");
+ // Paper start + // Paper start
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21)
+ @ApiStatus.Experimental
+ @org.jetbrains.annotations.Nullable + @org.jetbrains.annotations.Nullable
+ DamageType WIND_CHARGE = getExperimentalDamageType("wind_charge"); + DamageType WIND_CHARGE = getExperimentalDamageType("wind_charge");
+ // Paper end + // Paper end

View File

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
// Requires access to NMS // Requires access to NMS
return ensureServerConversions().getMaxItemUseDuration(); return ensureServerConversions().getMaxItemUseDuration(entity);
} }
+ +
+ /** + /**

View File

@ -9,17 +9,33 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java --- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -0,0 +0,0 @@ import org.bukkit.Translatable;
import org.bukkit.Utility;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.enchantments.Enchantment;
+import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.material.MaterialData;
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
public String getI18NDisplayName() { public String getI18NDisplayName() {
return Bukkit.getServer().getItemFactory().getI18NDisplayName(this); return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
} }
+ +
+ /**
+ * @deprecated use {@link #getMaxItemUseDuration(LivingEntity)}; crossbows, later possibly more items require an entity parameter
+ */
+ @Deprecated(forRemoval = true)
+ public int getMaxItemUseDuration() { + public int getMaxItemUseDuration() {
+ return getMaxItemUseDuration(null);
+ }
+
+ public int getMaxItemUseDuration(@NotNull final LivingEntity entity) {
+ if (type == null || type == Material.AIR || !type.isItem()) { + if (type == null || type == Material.AIR || !type.isItem()) {
+ return 0; + return 0;
+ } + }
+ // Requires access to NMS + // Requires access to NMS
+ return ensureServerConversions().getMaxItemUseDuration(); + return ensureServerConversions().getMaxItemUseDuration(entity);
+ } + }
// Paper end // Paper end
} }

View File

@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
EGG(21603, 16), EGG(21603, 16),
COMPASS(24139), COMPASS(24139),
RECOVERY_COMPASS(12710), RECOVERY_COMPASS(12710),
+ @MinecraftExperimental(Requires.BUNDLE) // Paper - add missing annotation + @MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.BUNDLE) // Paper - add missing annotation
+ @ApiStatus.Experimental // Paper - add missing annotation + @ApiStatus.Experimental // Paper - add missing annotation
BUNDLE(16835, 1), BUNDLE(16835, 1),
FISHING_ROD(4167, 1, 64), FISHING_ROD(4167, 1, 64),
@ -60,63 +60,14 @@ diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.ja
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/Tag.java --- a/src/main/java/org/bukkit/Tag.java
+++ b/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.
*/
+ @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.
@@ -0,0 +0,0 @@ public interface Tag<T extends Keyed> extends Keyed { @@ -0,0 +0,0 @@ public interface Tag<T extends Keyed> extends Keyed {
/** /**
* Vanilla tag representing entities which can turn in boats. * Vanilla tag representing entities which can turn in boats.
*/ */
+ @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // 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); 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. * 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/inventory/meta/BundleMeta.java b/src/main/java/org/bukkit/inventory/meta/BundleMeta.java diff --git a/src/main/java/org/bukkit/inventory/meta/BundleMeta.java b/src/main/java/org/bukkit/inventory/meta/BundleMeta.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/BundleMeta.java --- a/src/main/java/org/bukkit/inventory/meta/BundleMeta.java
@ -129,38 +80,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@ApiStatus.Experimental @ApiStatus.Experimental
public interface BundleMeta extends ItemMeta { public interface BundleMeta extends ItemMeta {
diff --git a/src/main/java/org/bukkit/inventory/meta/OminousBottleMeta.java b/src/main/java/org/bukkit/inventory/meta/OminousBottleMeta.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/OminousBottleMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/OminousBottleMeta.java
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
/**
* Represents an ominous bottle with an amplifier of the bad omen effect.
*/
+@org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+@org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public interface OminousBottleMeta extends ItemMeta {
/**
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/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java --- a/src/main/java/org/bukkit/map/MapCursor.java
@ -188,58 +107,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
JUNGLE_TEMPLE(32, "jungle_temple"), JUNGLE_TEMPLE(32, "jungle_temple"),
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation + @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"), SWAMP_HUT(33, "swamp_hut"),
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS(34, "trial_chambers") TRIAL_CHAMBERS(34, "trial_chambers")
; ;
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

View File

@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.equipmentHasChanged(itemstack1, itemstack2)) { if (this.equipmentHasChanged(itemstack1, itemstack2)) {
+ // Paper start - PlayerArmorChangeEvent + // Paper start - PlayerArmorChangeEvent
+ if (this instanceof ServerPlayer && enumitemslot.getType() == EquipmentSlot.Type.ARMOR) { + if (this instanceof ServerPlayer && enumitemslot.getType() == EquipmentSlot.Type.HUMANOID_ARMOR) {
+ final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack1); + final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack1);
+ final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack2); + final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack2);
+ new com.destroystokyo.paper.event.player.PlayerArmorChangeEvent((Player) this.getBukkitEntity(), com.destroystokyo.paper.event.player.PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent(); + new com.destroystokyo.paper.event.player.PlayerArmorChangeEvent((Player) this.getBukkitEntity(), com.destroystokyo.paper.event.player.PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent();

View File

@ -22,7 +22,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { @@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException { protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit
@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (nbt == null) { if (nbt == null) {
regionfile.clear(pos); regionfile.clear(pos);
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { @@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
dataoutputstream.close(); dataoutputstream.close();
} }
} }

View File

@ -9,14 +9,40 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -0,0 +0,0 @@ import net.minecraft.core.Holder;
import net.minecraft.core.component.DataComponentPatch;
import net.minecraft.core.component.DataComponents;
import net.minecraft.world.item.Item;
+import net.minecraft.world.item.Items;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.ItemEnchantments;
import org.bukkit.Material;
import org.bukkit.configuration.serialization.DelegateDeserialization;
import org.bukkit.craftbukkit.enchantments.CraftEnchantment;
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.util.CraftLegacy;
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
import org.bukkit.enchantments.Enchantment;
+import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.material.MaterialData;
@@ -0,0 +0,0 @@ public final class CraftItemStack extends ItemStack { @@ -0,0 +0,0 @@ public final class CraftItemStack extends ItemStack {
return (this.handle == null) ? Material.AIR.getMaxStackSize() : this.handle.getMaxStackSize(); return (this.handle == null) ? Material.AIR.getMaxStackSize() : this.handle.getMaxStackSize();
} }
+ // Paper start + // Paper start
+ @Override + @Override
+ public int getMaxItemUseDuration() { + public int getMaxItemUseDuration(final LivingEntity entity) {
+ return handle == null ? 0 : handle.getUseDuration(); + if (handle == null) {
+ return 0;
+ }
+
+ // Make sure plugins calling the old method don't blow up
+ if (entity == null && handle.is(Items.CROSSBOW)) {
+ throw new UnsupportedOperationException("This item requires an entity to determine the max use duration");
+ }
+ return handle.getUseDuration(((CraftLivingEntity) entity).getHandle());
+ } + }
+ // Paper end + // Paper end
+ +

View File

@ -47,7 +47,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { @@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
try { try {
NbtIo.write(nbt, (DataOutput) dataoutputstream); NbtIo.write(nbt, (DataOutput) dataoutputstream);
@ -66,7 +66,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
throwable.addSuppressed(throwable1); throwable.addSuppressed(throwable1);
} }
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { @@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
throw throwable; throw throwable;
} }
@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
// Paper start - Chunk save reattempt // Paper start - Chunk save reattempt
return; return;
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { @@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
public RegionStorageInfo info() { public RegionStorageInfo info() {
return this.info; return this.info;
} }

View File

@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ for (int i = 0; i < inv.size(); ++i) { + for (int i = 0; i < inv.size(); ++i) {
+ ItemStack item = inv.get(i); + ItemStack item = inv.get(i);
+ if (EnchantmentHelper.hasVanishingCurse(item) || itemsToKeep.isEmpty() || item.isEmpty()) { + if (EnchantmentHelper.has(item, EnchantmentEffectComponents.PREVENT_EQUIPMENT_DROP) || itemsToKeep.isEmpty() || item.isEmpty()) {
+ inv.set(i, ItemStack.EMPTY); + inv.set(i, ItemStack.EMPTY);
+ continue; + continue;
+ } + }

View File

@ -14,7 +14,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { @@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
if (regionfile != null) { if (regionfile != null) {
return regionfile; return regionfile;
} else { } else {