Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11702)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
ed0ec489 SPIGOT-7965: Unknown TransformReason for Hoglins
9db03457 SPIGOT-7964: Fix typo in Deprecation annotation
d14119af PR-1082: Add "since" to Deprecation annotations
e8a318d4 PR-1067: Add method to get Advancement requirements

CraftBukkit Changes:
40dd796db SPIGOT-7971: NotSerializableException on serialize CraftUseCooldownComponent
fa85c5e0a SPIGOT-7968: ProjectileHitEvent not trigerred when arrow hits entity
b75b792ec SPIGOT-7970: World#getMaxHeight() returning incorrect value
2b9a094bb SPIGOT-7965: Unknown TransformReason for Hoglins
fd3f5a380 SPIGOT-7966: Some trees do not generate with #generateTree
f2822317c PR-1515: Add a Class reader and Class node argument provider
07abf6852 PR-1514: Add a test case for ClassTraverser
a7577cb24 Fix Inventory#addItem not respecting max stack size
066a74e74 PR-1490: Add method to get Advancement requirements
4a1df30e4 PR-1512: Test Art class based on specific values instead of the implementation, to better catch implementation changes
53254c56f PR-1503: Simplify CAS loop to getAndSet
e9447dc5e Make BlockDataMeta#setBlockData hide unspecified states
dd08a7120 SPIGOT-7960: Fix inconsistency between natural item drop coordinates
e9e8ed753 SPIGOT-7960: Improve natural item drop methods

Spigot Changes:
60c9969b Rebuild patches
This commit is contained in:
Bjarne Koll
2024-12-03 15:47:48 +01:00
parent 65ca4c1911
commit 881d616533
50 changed files with 374 additions and 347 deletions

View File

@@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
@@ -0,0 +0,0 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio @@ -0,0 +0,0 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@Nullable @Nullable
@Deprecated @Deprecated(since = "1.20.4")
public Location getBedSpawnLocation(); public Location getBedSpawnLocation();
+ // Paper start + // Paper start
+ /** + /**

View File

@@ -198,7 +198,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+public class SheepDyeWoolEvent extends io.papermc.paper.event.entity.EntityDyeEvent implements Cancellable { +public class SheepDyeWoolEvent extends io.papermc.paper.event.entity.EntityDyeEvent implements Cancellable {
+ // Paper - move everything to superclass + // Paper - move everything to superclass
@Deprecated @Deprecated(since = "1.17.1")
public SheepDyeWoolEvent(@NotNull final Sheep sheep, @NotNull final DyeColor color) { public SheepDyeWoolEvent(@NotNull final Sheep sheep, @NotNull final DyeColor color) {
@@ -0,0 +0,0 @@ public class SheepDyeWoolEvent extends EntityEvent implements Cancellable { @@ -0,0 +0,0 @@ public class SheepDyeWoolEvent extends EntityEvent implements Cancellable {
} }

View File

@@ -141,34 +141,32 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public interface FeatureFlag extends Keyed { @@ -0,0 +0,0 @@ public interface FeatureFlag extends Keyed {
* @deprecated not available since 1.21.2 * @deprecated not available since 1.21.2
*/ */
@Deprecated @Deprecated(since = "1.21.2")
- public static final FeatureFlag BUNDLE = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("bundle")); - public static final FeatureFlag BUNDLE = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("bundle"));
+ FeatureFlag BUNDLE = deprecated("bundle"); + FeatureFlag BUNDLE = deprecated("bundle");
/** /**
- * <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.19 - 1.19.4 * <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.19 - 1.19.4
- * *
- * @deprecated not available since 1.20 * @deprecated not available since 1.20
+ * The {@code trade_rebalance} feature flag. + * The {@code trade_rebalance} feature flag.
*/ */
- @Deprecated - @Deprecated(since = "1.20.2")
- public static final FeatureFlag UPDATE_1_20 = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("update_1_20")); - public static final FeatureFlag UPDATE_1_20 = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("update_1_20"));
- + @Deprecated(since = "1.20")
+ FeatureFlag UPDATE_1_20 = deprecated("update_1_20");
@ApiStatus.Experimental // Paper - add missing annotation @ApiStatus.Experimental // Paper - add missing annotation
- public static final FeatureFlag TRADE_REBALANCE = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("trade_rebalance")); - public static final FeatureFlag TRADE_REBALANCE = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("trade_rebalance"));
+ FeatureFlag TRADE_REBALANCE = create("trade_rebalance"); + FeatureFlag TRADE_REBALANCE = create("trade_rebalance");
- /** /**
- * <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.20.5 - 1.20.6 * <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.20.5 - 1.20.6
- * @@ -0,0 +0,0 @@ public interface FeatureFlag extends Keyed {
- * @deprecated not available since 1.21 * @deprecated not available since 1.21
- */ */
- @Deprecated @Deprecated(since = "1.21")
- public static final FeatureFlag UPDATE_121 = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("update_1_21")); - public static final FeatureFlag UPDATE_121 = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("update_1_21"));
+ @Deprecated(since = "1.20")
+ FeatureFlag UPDATE_1_20 = deprecated("update_1_20");
+
+ @Deprecated(since = "1.21")
+ FeatureFlag UPDATE_121 = deprecated("update_1_21"); + FeatureFlag UPDATE_121 = deprecated("update_1_21");
@ApiStatus.Experimental // Paper - add missing annotation @ApiStatus.Experimental // Paper - add missing annotation

View File

