#1082: Add "since" to Deprecation annotations

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
Bukkit/Spigot
2024-11-25 07:52:33 +11:00
parent 98f6ab9a04
commit 0023e5549a
257 changed files with 1523 additions and 1176 deletions

View File

@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
*
* @deprecated chat previews have been removed
*/
@Deprecated
@Deprecated(since = "1.19.1")
@Warning(false)
public class AsyncPlayerChatPreviewEvent extends AsyncPlayerChatEvent {

View File

@@ -20,12 +20,12 @@ public class AsyncPlayerPreLoginEvent extends Event {
private final UUID uniqueId;
private final boolean transferred;
@Deprecated
@Deprecated(since = "1.7.5")
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress) {
this(name, ipAddress, null);
}
@Deprecated
@Deprecated(since = "1.20.5")
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId) {
this(name, ipAddress, uniqueId, false);
}
@@ -58,7 +58,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
* @deprecated This method uses a deprecated enum from {@link
* PlayerPreLoginEvent}
*/
@Deprecated
@Deprecated(since = "1.3.2")
@NotNull
public PlayerPreLoginEvent.Result getResult() {
return result == null ? null : result.old();
@@ -81,7 +81,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
* @deprecated This method uses a deprecated enum from {@link
* PlayerPreLoginEvent}
*/
@Deprecated
@Deprecated(since = "1.3.2")
public void setResult(@NotNull final PlayerPreLoginEvent.Result result) {
this.result = result == null ? null : Result.valueOf(result.name());
}
@@ -134,7 +134,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
* @deprecated This method uses a deprecated enum from {@link
* PlayerPreLoginEvent}
*/
@Deprecated
@Deprecated(since = "1.3.2")
public void disallow(@NotNull final PlayerPreLoginEvent.Result result, @NotNull final String message) {
this.result = result == null ? null : Result.valueOf(result.name());
this.message = message;
@@ -217,7 +217,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
*/
KICK_OTHER;
@Deprecated
@Deprecated(since = "1.3.2")
@NotNull
private PlayerPreLoginEvent.Result old() {
return PlayerPreLoginEvent.Result.valueOf(name());

View File

@@ -13,7 +13,7 @@ public class PlayerAnimationEvent extends PlayerEvent implements Cancellable {
private final PlayerAnimationType animationType;
private boolean isCancelled = false;
@Deprecated
@Deprecated(since = "1.19")
public PlayerAnimationEvent(@NotNull final Player player) {
this(player, PlayerAnimationType.ARM_SWING);
}

View File

@@ -26,7 +26,7 @@ public class PlayerArmorStandManipulateEvent extends PlayerInteractEntityEvent {
this.slot = slot;
}
@Deprecated
@Deprecated(since = "1.19.2")
public PlayerArmorStandManipulateEvent(@NotNull final Player who, @NotNull final ArmorStand clickedEntity, @NotNull final ItemStack playerItem, @NotNull final ItemStack armorStandItem, @NotNull final EquipmentSlot slot) {
this(who, clickedEntity, playerItem, armorStandItem, slot, EquipmentSlot.HAND);
}

View File

@@ -63,7 +63,7 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
this.bedEnterResult = bedEnterResult;
}
@Deprecated
@Deprecated(since = "1.13.2")
public PlayerBedEnterEvent(@NotNull Player who, @NotNull Block bed) {
this(who, bed, BedEnterResult.OK);
}

View File

@@ -15,12 +15,12 @@ import org.jetbrains.annotations.NotNull;
public class PlayerBucketEmptyEvent extends PlayerBucketEvent {
private static final HandlerList handlers = new HandlerList();
@Deprecated
@Deprecated(since = "1.14.4")
public PlayerBucketEmptyEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand) {
super(who, blockClicked, blockFace, bucket, itemInHand);
}
@Deprecated
@Deprecated(since = "1.19.2")
public PlayerBucketEmptyEvent(@NotNull final Player who, @NotNull final Block block, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand) {
super(who, block, blockClicked, blockFace, bucket, itemInHand);
}

View File

@@ -24,12 +24,12 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab
private final Material bucket;
private final EquipmentSlot hand;
@Deprecated
@Deprecated(since = "1.14.4")
public PlayerBucketEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand) {
this(who, null, blockClicked.getRelative(blockFace), blockFace, bucket, itemInHand, EquipmentSlot.HAND);
}
@Deprecated
@Deprecated(since = "1.19.2")
public PlayerBucketEvent(@NotNull final Player who, @NotNull final Block block, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand) {
this(who, block, blockClicked, blockFace, bucket, itemInHand, EquipmentSlot.HAND);
}

View File

@@ -15,12 +15,12 @@ import org.jetbrains.annotations.NotNull;
public class PlayerBucketFillEvent extends PlayerBucketEvent {
private static final HandlerList handlers = new HandlerList();
@Deprecated
@Deprecated(since = "1.14.4")
public PlayerBucketFillEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand) {
super(who, blockClicked, blockFace, bucket, itemInHand);
}
@Deprecated
@Deprecated(since = "1.19.2")
public PlayerBucketFillEvent(@NotNull final Player who, @NotNull final Block block, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand) {
super(who, block, blockClicked, blockFace, bucket, itemInHand);
}

View File

@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
*
* @deprecated Use the more generic {@link PlayerBucketEntityEvent}
*/
@Deprecated
@Deprecated(since = "1.16.5")
@Warning(false)
public class PlayerBucketFishEvent extends PlayerBucketEntityEvent {
@@ -41,7 +41,7 @@ public class PlayerBucketFishEvent extends PlayerBucketEntityEvent {
* @deprecated Use {@link #getOriginalBucket()}
*/
@NotNull
@Deprecated
@Deprecated(since = "1.16.5")
public ItemStack getWaterBucket() {
return getOriginalBucket();
}
@@ -56,7 +56,7 @@ public class PlayerBucketFishEvent extends PlayerBucketEntityEvent {
* @deprecated Use {@link #getEntityBucket()}
*/
@NotNull
@Deprecated
@Deprecated(since = "1.16.5")
public ItemStack getFishBucket() {
return getEntityBucket();
}

View File

@@ -19,7 +19,7 @@ import org.jetbrains.annotations.NotNull;
* causes delays for chat. {@link AsyncPlayerChatEvent} is the encouraged
* alternative for thread safe implementations.
*/
@Deprecated
@Deprecated(since = "1.3.1")
@Warning(reason = "Listening to this event forces chat to wait for the main thread, delaying chat messages.")
public class PlayerChatEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();

View File

@@ -12,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
*
* @deprecated This event is no longer fired due to client changes
*/
@Deprecated
@Deprecated(since = "1.13")
@Warning(reason = "This event is no longer fired due to client changes")
public class PlayerChatTabCompleteEvent extends PlayerEvent {
private static final HandlerList handlers = new HandlerList();

View File

@@ -127,7 +127,7 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell
* guarantee to the effect of viewing or modifying the set.
*/
@NotNull
@Deprecated
@Deprecated(since = "1.3.1")
public Set<Player> getRecipients() {
return recipients;
}

View File

@@ -74,7 +74,7 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable {
* @return the inventory slot number that the book item occupies
* @deprecated books may be signed from off hand
*/
@Deprecated
@Deprecated(since = "1.13.1")
public int getSlot() {
return slot;
}

View File

@@ -34,7 +34,7 @@ public class PlayerHarvestBlockEvent extends PlayerEvent implements Cancellable
this.itemsHarvested = itemsHarvested;
}
@Deprecated
@Deprecated(since = "1.19.2")
public PlayerHarvestBlockEvent(@NotNull Player player, @NotNull Block harvestedBlock, @NotNull List<ItemStack> itemsHarvested) {
this(player, harvestedBlock, EquipmentSlot.HAND, itemsHarvested);
}

View File

@@ -79,7 +79,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
* the case of using a firework whilst gliding. Callers should check the
* relevant methods individually.
*/
@Deprecated
@Deprecated(since = "1.14")
@Override
public boolean isCancelled() {
return useInteractedBlock() == Result.DENY;

View File

@@ -42,7 +42,7 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable {
* @param item the ItemStack being consumed
* @deprecated use {@link #PlayerItemConsumeEvent(Player, ItemStack, EquipmentSlot)}
*/
@Deprecated
@Deprecated(since = "1.19.2")
public PlayerItemConsumeEvent(@NotNull final Player player, @NotNull final ItemStack item) {
this(player, item, EquipmentSlot.HAND);
}

View File

@@ -32,7 +32,7 @@ public class PlayerItemMendEvent extends PlayerEvent implements Cancellable {
this.repairAmount = repairAmount;
}
@Deprecated
@Deprecated(since = "1.19.2")
public PlayerItemMendEvent(@NotNull Player who, @NotNull ItemStack item, @NotNull ExperienceOrb experienceOrb, int repairAmount) {
this(who, item, null, experienceOrb, repairAmount);
}

View File

@@ -12,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
* Thrown when a player picks an item up from the ground
* @deprecated {@link EntityPickupItemEvent}
*/
@Deprecated
@Deprecated(since = "1.12")
@Warning(false)
public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();

View File

@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
* AsyncPlayerPreLoginEvent} is preferred to keep the secondary threads
* asynchronous.
*/
@Deprecated
@Deprecated(since = "1.3.2")
@Warning(reason = "This event causes a login thread to synchronize with the main thread")
public class PlayerPreLoginEvent extends Event {
private static final HandlerList handlers = new HandlerList();
@@ -24,7 +24,7 @@ public class PlayerPreLoginEvent extends Event {
private final InetAddress ipAddress;
private final UUID uniqueId;
@Deprecated
@Deprecated(since = "1.7.5")
public PlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress) {
this(name, ipAddress, null);
}

View File

@@ -16,12 +16,12 @@ public class PlayerRespawnEvent extends PlayerEvent {
private final boolean isAnchorSpawn;
private final RespawnReason respawnReason;
@Deprecated
@Deprecated(since = "1.16.1")
public PlayerRespawnEvent(@NotNull final Player respawnPlayer, @NotNull final Location respawnLocation, final boolean isBedSpawn) {
this(respawnPlayer, respawnLocation, isBedSpawn, false);
}
@Deprecated
@Deprecated(since = "1.19.4")
public PlayerRespawnEvent(@NotNull final Player respawnPlayer, @NotNull final Location respawnLocation, final boolean isBedSpawn, final boolean isAnchorSpawn) {
this(respawnPlayer, respawnLocation, isBedSpawn, false, RespawnReason.PLUGIN);
}

View File

@@ -25,7 +25,7 @@ public class PlayerRiptideEvent extends PlayerEvent {
this.velocity = velocity;
}
@Deprecated
@Deprecated(since = "1.20.4")
public PlayerRiptideEvent(@NotNull final Player who, @NotNull final ItemStack item) {
this(who, item, new Vector());
}

View File

@@ -26,7 +26,7 @@ public class PlayerShearEntityEvent extends PlayerEvent implements Cancellable {
this.hand = hand;
}
@Deprecated
@Deprecated(since = "1.15.2")
public PlayerShearEntityEvent(@NotNull final Player who, @NotNull final Entity what) {
this(who, what, new ItemStack(Material.SHEARS), EquipmentSlot.HAND);
}

View File

@@ -23,7 +23,7 @@ public class PlayerUnleashEntityEvent extends EntityUnleashEvent implements Canc
this.hand = hand;
}
@Deprecated
@Deprecated(since = "1.19.2")
public PlayerUnleashEntityEvent(@NotNull Entity entity, @NotNull Player player) {
this(entity, player, EquipmentSlot.HAND);
}