#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

@@ -17,7 +17,7 @@ public class BlockBurnEvent extends BlockEvent implements Cancellable {
private boolean cancelled;
private final Block ignitingBlock;
@Deprecated
@Deprecated(since = "1.11.2")
public BlockBurnEvent(@NotNull final Block block) {
this(block, null);
}

View File

@@ -26,7 +26,7 @@ public class BlockCanBuildEvent extends BlockEvent {
protected BlockData blockData;
private final Player player;
@Deprecated
@Deprecated(since = "1.13.2")
public BlockCanBuildEvent(@NotNull final Block block, @NotNull final BlockData type, final boolean canBuild) {
this(block, null, type, canBuild);
}

View File

@@ -16,7 +16,7 @@ public class BlockPistonExtendEvent extends BlockPistonEvent {
private final int length;
private List<Block> blocks;
@Deprecated
@Deprecated(since = "1.8")
public BlockPistonExtendEvent(@NotNull final Block block, final int length, @NotNull final BlockFace direction) {
super(block, direction);
@@ -37,7 +37,7 @@ public class BlockPistonExtendEvent extends BlockPistonEvent {
* @deprecated slime blocks make the value of this method
* inaccurate due to blocks being pushed at the side
*/
@Deprecated
@Deprecated(since = "1.8")
public int getLength() {
return this.length;
}

View File

@@ -26,7 +26,7 @@ public class BlockPistonRetractEvent extends BlockPistonEvent {
*
* @return The possible location of the possibly moving block.
*/
@Deprecated
@Deprecated(since = "1.8")
@NotNull
public Location getRetractLocation() {
return getBlock().getRelative(getDirection(), 2).getLocation();

View File

@@ -24,7 +24,7 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
protected Player player;
protected EquipmentSlot hand;
@Deprecated
@Deprecated(since = "1.9")
public BlockPlaceEvent(@NotNull final Block placedBlock, @NotNull final BlockState replacedBlockState, @NotNull final Block placedAgainst, @NotNull final ItemStack itemInHand, @NotNull final Player thePlayer, final boolean canBuild) {
this(placedBlock, replacedBlockState, placedAgainst, itemInHand, thePlayer, canBuild, EquipmentSlot.HAND);
}

View File

@@ -60,7 +60,7 @@ public class CauldronLevelChangeEvent extends BlockEvent implements Cancellable
* @see #getBlock()
* @deprecated not all cauldron contents are Levelled
*/
@Deprecated
@Deprecated(since = "1.17")
public int getOldLevel() {
BlockData oldBlock = getBlock().getBlockData();
return (oldBlock instanceof Levelled) ? ((Levelled) oldBlock).getLevel() : ((oldBlock.getMaterial() == Material.CAULDRON) ? 0 : 3);
@@ -73,7 +73,7 @@ public class CauldronLevelChangeEvent extends BlockEvent implements Cancellable
* @see #getNewState()
* @deprecated not all cauldron contents are Levelled
*/
@Deprecated
@Deprecated(since = "1.17")
public int getNewLevel() {
BlockData newBlock = newState.getBlockData();
return (newBlock instanceof Levelled) ? ((Levelled) newBlock).getLevel() : ((newBlock.getMaterial() == Material.CAULDRON) ? 0 : 3);
@@ -86,7 +86,7 @@ public class CauldronLevelChangeEvent extends BlockEvent implements Cancellable
* @see #getNewState()
* @deprecated not all cauldron contents are Levelled
*/
@Deprecated
@Deprecated(since = "1.17")
public void setNewLevel(int newLevel) {
Preconditions.checkArgument(0 <= newLevel && newLevel <= 3, "Cauldron level out of bounds 0 <= %s <= 3", newLevel);
if (newLevel == 0) {

View File

@@ -60,7 +60,7 @@ public class NotePlayEvent extends BlockEvent implements Cancellable {
* @param instrument the Instrument. Has no effect if null.
* @deprecated no effect on newer Minecraft versions
*/
@Deprecated
@Deprecated(since = "1.13")
public void setInstrument(@NotNull Instrument instrument) {
if (instrument != null) {
this.instrument = instrument;
@@ -73,7 +73,7 @@ public class NotePlayEvent extends BlockEvent implements Cancellable {
* @param note the Note. Has no effect if null.
* @deprecated no effect on newer Minecraft versions
*/
@Deprecated
@Deprecated(since = "1.13")
public void setNote(@NotNull Note note) {
if (note != null) {
this.note = note;

View File

@@ -20,7 +20,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
private final String[] lines;
private final Side side;
@Deprecated
@Deprecated(since = "1.19.4")
public SignChangeEvent(@NotNull final Block theBlock, @NotNull final Player thePlayer, @NotNull final String[] theLines) {
this(theBlock, thePlayer, theLines, Side.FRONT);
}