@@ -156,5 +156,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- private final Map<LivingEntity, Double> affectedEntities; - private final Map<LivingEntity, Double> affectedEntities;
+ protected final Map<LivingEntity, Double> affectedEntities; // Paper + protected final Map<LivingEntity, Double> affectedEntities; // Paper
@Deprecated @Deprecated(since = "1.20.2")
public PotionSplashEvent(@NotNull final ThrownPotion potion, @NotNull final Map<LivingEntity, Double> affectedEntities) { public PotionSplashEvent(@NotNull final ThrownPotion potion, @NotNull final Map<LivingEntity, Double> affectedEntities) {

View File

@@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/AbstractSkeleton.java --- a/src/main/java/org/bukkit/entity/AbstractSkeleton.java
+++ b/src/main/java/org/bukkit/entity/AbstractSkeleton.java +++ b/src/main/java/org/bukkit/entity/AbstractSkeleton.java
@@ -0,0 +0,0 @@ public interface AbstractSkeleton extends Monster, com.destroystokyo.paper.entit @@ -0,0 +0,0 @@ public interface AbstractSkeleton extends Monster, com.destroystokyo.paper.entit
@Deprecated @Deprecated(since = "1.17")
@Contract("_ -> fail") @Contract("_ -> fail")
public void setSkeletonType(Skeleton.SkeletonType type); public void setSkeletonType(Skeleton.SkeletonType type);
+ +

View File

@@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final Entity damager; private final Entity damager;
+ private final boolean critical; // Paper + private final boolean critical; // Paper
@Deprecated(forRemoval = true) @Deprecated(since = "1.20.4", forRemoval = true)
public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage) { public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage) {
this(damager, damagee, cause, DamageSource.builder(DamageType.GENERIC).withCausingEntity(damager).withDirectEntity(damager).build(), damage); this(damager, damagee, cause, DamageSource.builder(DamageType.GENERIC).withCausingEntity(damager).withDirectEntity(damager).build(), damage);
} }
@@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.critical = false; // Paper - add critical damage API + this.critical = false; // Paper - add critical damage API
} }
@Deprecated(forRemoval = true) @Deprecated(since = "1.20.4", forRemoval = true)
@@ -0,0 +0,0 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent { @@ -0,0 +0,0 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent {
this(damager, damagee, cause, DamageSource.builder(DamageType.GENERIC).withCausingEntity(damager).withDirectEntity(damager).build(), modifiers, modifierFunctions); this(damager, damagee, cause, DamageSource.builder(DamageType.GENERIC).withCausingEntity(damager).withDirectEntity(damager).build(), modifiers, modifierFunctions);
} }

View File

