Add missing deprecation (#8886)

This commit is contained in:
Lulu13022002 2023-09-21 10:35:38 +02:00
parent 1830a8e09d
commit 6cc04e3081
3 changed files with 129 additions and 3 deletions

View File

@ -2471,15 +2471,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], Component)}
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], net.kyori.adventure.text.Component)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
+ @Deprecated // Paper
public void setResourcePack(@NotNull String url, @Nullable byte[] hash);
/**
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], Component, boolean)}
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], net.kyori.adventure.text.Component)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@ -2541,6 +2549,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
* Request that the player's client download and switch resource packs.
* <p>
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], net.kyori.adventure.text.Component, boolean)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.

View File

@ -307,6 +307,53 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull MaterialData data) throws IllegalArgumentException;
/**
@@ -0,0 +0,0 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
// Paper end - view distance api
// Spigot start
+ /**
+ * @deprecated Unsupported api
+ */
+ @Deprecated // Paper
public class Spigot {
/**
@@ -0,0 +0,0 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param loc The location to strike lightning
* @param isSilent Whether this strike makes no sound
* @return The lightning entity.
+ * @deprecated The lightning strike sound has been moved into the client and
+ * this doesn't prevent the sound being played. Use the regular (non spigot) methods instead
+ * for a consistent behavior.
*/
@NotNull
+ @Deprecated // Paper
public LightningStrike strikeLightning(@NotNull Location loc, boolean isSilent) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -0,0 +0,0 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param loc The location to strike lightning
* @param isSilent Whether this strike makes no sound
* @return The lightning entity.
+ * @deprecated The lightning strike sound has been moved into the client and
+ * this doesn't prevent the sound being played. Use the regular (non spigot) methods instead
+ * for a consistent behavior.
*/
@NotNull
+ @Deprecated // Paper
public LightningStrike strikeLightningEffect(@NotNull Location loc, boolean isSilent) {
throw new UnsupportedOperationException("Not supported yet.");
}
}
+ /**
+ * @deprecated Unsupported api
+ */
@NotNull
+ @Deprecated // Paper
Spigot spigot();
// Spigot end
diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/block/BlockState.java
@ -369,6 +416,43 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void setCarriedMaterial(@NotNull MaterialData material);
/**
diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
@@ -0,0 +0,0 @@ public interface LightningStrike extends Entity {
public boolean isEffect();
// Spigot start
+ /**
+ * @deprecated Unsupported api
+ */
+ @Deprecated // Paper
public class Spigot extends Entity.Spigot {
- /*
+ /**
* Returns whether the strike is silent.
*
* @return whether the strike is silent.
+ * @deprecated The lightning strike sound has been moved into the client and
+ * this can't predict if the sound will be played or not accurately.
*/
+ @Deprecated // Paper
public boolean isSilent() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
+ /**
+ * @deprecated Unsupported api
+ */
@NotNull
@Override
+ @Deprecated // Paper
Spigot spigot();
// Spigot end
}
diff --git a/src/main/java/org/bukkit/entity/LingeringPotion.java b/src/main/java/org/bukkit/entity/LingeringPotion.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/LingeringPotion.java
@ -605,6 +689,32 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public ItemStack getCursor() {
return getView().getCursor();
}
diff --git a/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java b/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java
@@ -0,0 +0,0 @@ public class PlayerBedLeaveEvent extends PlayerEvent implements Cancellable {
* {@link Player#setBedSpawnLocation(Location)}.
*
* @return true if the spawn location will be changed
+ * @deprecated the respawn point is now set when the player enter the bed and
+ * this option doesn't work since MC 1.15.
*/
+ @Deprecated(forRemoval = true) // Paper - Unused
public boolean shouldSetSpawnLocation() {
return setBedSpawn;
}
@@ -0,0 +0,0 @@ public class PlayerBedLeaveEvent extends PlayerEvent implements Cancellable {
* {@link Player#setBedSpawnLocation(Location)}.
*
* @param setBedSpawn true to change the new spawn location
+ * @deprecated the respawn point is now set when the player enter the bed and
+ * this option doesn't work since MC 1.15.
*/
+ @Deprecated(forRemoval = true) // Paper - Unused
public void setSpawnLocation(boolean setBedSpawn) {
this.setBedSpawn = setBedSpawn;
}
diff --git a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java

View File

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
@@ -0,0 +0,0 @@ public interface LightningStrike extends Entity {
@Override
@Deprecated // Paper
Spigot spigot();
// Spigot end
+