@@ -69,7 +69,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.drops = drops; // Paper - custom shear drops + this.drops = drops; // Paper - custom shear drops
} }
@Deprecated @Deprecated(since = "1.15.2")
public PlayerShearEntityEvent(@NotNull final Player who, @NotNull final Entity what) { public PlayerShearEntityEvent(@NotNull final Player who, @NotNull final Entity what) {
- this(who, what, new ItemStack(Material.SHEARS), EquipmentSlot.HAND); - this(who, what, new ItemStack(Material.SHEARS), EquipmentSlot.HAND);
+ this(who, what, new ItemStack(Material.SHEARS), EquipmentSlot.HAND, java.util.Collections.emptyList()); // Paper - custom shear drops + this(who, what, new ItemStack(Material.SHEARS), EquipmentSlot.HAND, java.util.Collections.emptyList()); // Paper - custom shear drops

View File

@@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java --- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
+++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java +++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
@@ -0,0 +0,0 @@ public interface BukkitScheduler { @@ -0,0 +0,0 @@ public interface BukkitScheduler {
@Deprecated @Deprecated(since = "1.7.10")
@NotNull @NotNull
public BukkitTask runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay, long period) throws IllegalArgumentException; public BukkitTask runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay, long period) throws IllegalArgumentException;
+ +

View File

@@ -32,8 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* *
* @param count amount of arrows in entity's body * @param count amount of arrows in entity's body
+ * @param fireEvent whether to fire the {@link org.bukkit.event.entity.ArrowBodyCountChangeEvent} event + * @param fireEvent whether to fire the {@link org.bukkit.event.entity.ArrowBodyCountChangeEvent} event
*/ + */
- public void setArrowsInBody(int count);
+ void setArrowsInBody(int count, boolean fireEvent); // Paper + void setArrowsInBody(int count, boolean fireEvent); // Paper
+ +
+ // Paper start - Add methods for working with arrows stuck in living entities + // Paper start - Add methods for working with arrows stuck in living entities
@@ -43,7 +42,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * A value of 0 will cause the server to re-calculate the amount of ticks on the next tick. + * A value of 0 will cause the server to re-calculate the amount of ticks on the next tick.
+ * + *
+ * @param ticks Amount of ticks + * @param ticks Amount of ticks
+ */ */
- public void setArrowsInBody(int count);
+ void setNextArrowRemoval(@org.jetbrains.annotations.Range(from = 0, to = Integer.MAX_VALUE) int ticks); + void setNextArrowRemoval(@org.jetbrains.annotations.Range(from = 0, to = Integer.MAX_VALUE) int ticks);
+ +
+ /** + /**

View File

@@ -316,7 +316,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* Typed represents a subtype of {@link BlockType}s that have a known block * Typed represents a subtype of {@link BlockType}s that have a known block
@@ -0,0 +0,0 @@ public interface BlockType extends Keyed, Translatable { @@ -0,0 +0,0 @@ public interface BlockType extends Keyed, Translatable {
@Nullable @Nullable
@Deprecated @Deprecated(since = "1.20.6")
Material asMaterial(); Material asMaterial();
+ +
+ // Paper start - add Translatable + // Paper start - add Translatable
@@ -568,7 +568,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* Typed represents a subtype of {@link ItemType}s that have a known item meta type * Typed represents a subtype of {@link ItemType}s that have a known item meta type
@@ -0,0 +0,0 @@ public interface ItemType extends Keyed, Translatable { @@ -0,0 +0,0 @@ public interface ItemType extends Keyed, Translatable {
@Nullable @Nullable
@Deprecated @Deprecated(since = "1.20.6")
Material asMaterial(); Material asMaterial();
+ +
+ // Paper start - add Translatable + // Paper start - add Translatable

View File

@@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/entity/Evoker.java +++ b/src/main/java/org/bukkit/entity/Evoker.java
@@ -0,0 +0,0 @@ public interface Evoker extends Spellcaster { @@ -0,0 +0,0 @@ public interface Evoker extends Spellcaster {
*/ */
@Deprecated @Deprecated(since = "1.11.2")
void setCurrentSpell(@Nullable Spell spell); void setCurrentSpell(@Nullable Spell spell);
+ +
+ // Paper start + // Paper start

View File

@@ -177,7 +177,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/advancement/Advancement.java +++ b/src/main/java/org/bukkit/advancement/Advancement.java
@@ -0,0 +0,0 @@ public interface Advancement extends Keyed { @@ -0,0 +0,0 @@ public interface Advancement extends Keyed {
@NotNull @NotNull
Collection<String> getCriteria(); AdvancementRequirements getRequirements();
+ // Paper start + // Paper start
/** /**

View File

@@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private final String hostname; // Paper + private final String hostname; // Paper
private final boolean transferred; private final boolean transferred;
@Deprecated @Deprecated(since = "1.7.5")
@@ -0,0 +0,0 @@ public class AsyncPlayerPreLoginEvent extends Event { @@ -0,0 +0,0 @@ public class AsyncPlayerPreLoginEvent extends Event {
} }

View File

@@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder @@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/ */
@Deprecated @Deprecated(since = "1.12")
public void setShoulderEntityRight(@Nullable Entity entity); public void setShoulderEntityRight(@Nullable Entity entity);
+ // Paper start - Add method to open already placed sign + // Paper start - Add method to open already placed sign
+ /** + /**

View File

@@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java --- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
@@ -0,0 +0,0 @@ public interface SkullMeta extends ItemMeta { @@ -0,0 +0,0 @@ public interface SkullMeta extends ItemMeta {
@Deprecated @Deprecated(since = "1.12.1")
boolean setOwner(@Nullable String owner); boolean setOwner(@Nullable String owner);
+ // Paper start + // Paper start

View File

@@ -1562,7 +1562,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; @@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
*/ */
@Deprecated @Deprecated(since = "1.7.2")
public interface UnsafeValues { public interface UnsafeValues {
+ // Paper start + // Paper start
+ net.kyori.adventure.text.flattener.ComponentFlattener componentFlattener(); + net.kyori.adventure.text.flattener.ComponentFlattener componentFlattener();
@@ -1714,7 +1714,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#getLines()}. - * @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#getLines()}.
+ * @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#lines()}. + * @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#lines()}.
*/ */
@Deprecated @Deprecated(since = "1.20")
@NotNull @NotNull
@@ -0,0 +0,0 @@ public interface Sign extends TileState, Colorable { @@ -0,0 +0,0 @@ public interface Sign extends TileState, Colorable {
* @param index Line number to get the text from, starting at 0 * @param index Line number to get the text from, starting at 0
@@ -1723,7 +1723,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#getLine(int)}. - * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#getLine(int)}.
+ * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#line(int)}. + * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#line(int)}.
*/ */
@Deprecated @Deprecated(since = "1.20")
@NotNull @NotNull
@@ -0,0 +0,0 @@ public interface Sign extends TileState, Colorable { @@ -0,0 +0,0 @@ public interface Sign extends TileState, Colorable {
* @param index Line number to set the text at, starting from 0 * @param index Line number to set the text at, starting from 0
@@ -1732,7 +1732,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#setLine(int, String)}. - * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#setLine(int, String)}.
+ * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#line(int, net.kyori.adventure.text.Component)}. + * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#line(int, net.kyori.adventure.text.Component)}.
*/ */
@Deprecated @Deprecated(since = "1.20")
public void setLine(int index, @NotNull String line) throws IndexOutOfBoundsException; public void setLine(int index, @NotNull String line) throws IndexOutOfBoundsException;
diff --git a/src/main/java/org/bukkit/block/sign/SignSide.java b/src/main/java/org/bukkit/block/sign/SignSide.java diff --git a/src/main/java/org/bukkit/block/sign/SignSide.java b/src/main/java/org/bukkit/block/sign/SignSide.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@@ -1837,7 +1837,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return false; return false;
@@ -0,0 +0,0 @@ public abstract class Command { @@ -0,0 +0,0 @@ public abstract class Command {
@Deprecated @Deprecated(since = "1.20.4")
@Nullable @Nullable
public String getPermissionMessage() { public String getPermissionMessage() {
- return permissionMessage; - return permissionMessage;
@@ -1846,7 +1846,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
@@ -0,0 +0,0 @@ public abstract class Command { @@ -0,0 +0,0 @@ public abstract class Command {
@Deprecated @Deprecated(since = "1.20.4")
@NotNull @NotNull
public Command setPermissionMessage(@Nullable String permissionMessage) { public Command setPermissionMessage(@Nullable String permissionMessage) {
- this.permissionMessage = permissionMessage; - this.permissionMessage = permissionMessage;
@@ -2664,7 +2664,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * should use {@link #setResourcePack(String)}. - * should use {@link #setResourcePack(String)}.
+ * should use {@link #setResourcePack(UUID, String, byte[], net.kyori.adventure.text.Component, boolean)}. + * should use {@link #setResourcePack(UUID, String, byte[], net.kyori.adventure.text.Component, boolean)}.
*/ */
@Deprecated @Deprecated(since = "1.7.2")
public void setTexturePack(@NotNull String url); public void setTexturePack(@NotNull String url);
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the URL is null. * @throws IllegalArgumentException Thrown if the URL is null.
@@ -2947,7 +2947,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * @deprecated API behavior subject to change - * @deprecated API behavior subject to change
+ * @deprecated Use {@link #showTitle(net.kyori.adventure.title.Title)} or {@link #sendTitlePart(net.kyori.adventure.title.TitlePart, Object)} + * @deprecated Use {@link #showTitle(net.kyori.adventure.title.Title)} or {@link #sendTitlePart(net.kyori.adventure.title.TitlePart, Object)}
*/ */
@Deprecated @Deprecated(since = "1.8.7")
public void sendTitle(@Nullable String title, @Nullable String subtitle); public void sendTitle(@Nullable String title, @Nullable String subtitle);
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param fadeIn time in ticks for titles to fade in. Defaults to 10. * @param fadeIn time in ticks for titles to fade in. Defaults to 10.
@@ -3136,7 +3136,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
+ +
@Deprecated @Deprecated(since = "1.19.4")
public SignChangeEvent(@NotNull final Block theBlock, @NotNull final Player thePlayer, @NotNull final String[] theLines) { public SignChangeEvent(@NotNull final Block theBlock, @NotNull final Player thePlayer, @NotNull final String[] theLines) {
this(theBlock, thePlayer, theLines, Side.FRONT); this(theBlock, thePlayer, theLines, Side.FRONT);
} }
@@ -3467,9 +3467,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */ + */
+ public void disallow(@NotNull final Result result, @NotNull final net.kyori.adventure.text.Component message) { + public void disallow(@NotNull final Result result, @NotNull final net.kyori.adventure.text.Component message) {
+ this.result = result; + this.result = result;
this.message = message; + this.message = message;
} + }
+
+ /** + /**
+ * Disallows the player from logging in, with the given reason + * Disallows the player from logging in, with the given reason
+ * + *
@@ -3482,8 +3482,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Deprecated + @Deprecated
+ public void disallow(@NotNull final PlayerPreLoginEvent.Result result, @NotNull final net.kyori.adventure.text.Component message) { + public void disallow(@NotNull final PlayerPreLoginEvent.Result result, @NotNull final net.kyori.adventure.text.Component message) {
+ this.result = result == null ? null : Result.valueOf(result.name()); + this.result = result == null ? null : Result.valueOf(result.name());
+ this.message = message; this.message = message;
+ } }
+ // Paper end + // Paper end
+ /** + /**
+ * Gets the current kick message that will be used if getResult() != + * Gets the current kick message that will be used if getResult() !=
@@ -3508,7 +3508,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public void setKickMessage(@NotNull final String message) { + public void setKickMessage(@NotNull final String message) {
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper + this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
+ } + }
+
/** /**
* Allows the player to log in * Allows the player to log in
*/ */
@@ -3534,7 +3534,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
@@ -0,0 +0,0 @@ public class AsyncPlayerPreLoginEvent extends Event { @@ -0,0 +0,0 @@ public class AsyncPlayerPreLoginEvent extends Event {
@Deprecated @Deprecated(since = "1.3.2")
public void disallow(@NotNull final PlayerPreLoginEvent.Result result, @NotNull final String message) { public void disallow(@NotNull final PlayerPreLoginEvent.Result result, @NotNull final String message) {
this.result = result == null ? null : Result.valueOf(result.name()); this.result = result == null ? null : Result.valueOf(result.name());
- this.message = message; - this.message = message;
@@ -3558,7 +3558,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * alternative for thread safe implementations. - * alternative for thread safe implementations.
+ * @deprecated Listening to this event forces chat to wait for the main thread, delaying chat messages. It is recommended to use {@link io.papermc.paper.event.player.AsyncChatEvent} instead, wherever possible. + * @deprecated Listening to this event forces chat to wait for the main thread, delaying chat messages. It is recommended to use {@link io.papermc.paper.event.player.AsyncChatEvent} instead, wherever possible.
*/ */
@Deprecated @Deprecated(since = "1.3.1")
@Warning(reason = "Listening to this event forces chat to wait for the main thread, delaying chat messages.") @Warning(reason = "Listening to this event forces chat to wait for the main thread, delaying chat messages.")
diff --git a/src/main/java/org/bukkit/event/player/PlayerEvent.java b/src/main/java/org/bukkit/event/player/PlayerEvent.java diff --git a/src/main/java/org/bukkit/event/player/PlayerEvent.java b/src/main/java/org/bukkit/event/player/PlayerEvent.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@@ -4947,7 +4947,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
@@ -0,0 +0,0 @@ public final class MapCursor { @@ -0,0 +0,0 @@ public final class MapCursor {
*/ */
@Deprecated @Deprecated(since = "1.6.2")
public MapCursor(byte x, byte y, byte direction, byte type, boolean visible) { public MapCursor(byte x, byte y, byte direction, byte type, boolean visible) {
- this(x, y, direction, type, visible, null); - this(x, y, direction, type, visible, null);
+ this(x, y, direction, type, visible, (String) null); // Paper + this(x, y, direction, type, visible, (String) null); // Paper
@@ -4970,7 +4970,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * @deprecated Magic value, use {@link #MapCursor(byte, byte, byte, Type, boolean, String)} - * @deprecated Magic value, use {@link #MapCursor(byte, byte, byte, Type, boolean, String)}
+ * @deprecated Magic value. Use {@link #MapCursor(byte, byte, byte, Type, boolean, net.kyori.adventure.text.Component)} + * @deprecated Magic value. Use {@link #MapCursor(byte, byte, byte, Type, boolean, net.kyori.adventure.text.Component)}
*/ */
@Deprecated @Deprecated(since = "1.13")
public MapCursor(byte x, byte y, byte direction, byte type, boolean visible, @Nullable String caption) { public MapCursor(byte x, byte y, byte direction, byte type, boolean visible, @Nullable String caption) {
@@ -0,0 +0,0 @@ public final class MapCursor { @@ -0,0 +0,0 @@ public final class MapCursor {
setDirection(direction); setDirection(direction);
@@ -4996,7 +4996,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.x = x; this.y = y; this.visible = visible; this.caption = caption; + this.x = x; this.y = y; this.visible = visible; this.caption = caption;
+ setDirection(direction); + setDirection(direction);
+ setRawType(type); + setRawType(type);
} + }
+ /** + /**
+ * Initialize the map cursor. + * Initialize the map cursor.
+ * + *
@@ -5011,7 +5011,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.x = x; this.y = y; this.visible = visible; this.caption = caption; + this.x = x; this.y = y; this.visible = visible; this.caption = caption;
+ setDirection(direction); + setDirection(direction);
+ setType(type); + setType(type);
+ } }
+ // Paper end + // Paper end
/** /**
@@ -5290,7 +5290,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * @deprecated use {@link #registerNewObjective(String, Criteria, String)} - * @deprecated use {@link #registerNewObjective(String, Criteria, String)}
+ * @deprecated use {@link #registerNewObjective(String, Criteria, net.kyori.adventure.text.Component)} + * @deprecated use {@link #registerNewObjective(String, Criteria, net.kyori.adventure.text.Component)}
*/ */
@Deprecated @Deprecated(since = "1.20.5")
@NotNull @NotNull
@@ -0,0 +0,0 @@ public interface Scoreboard { @@ -0,0 +0,0 @@ public interface Scoreboard {
* characters. * characters.
@@ -5299,7 +5299,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * @deprecated use {@link #registerNewObjective(String, Criteria, String, RenderType)} - * @deprecated use {@link #registerNewObjective(String, Criteria, String, RenderType)}
+ * @deprecated use {@link #registerNewObjective(String, Criteria, net.kyori.adventure.text.Component, RenderType)} + * @deprecated use {@link #registerNewObjective(String, Criteria, net.kyori.adventure.text.Component, RenderType)}
*/ */
@Deprecated @Deprecated(since = "1.20.5")
@NotNull @NotNull
@@ -0,0 +0,0 @@ public interface Scoreboard { @@ -0,0 +0,0 @@ public interface Scoreboard {
* characters. * characters.

View File

@@ -246,8 +246,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @return The list of effects * @return The list of effects
* @deprecated Non-Functional * @deprecated Non-Functional
*/ */
- @Deprecated - @Deprecated(since = "1.6.2")
+ @Deprecated(forRemoval = true, since = "1.20.5") // Paper + @Deprecated(since = "1.6.2", forRemoval = true) // Paper
@NotNull @NotNull
- public Collection<PotionEffect> getEffectsFromDamage(int damage); - public Collection<PotionEffect> getEffectsFromDamage(int damage);
+ // Paper start - make default + // Paper start - make default
@@ -262,7 +262,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link PotionType#getPotionEffects()} instead * @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link PotionType#getPotionEffects()} instead
*/ */
@NotNull @NotNull
- @Deprecated - @Deprecated(since = "1.20.2")
+ @Deprecated(forRemoval = true, since = "1.20.5") // Paper + @Deprecated(since = "1.20.2", forRemoval = true) // Paper
public Collection<PotionEffect> getEffects(@NotNull PotionType type, boolean upgraded, boolean extended); public Collection<PotionEffect> getEffects(@NotNull PotionType type, boolean upgraded, boolean extended);
} }

View File

@@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <nassim@njahnke.dev>
Date: Tue, 3 Dec 2024 15:33:45 +0100
Subject: [PATCH] Disable deprecated annotation test
diff --git a/src/test/java/org/bukkit/DeprecatedTest.java b/src/test/java/org/bukkit/DeprecatedTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/DeprecatedTest.java
+++ b/src/test/java/org/bukkit/DeprecatedTest.java
@@ -0,0 +0,0 @@ import com.google.common.base.Joiner;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.support.test.ClassNodeTest;
+import org.junit.jupiter.api.Disabled;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AnnotationNode;
import org.objectweb.asm.tree.ClassNode;
@@ -0,0 +0,0 @@ import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.RecordComponentNode;
+@Disabled
public class DeprecatedTest {
private static final String DEPRECATED_DESC = Type.getDescriptor(Deprecated.class);

View File

@@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
@@ -0,0 +0,0 @@ public class ShapedRecipe extends CraftingRecipe { @@ -0,0 +0,0 @@ public class ShapedRecipe extends CraftingRecipe {
@Deprecated @Deprecated(since = "1.12")
public ShapedRecipe(@NotNull ItemStack result) { public ShapedRecipe(@NotNull ItemStack result) {
this(NamespacedKey.randomKey(), result); this(NamespacedKey.randomKey(), result);
+ new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper + new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper
@@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
@@ -0,0 +0,0 @@ public class ShapelessRecipe extends CraftingRecipe { @@ -0,0 +0,0 @@ public class ShapelessRecipe extends CraftingRecipe {
@Deprecated @Deprecated(since = "1.12")
public ShapelessRecipe(@NotNull ItemStack result) { public ShapelessRecipe(@NotNull ItemStack result) {
this(NamespacedKey.randomKey(), result); this(NamespacedKey.randomKey(), result);
+ new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper + new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper

View File

@@ -163,7 +163,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @deprecated prefer {@link ArmorStand#getItem(EquipmentSlot)} // Paper + * @deprecated prefer {@link ArmorStand#getItem(EquipmentSlot)} // Paper
*/ */
@NotNull @NotNull
@Deprecated @Deprecated(since = "1.15.2")
@@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity { @@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity {
* @param item the item to hold * @param item the item to hold
* @see #getEquipment() * @see #getEquipment()
@@ -171,7 +171,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * {@link EntityEquipment#setItemInHand(org.bukkit.inventory.ItemStack)} - * {@link EntityEquipment#setItemInHand(org.bukkit.inventory.ItemStack)}
+ * {@link ArmorStand#setItem(EquipmentSlot, ItemStack)} // Paper + * {@link ArmorStand#setItem(EquipmentSlot, ItemStack)} // Paper
*/ */
@Deprecated @Deprecated(since = "1.15.2")
void setItemInHand(@Nullable ItemStack item); void setItemInHand(@Nullable ItemStack item);
@@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity { @@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity {
* @param tick {@code true} if this armour stand can tick, {@code false} otherwise * @param tick {@code true} if this armour stand can tick, {@code false} otherwise

View File

@@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * @deprecated Magic value - * @deprecated Magic value
+ * @deprecated Magic value. Use {@link #spawn(Location, Class, Consumer)} (or a variation thereof) in combination with {@link FallingBlock#setBlockData(BlockData)} + * @deprecated Magic value. Use {@link #spawn(Location, Class, Consumer)} (or a variation thereof) in combination with {@link FallingBlock#setBlockData(BlockData)}
*/ */
@Deprecated @Deprecated(since = "1.7.5")
@NotNull @NotNull
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View File

@@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final AreaEffectCloud entity; private final AreaEffectCloud entity;
+ private boolean allowEmptyAreaEffectCreation; // Paper + private boolean allowEmptyAreaEffectCreation; // Paper
@Deprecated @Deprecated(since = "1.20.2")
public LingeringPotionSplashEvent(@NotNull final ThrownPotion potion, @NotNull final AreaEffectCloud entity) { public LingeringPotionSplashEvent(@NotNull final ThrownPotion potion, @NotNull final AreaEffectCloud entity) {
@@ -0,0 +0,0 @@ public class LingeringPotionSplashEvent extends ProjectileHitEvent implements Ca @@ -0,0 +0,0 @@ public class LingeringPotionSplashEvent extends ProjectileHitEvent implements Ca
return entity; return entity;

View File

@@ -82,5 +82,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
+ // Paper end + // Paper end
@Deprecated @Deprecated(since = "1.19.2")
public PlayerItemMendEvent(@NotNull Player who, @NotNull ItemStack item, @NotNull ExperienceOrb experienceOrb, int repairAmount) { public PlayerItemMendEvent(@NotNull Player who, @NotNull ItemStack item, @NotNull ExperienceOrb experienceOrb, int repairAmount) {

View File

@@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/FeatureFlag.java --- a/src/main/java/org/bukkit/FeatureFlag.java
+++ b/src/main/java/org/bukkit/FeatureFlag.java +++ b/src/main/java/org/bukkit/FeatureFlag.java
@@ -0,0 +0,0 @@ public interface FeatureFlag extends Keyed { @@ -0,0 +0,0 @@ public interface FeatureFlag extends Keyed {
@Deprecated @Deprecated(since = "1.20.2")
public static final FeatureFlag UPDATE_1_20 = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("update_1_20")); public static final FeatureFlag UPDATE_1_20 = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("update_1_20"));
+ @ApiStatus.Experimental // Paper - add missing annotation + @ApiStatus.Experimental // Paper - add missing annotation
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
@@ -0,0 +0,0 @@ public interface FeatureFlag extends Keyed { @@ -0,0 +0,0 @@ public interface FeatureFlag extends Keyed {
@Deprecated @Deprecated(since = "1.21")
public static final FeatureFlag UPDATE_121 = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("update_1_21")); public static final FeatureFlag UPDATE_121 = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("update_1_21"));
+ @ApiStatus.Experimental // Paper - add missing annotation + @ApiStatus.Experimental // Paper - add missing annotation

View File

@@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final Player player; private final Player player;
+ private final org.bukkit.inventory.EquipmentSlot hand; // Paper - expose hand + private final org.bukkit.inventory.EquipmentSlot hand; // Paper - expose hand
@Deprecated @Deprecated(since = "1.13.2")
public BlockCanBuildEvent(@NotNull final Block block, @NotNull final BlockData type, final boolean canBuild) { public BlockCanBuildEvent(@NotNull final Block block, @NotNull final BlockData type, final boolean canBuild) {
- this(block, null, type, canBuild); - this(block, null, type, canBuild);
+ this(block, null, type, canBuild, org.bukkit.inventory.EquipmentSlot.HAND); // Paper - expose hand + this(block, null, type, canBuild, org.bukkit.inventory.EquipmentSlot.HAND); // Paper - expose hand

View File

@@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/BanList.java +++ b/src/main/java/org/bukkit/BanList.java
@@ -0,0 +0,0 @@ public interface BanList<T> { @@ -0,0 +0,0 @@ public interface BanList<T> {
*/ */
@Deprecated @Deprecated(since = "1.20.1")
@Nullable @Nullable
- public BanEntry<T> getBanEntry(@NotNull String target); - public BanEntry<T> getBanEntry(@NotNull String target);
+ public <E extends BanEntry<? super T>> E getBanEntry(@NotNull String target); // Paper + public <E extends BanEntry<? super T>> E getBanEntry(@NotNull String target); // Paper
@@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* Gets a {@link BanEntry} by target. * Gets a {@link BanEntry} by target.
@@ -0,0 +0,0 @@ public interface BanList<T> { @@ -0,0 +0,0 @@ public interface BanList<T> {
*/ */
@Deprecated @Deprecated(since = "1.20.1")
@Nullable @Nullable
- public BanEntry<T> addBan(@NotNull String target, @Nullable String reason, @Nullable Date expires, @Nullable String source); - public BanEntry<T> addBan(@NotNull String target, @Nullable String reason, @Nullable Date expires, @Nullable String source);
+ public <E extends BanEntry<? super T>> E addBan(@NotNull String target, @Nullable String reason, @Nullable Date expires, @Nullable String source); // Paper + public <E extends BanEntry<? super T>> E addBan(@NotNull String target, @Nullable String reason, @Nullable Date expires, @Nullable String source); // Paper

View File

@@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @param instrument the Instrument. Has no effect if null. * @param instrument the Instrument. Has no effect if null.
- * @deprecated no effect on newer Minecraft versions - * @deprecated no effect on newer Minecraft versions
*/ */
- @Deprecated - @Deprecated(since = "1.13")
public void setInstrument(@NotNull Instrument instrument) { public void setInstrument(@NotNull Instrument instrument) {
if (instrument != null) { if (instrument != null) {
this.instrument = instrument; this.instrument = instrument;
@@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @param note the Note. Has no effect if null. * @param note the Note. Has no effect if null.
- * @deprecated no effect on newer Minecraft versions - * @deprecated no effect on newer Minecraft versions
*/ */
- @Deprecated - @Deprecated(since = "1.13")
public void setNote(@NotNull Note note) { public void setNote(@NotNull Note note) {
if (note != null) { if (note != null) {
this.note = note; this.note = note;

View File

@@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @return The entity type. May be null for implementation specific default. * @return The entity type. May be null for implementation specific default.
* @deprecated different types are different items * @deprecated different types are different items
*/ */
- @Deprecated - @Deprecated(since = "1.13")
+ @Deprecated(forRemoval = true) // Paper + @Deprecated(since = "1.13", forRemoval = true) // Paper
@Contract("-> fail") @Contract("-> fail")
EntityType getSpawnedType(); EntityType getSpawnedType();
@@ -21,8 +21,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* default. * default.
* @deprecated different types are different items * @deprecated different types are different items
*/ */
- @Deprecated - @Deprecated(since = "1.13")
+ @Deprecated(forRemoval = true) // Paper + @Deprecated(since = "1.13", forRemoval = true) // Paper
@Contract("_ -> fail") @Contract("_ -> fail")
void setSpawnedType(EntityType type); void setSpawnedType(EntityType type);

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed { @@ -0,0 +0,0 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
*/ */
@Nullable @Nullable
@Deprecated @Deprecated(since = "1.20.5")
+ @io.papermc.paper.annotation.DoNotUse // Paper + @io.papermc.paper.annotation.DoNotUse // Paper
public EquipmentSlot getSlot() { public EquipmentSlot getSlot() {
return slot == EquipmentSlotGroup.ANY ? null : slot.getExample(); return slot == EquipmentSlotGroup.ANY ? null : slot.getExample();

View File

@@ -241,10 +241,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* Represents a captured state of a bed. * Represents a captured state of a bed.
- * @deprecated does not provide useful information beyond the material itself - * @deprecated does not provide useful information beyond the material itself
*/ */
-@Deprecated -@Deprecated(since = "1.13")
-public interface Bed extends TileState, Colorable { } -public interface Bed extends TileState, Colorable { }
+// Paper start +// Paper start
+// @Deprecated +// @Deprecated(since = "1.13")
+public interface Bed extends TileState, Colorable { +public interface Bed extends TileState, Colorable {
+ +
+ @Override + @Override
@@ -377,7 +377,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * @deprecated use {@link #getAttachedFace()} - * @deprecated use {@link #getAttachedFace()}
+ * @deprecated use {@link #setAttachedFace(AttachedFace)} + * @deprecated use {@link #setAttachedFace(AttachedFace)}
*/ */
@Deprecated @Deprecated(since = "1.15.2")
void setFace(@NotNull Face face); void setFace(@NotNull Face face);
@@ -0,0 +0,0 @@ public interface Switch extends Directional, FaceAttachable, Powerable { @@ -0,0 +0,0 @@ public interface Switch extends Directional, FaceAttachable, Powerable {
*/ */
@@ -1091,8 +1091,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @deprecated This is simply the online players. Modifications have no effect + * @deprecated This is simply the online players. Modifications have no effect
*/ */
@NotNull @NotNull
- @Deprecated - @Deprecated(since = "1.3.1")
+ @Deprecated(forRemoval = true) + @Deprecated(since = "1.3.1", forRemoval = true)
public Set<Player> getRecipients() { public Set<Player> getRecipients() {
return recipients; return recipients;
} }

View File

@@ -17,5 +17,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * chunk as before as terrain decoration may be spread across chunks. It may + * chunk as before as terrain decoration may be spread across chunks. It may
+ * or may not change blocks in the adjacent chunks as well. + * or may not change blocks in the adjacent chunks as well.
*/ */
@Deprecated @Deprecated(since = "1.13")
public boolean regenerateChunk(int x, int z); public boolean regenerateChunk(int x, int z);

View File

@@ -14,8 +14,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @see #getScore(String) * @see #getScore(String)
- * @deprecated Scoreboards can contain entries that aren't players - * @deprecated Scoreboards can contain entries that aren't players
*/ */
- @Deprecated - @Deprecated(since = "1.7.8")
+ // @Deprecated // Paper + // @Deprecated(since = "1.7.8") // Paper
@NotNull @NotNull
Score getScore(@NotNull OfflinePlayer player); Score getScore(@NotNull OfflinePlayer player);
@@ -46,8 +46,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @see #getScores(String) * @see #getScores(String)
- * @deprecated Scoreboards can contain entries that aren't players - * @deprecated Scoreboards can contain entries that aren't players
*/ */
- @Deprecated - @Deprecated(since = "1.7.8")
+ // @Deprecated // Paper + // @Deprecated(since = "1.7.8") // Paper
@NotNull @NotNull
Set<Score> getScores(@NotNull OfflinePlayer player); Set<Score> getScores(@NotNull OfflinePlayer player);
@@ -57,8 +57,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @see #resetScores(String) * @see #resetScores(String)
- * @deprecated Scoreboards can contain entries that aren't players - * @deprecated Scoreboards can contain entries that aren't players
*/ */
- @Deprecated - @Deprecated(since = "1.7.8")
+ // @Deprecated // Paper + // @Deprecated(since = "1.7.8") // Paper
void resetScores(@NotNull OfflinePlayer player); void resetScores(@NotNull OfflinePlayer player);
/** /**
@@ -68,8 +68,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @see #getEntryTeam(String) * @see #getEntryTeam(String)
- * @deprecated Scoreboards can contain entries that aren't players - * @deprecated Scoreboards can contain entries that aren't players
*/ */
- @Deprecated - @Deprecated(since = "1.8.6")
+ // @Deprecated // Paper + // @Deprecated(since = "1.8.6") // Paper
@Nullable @Nullable
Team getPlayerTeam(@NotNull OfflinePlayer player); Team getPlayerTeam(@NotNull OfflinePlayer player);
@@ -119,8 +119,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @see #addEntry(String) * @see #addEntry(String)
- * @deprecated Teams can contain entries that aren't players - * @deprecated Teams can contain entries that aren't players
*/ */
- @Deprecated - @Deprecated(since = "1.8.6")
+ // @Deprecated // Paper + // @Deprecated(since = "1.8.6") // Paper
void addPlayer(@NotNull OfflinePlayer player); void addPlayer(@NotNull OfflinePlayer player);
/** /**
@@ -130,8 +130,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @see #removeEntry(String) * @see #removeEntry(String)
- * @deprecated Teams can contain entries that aren't players - * @deprecated Teams can contain entries that aren't players
*/ */
- @Deprecated - @Deprecated(since = "1.8.6")
+ // @Deprecated // Paper + // @Deprecated(since = "1.8.6") // Paper
boolean removePlayer(@NotNull OfflinePlayer player); boolean removePlayer(@NotNull OfflinePlayer player);
/** /**
@@ -141,8 +141,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @see #hasEntry(String) * @see #hasEntry(String)
- * @deprecated Teams can contain entries that aren't players - * @deprecated Teams can contain entries that aren't players
*/ */
- @Deprecated - @Deprecated(since = "1.8.6")
+ // @Deprecated // Paper + // @Deprecated(since = "1.8.6") // Paper
boolean hasPlayer(@NotNull OfflinePlayer player); boolean hasPlayer(@NotNull OfflinePlayer player);
/** /**
* Checks to see if the specified entry is a member of this team. * Checks to see if the specified entry is a member of this team.

View File

@@ -426,7 +426,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/entity/Endermite.java +++ b/src/main/java/org/bukkit/entity/Endermite.java
@@ -0,0 +0,0 @@ public interface Endermite extends Monster { @@ -0,0 +0,0 @@ public interface Endermite extends Monster {
*/ */
@Deprecated @Deprecated(since = "1.17")
void setPlayerSpawned(boolean playerSpawned); void setPlayerSpawned(boolean playerSpawned);
+ // Paper start + // Paper start
+ /** + /**

View File

@@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- * only for {@link Enchantment#BINDING_CURSE} and - * only for {@link Enchantment#BINDING_CURSE} and
- * {@link Enchantment#VANISHING_CURSE}. - * {@link Enchantment#VANISHING_CURSE}.
*/ */
- @Deprecated - @Deprecated(since = "1.13")
public abstract boolean isCursed(); public abstract boolean isCursed();
/** /**

View File

@@ -261,7 +261,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public ProjectileSource getShooter(); public ProjectileSource getShooter();
@@ -0,0 +0,0 @@ public interface Projectile extends Entity { @@ -0,0 +0,0 @@ public interface Projectile extends Entity {
*/ */
@Deprecated(forRemoval = true) @Deprecated(since = "1.20.2", forRemoval = true)
public void setBounce(boolean doesBounce); public void setBounce(boolean doesBounce);
+ // Paper start + // Paper start
+ +

View File

@@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* Create a smithing recipe to produce the specified result ItemStack. * Create a smithing recipe to produce the specified result ItemStack.
@@ -0,0 +0,0 @@ public class SmithingRecipe implements Recipe, Keyed { @@ -0,0 +0,0 @@ public class SmithingRecipe implements Recipe, Keyed {
*/ */
@Deprecated @Deprecated(since = "1.20.1")
public SmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @Nullable RecipeChoice base, @Nullable RecipeChoice addition) { public SmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @Nullable RecipeChoice base, @Nullable RecipeChoice addition) {
+ // Paper start + // Paper start
+ this(key, result, base, addition, true); + this(key, result, base, addition, true);

View File

@@ -1730,7 +1730,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
addPermission(perm, true); addPermission(perm, true);
} }
@Deprecated @Deprecated(since = "1.12")
public void addPermission(@NotNull Permission perm, boolean dirty) { public void addPermission(@NotNull Permission perm, boolean dirty) {
+ if (true) {this.paperPluginManager.addPermission(perm); return;} // Paper - This just has a performance implication, use the better api to avoid this. + if (true) {this.paperPluginManager.addPermission(perm); return;} // Paper - This just has a performance implication, use the better api to avoid this.
String name = perm.getName().toLowerCase(Locale.ROOT); String name = perm.getName().toLowerCase(Locale.ROOT);

View File

@@ -185,7 +185,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
*/ */
@Deprecated @Deprecated(since = "1.13")
public void setDurability(final short durability) { public void setDurability(final short durability) {
- ItemMeta meta = getItemMeta(); - ItemMeta meta = getItemMeta();
- if (meta != null) { - if (meta != null) {
@@ -198,7 +198,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
*/ */
@Deprecated @Deprecated(since = "1.13")
public short getDurability() { public short getDurability() {
- ItemMeta meta = getItemMeta(); - ItemMeta meta = getItemMeta();
- return (meta == null) ? 0 : (short) ((Damageable) meta).getDamage(); - return (meta == null) ? 0 : (short) ((Damageable) meta).getDamage();

View File

@@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final RespawnReason respawnReason; private final RespawnReason respawnReason;
+ private final java.util.Set<RespawnFlag> respawnFlags; // Paper + private final java.util.Set<RespawnFlag> respawnFlags; // Paper
@Deprecated @Deprecated(since = "1.16.1")
public PlayerRespawnEvent(@NotNull final Player respawnPlayer, @NotNull final Location respawnLocation, final boolean isBedSpawn) { public PlayerRespawnEvent(@NotNull final Player respawnPlayer, @NotNull final Location respawnLocation, final boolean isBedSpawn) {
@@ -0,0 +0,0 @@ public class PlayerRespawnEvent extends PlayerEvent { @@ -0,0 +0,0 @@ public class PlayerRespawnEvent extends PlayerEvent {
this(respawnPlayer, respawnLocation, isBedSpawn, false, RespawnReason.PLUGIN); this(respawnPlayer, respawnLocation, isBedSpawn, false, RespawnReason.PLUGIN);

View File

@@ -82,7 +82,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @return The type ID of this instrument. * @return The type ID of this instrument.
- * @deprecated Magic value - * @deprecated Magic value
*/ */
- @Deprecated - @Deprecated(since = "1.6.2")
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper + @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getType() { public byte getType() {
return this.type; return this.type;
@@ -93,7 +93,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @return The instrument * @return The instrument
- * @deprecated Magic value - * @deprecated Magic value
*/ */
- @Deprecated - @Deprecated(since = "1.6.2")
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper + @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable @Nullable
public static Instrument getByType(final byte type) { public static Instrument getByType(final byte type) {

View File

@@ -19,8 +19,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override @Override
@@ -0,0 +0,0 @@ public class BlockStateListPopulator extends DummyGeneratorAccess { @@ -0,0 +0,0 @@ public class BlockStateListPopulator extends DummyGeneratorAccess {
public long nextSubTickCount() { public RandomSource getRandom() {
return this.world.nextSubTickCount(); return this.world.getRandom();
} }
+ +
+ // Paper start + // Paper start

View File

@@ -100,7 +100,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java --- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java
+++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java +++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java
@@ -0,0 +0,0 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement { @@ -0,0 +0,0 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement {
return Collections.unmodifiableCollection(this.handle.value().criteria().keySet()); return new CraftAdvancementRequirements(this.handle.value().requirements());
} }
+ // Paper start - Add more advancement API + // Paper start - Add more advancement API

View File

@@ -53,6 +53,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ChunkGenerator chunkGenerator, ChunkGenerator chunkGenerator,
RandomState noiseConfig, RandomState noiseConfig,
LevelHeightAccessor world, LevelHeightAccessor world,
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -0,0 +0,0 @@ public class CraftChunk implements Chunk {
}
}
- return new CraftChunkSnapshot(x, z, world.getMinHeight(), world.getMaxHeight(), world.getSeaLevel(), world.getName(), world.getFullTime(), blockIDs, skyLight, emitLight, empty, new Heightmap(actual, Heightmap.Types.MOTION_BLOCKING), iregistry, biome);
+ return new CraftChunkSnapshot(x, z, world.getMinHeight(), world.getMaxY(), world.getSeaLevel(), world.getName(), world.getFullTime(), blockIDs, skyLight, emitLight, empty, new Heightmap(actual, Heightmap.Types.MOTION_BLOCKING), iregistry, biome);
}
static void validateChunkCoordinates(int minY, int maxY, int x, int y, int z) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java --- a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java
@@ -69,6 +82,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return this.world.getMaxY() + 1;
}
+ public int getMaxY() {
+ return this.world.getMaxY();
+ }
+
@Override
public int getLogicalHeight() {
return this.world.dimensionType().logicalHeight();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java

View File

@@ -1,22 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bjarne Koll <git@lynxplay.dev>
Date: Sat, 23 Nov 2024 22:48:26 +0100
Subject: [PATCH] Call ProjectileHitEvent for entity hits
A simple bugfix replacing a new vanilla call to
Projectile#hitTargetOrDeflectSelf with the bukkit replacement to call
the event.
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -0,0 +0,0 @@ public abstract class AbstractArrow extends Projectile {
continue;
}
- ProjectileDeflection projectiledeflection = this.hitTargetOrDeflectSelf(movingobjectpositionentity);
+ ProjectileDeflection projectiledeflection = this.preHitTargetOrDeflectSelf(movingobjectpositionentity); // Paper - also call projectile hit event
this.hasImpulse = true;
if (this.getPierceLevel() > 0 && projectiledeflection == ProjectileDeflection.NONE) {

View File

@@ -38,10 +38,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
private void finishConversion() { private void finishConversion() {
- this.convertTo( - this.convertTo(EntityType.ZOGLIN, ConversionParams.single(this, true, false), (entityzoglin) -> {
+ net.minecraft.world.entity.Entity converted = this.convertTo( // Paper - Fix issues with mob conversion; reset to prevent event spam + net.minecraft.world.entity.Entity converted = this.convertTo(EntityType.ZOGLIN, ConversionParams.single(this, true, false), (entityzoglin) -> {
EntityType.ZOGLIN, ConversionParams.single(this, true, false), zoglin -> zoglin.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0)) entityzoglin.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0));
); }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.PIGLIN_ZOMBIFIED, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.PIGLIN_ZOMBIFIED); // CraftBukkit - add spawn and transform reasons
+ +
+ // Paper start - Fix issues with mob conversion; reset to prevent event spam + // Paper start - Fix issues with mob conversion; reset to prevent event spam
+ if (converted == null) { + if (converted == null) {

View File

@@ -330,10 +330,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- private void addTask(final CraftTask task) { - private void addTask(final CraftTask task) {
+ protected void addTask(final CraftTask task) { + protected void addTask(final CraftTask task) {
final AtomicReference<CraftTask> tail = this.tail; final CraftTask tailTask = this.tail.getAndSet(task);
CraftTask tailTask = tail.get();
while (!tail.compareAndSet(tailTask, task)) {
@@ -0,0 +0,0 @@ public class CraftScheduler implements BukkitScheduler {
tailTask.setNext(task); tailTask.setNext(task);
} }