2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 24 Mar 2019 18:39:01 -0400
2021-07-30 01:04:26 +02:00
Subject: [PATCH] Fix Spigot annotation mistakes
2021-06-11 14:02:28 +02:00
while some of these may of been true, they are extreme cases and cause
a ton of noise to plugin developers.
2023-11-11 22:52:32 +01:00
Use ApiStatus.Internal instead of Deprecated for actual internal API
that continues to have use (internally).
2021-06-11 14:02:28 +02:00
These do not help plugin developers if they bring moise noise than value.
2023-11-11 22:52:32 +01:00
diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java
index ac420f0059fc50d3e1294f85df7515c9e17ff78f..24daba85ce4129fb0babe67570059ca8119360c0 100644
--- a/src/main/java/org/bukkit/Art.java
+++ b/src/main/java/org/bukkit/Art.java
@@ -75,9 +75,9 @@ public enum Art implements Keyed {
* Get the ID of this painting.
*
* @return The ID of this painting
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public int getId() {
return id;
}
@@ -93,9 +93,9 @@ public enum Art implements Keyed {
*
* @param id The ID
* @return The painting
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static Art getById(int id) {
return BY_ID.get(id);
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
2024-04-06 23:20:29 +02:00
index ac84e6d10a337f767477177ef90ad10d754341e6..4716b9a9ebaf3deb0a262d4ea1da492547be4913 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
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:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
@@ -868,9 +868,8 @@ public final class Bukkit {
2023-05-15 02:23:57 +02:00
*
* @param id the id of the map to get
* @return a map view if it exists, or null otherwise
- * @deprecated Magic value
*/
- @Deprecated
+ //@Deprecated // Paper - Not a magic value
@Nullable
public static MapView getMap(int id) {
return server.getMap(id);
2024-04-06 23:20:29 +02:00
@@ -949,8 +948,14 @@ public final class Bukkit {
* Returns the primary logger associated with this server instance.
*
* @return Logger associated with this server
+ * @see org.bukkit.plugin.Plugin#getSLF4JLogger()
+ * @apiNote This logger is for the Minecraft server software, not for specific plugins. You should
+ * use a logger for a specific plugin, either via {@link org.bukkit.plugin.Plugin#getSLF4JLogger()}
+ * or {@link org.bukkit.plugin.Plugin#getLogger()} or create a specific logger for a class via slf4j.
+ * That way, log messages contain contextual information about the source of the message.
*/
@NotNull
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper - internalize Bukkit#getLogger
public static Logger getLogger() {
return server.getLogger();
}
@@ -1337,10 +1342,8 @@ public final class Bukkit {
2022-05-06 14:21:58 +02:00
* @param name the name the player to retrieve
* @return an offline player
* @see #getOfflinePlayer(java.util.UUID)
- * @deprecated Persistent storage of users should be by UUID as names are no longer
- * unique past a single session.
*/
- @Deprecated
+ // @Deprecated // Paper
@NotNull
public static OfflinePlayer getOfflinePlayer(@NotNull String name) {
return server.getOfflinePlayer(name);
2024-04-06 23:20:29 +02:00
@@ -1931,7 +1934,7 @@ public final class Bukkit {
2021-06-11 14:02:28 +02:00
*
* @return the scoreboard manager or null if no worlds are loaded.
*/
- @Nullable
+ @NotNull // Paper
public static ScoreboardManager getScoreboardManager() {
return server.getScoreboardManager();
}
2023-11-11 22:52:32 +01:00
diff --git a/src/main/java/org/bukkit/CoalType.java b/src/main/java/org/bukkit/CoalType.java
index c07499dbdd49d70717dbd674d97b6dbcfd7e9d5b..75e563d2a6d417b95c7f06a0636811aec8259672 100644
--- a/src/main/java/org/bukkit/CoalType.java
+++ b/src/main/java/org/bukkit/CoalType.java
@@ -7,6 +7,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents the two types of coal
*/
+@Deprecated // Paper
public enum CoalType {
COAL(0x0),
CHARCOAL(0x1);
diff --git a/src/main/java/org/bukkit/CropState.java b/src/main/java/org/bukkit/CropState.java
index fb4832fb796a38c0f5f51cf80a67259924f2c607..519deeeb86672fd75ae62026f956727d01f78fef 100644
--- a/src/main/java/org/bukkit/CropState.java
+++ b/src/main/java/org/bukkit/CropState.java
@@ -7,6 +7,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents the different growth states of crops
*/
+@Deprecated // Paper
public enum CropState {
/**
diff --git a/src/main/java/org/bukkit/Difficulty.java b/src/main/java/org/bukkit/Difficulty.java
index 3f6cbefc2b1414ba2dad709e79288013b3ef73be..f35801783538d3377b04131b8bf6effd7eb8e1a5 100644
--- a/src/main/java/org/bukkit/Difficulty.java
+++ b/src/main/java/org/bukkit/Difficulty.java
@@ -44,9 +44,9 @@ public enum Difficulty {
* Gets the difficulty value associated with this Difficulty.
*
* @return An integer value of this difficulty
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public int getValue() {
return value;
}
@@ -57,9 +57,9 @@ public enum Difficulty {
* @param value Value to check
* @return Associative {@link Difficulty} with the given value, or null if
* it doesn't exist
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static Difficulty getByValue(final int value) {
return BY_ID.get(value);
diff --git a/src/main/java/org/bukkit/DyeColor.java b/src/main/java/org/bukkit/DyeColor.java
index bd213cabddd8752e609544f24cfba95405726155..47df858e095c4423c20e49e029d72f0f50d2c924 100644
--- a/src/main/java/org/bukkit/DyeColor.java
+++ b/src/main/java/org/bukkit/DyeColor.java
@@ -96,9 +96,9 @@ public enum DyeColor {
*
* @return A byte containing the wool data value of this color
* @see #getDyeData()
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getWoolData() {
return woolData;
}
@@ -142,9 +142,9 @@ public enum DyeColor {
* @return The {@link DyeColor} representing the given value, or null if
* it doesn't exist
* @see #getByDyeData(byte)
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static DyeColor getByWoolData(final byte data) {
int i = 0xff & data;
@@ -202,9 +202,9 @@ public enum DyeColor {
*
* @param name dye name
* @return dye color
- * @deprecated legacy use only
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@NotNull
public static DyeColor legacyValueOf(@Nullable String name) {
return "SILVER".equals(name) ? DyeColor.LIGHT_GRAY : DyeColor.valueOf(name);
diff --git a/src/main/java/org/bukkit/Effect.java b/src/main/java/org/bukkit/Effect.java
index 879d637691683ca862045402f74b751a892bf3ff..611b7df0e31de932f15c2f13bd8ed286e0b3b43f 100644
--- a/src/main/java/org/bukkit/Effect.java
+++ b/src/main/java/org/bukkit/Effect.java
@@ -358,9 +358,9 @@ public enum Effect {
* Gets the ID for this effect.
*
* @return ID of this effect
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public int getId() {
return this.id;
}
@@ -387,9 +387,9 @@ public enum Effect {
*
* @param id ID of the Effect to return
* @return Effect with the given ID
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static Effect getById(int id) {
return BY_ID.get(id);
diff --git a/src/main/java/org/bukkit/EntityEffect.java b/src/main/java/org/bukkit/EntityEffect.java
2023-11-25 23:34:42 +01:00
index 9db85b2f6ffd56bbc4db1f75f8769f1c15d5950f..5341957b10cccd7bce5a7595699b1d90412a01d0 100644
2023-11-11 22:52:32 +01:00
--- a/src/main/java/org/bukkit/EntityEffect.java
+++ b/src/main/java/org/bukkit/EntityEffect.java
2023-11-25 23:34:42 +01:00
@@ -345,9 +345,9 @@ public enum EntityEffect {
* Gets the data value of this EntityEffect, may not be unique.
2023-11-11 22:52:32 +01:00
*
* @return The data value
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getData() {
return data;
}
diff --git a/src/main/java/org/bukkit/GameMode.java b/src/main/java/org/bukkit/GameMode.java
index 938c3217f92e6d3ef9a637269c469f8359af6347..81e45984a88fc84acd0f76d825abf4ddaed0ac3b 100644
--- a/src/main/java/org/bukkit/GameMode.java
+++ b/src/main/java/org/bukkit/GameMode.java
@@ -44,9 +44,9 @@ public enum GameMode {
* Gets the mode value associated with this GameMode
*
* @return An integer value of this gamemode
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public int getValue() {
return value;
}
@@ -57,9 +57,9 @@ public enum GameMode {
* @param value Value to check
* @return Associative {@link GameMode} with the given value, or null if
* it doesn't exist
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static GameMode getByValue(final int value) {
return BY_ID.get(value);
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/GrassSpecies.java b/src/main/java/org/bukkit/GrassSpecies.java
index f9c9ae463aacd593e3aa9caf037ea1e23d56c780..f8ae143acbf586d5279b44f7311ca97f3ae4ead2 100644
--- a/src/main/java/org/bukkit/GrassSpecies.java
+++ b/src/main/java/org/bukkit/GrassSpecies.java
@@ -6,7 +6,9 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents the different types of grass.
+ * @deprecated use {@link org.bukkit.block.data.BlockData}
*/
+@Deprecated // Paper
public enum GrassSpecies {
/**
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
2024-01-24 22:13:08 +01:00
index 02b4ffa6b918269bd64f7c518fcceef1f6990737..f0878c7539696cc0676e6010e88914d3850acf20 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
2022-12-11 01:50:32 +01:00
@@ -46,7 +46,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
2021-06-11 14:02:28 +02:00
* @param y The y-coordinate of this new location
* @param z The z-coordinate of this new location
*/
- public Location(@Nullable final World world, final double x, final double y, final double z) {
+ public Location(@UndefinedNullability final World world, final double x, final double y, final double z) { // Paper
this(world, x, y, z, 0, 0);
}
2022-12-11 01:50:32 +01:00
@@ -60,7 +60,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
2021-06-11 14:02:28 +02:00
* @param yaw The absolute rotation on the x-plane, in degrees
* @param pitch The absolute rotation on the y-plane, in degrees
*/
- public Location(@Nullable final World world, final double x, final double y, final double z, final float yaw, final float pitch) {
2021-07-30 01:04:26 +02:00
+ public Location(@UndefinedNullability final World world, final double x, final double y, final double z, final float yaw, final float pitch) { // Paper
2021-06-11 14:02:28 +02:00
if (world != null) {
this.world = new WeakReference<>(world);
}
2022-12-11 01:50:32 +01:00
@@ -102,7 +102,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
2021-06-11 14:02:28 +02:00
* @throws IllegalArgumentException when world is unloaded
* @see #isWorldLoaded()
*/
- @Nullable
2021-07-30 01:04:26 +02:00
+ @UndefinedNullability // Paper
2021-06-11 14:02:28 +02:00
public World getWorld() {
if (this.world == null) {
return null;
2022-03-31 18:13:19 +02:00
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
2023-12-05 18:33:18 +01:00
index 55fa9e8385e26aecb5690f623c2893972dc2a234..c24fe19600fa8440c130eaea247d5874da3873ec 100644
2022-03-31 18:13:19 +02:00
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
2023-12-05 18:33:18 +01:00
@@ -4705,20 +4705,20 @@ public enum Material implements Keyed, Translatable {
2023-11-11 22:52:32 +01:00
* Do not use for any reason.
*
* @return ID of this material
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public int getId() {
Preconditions.checkArgument(legacy, "Cannot get ID of Modern Material");
return id;
2022-03-31 18:13:19 +02:00
}
/**
- * Do not use for any reason.
+ * Checks if this constant is a legacy material.
*
* @return legacy status
*/
- @Deprecated
+ // @Deprecated // Paper - this is useful, don't deprecate
public boolean isLegacy() {
return legacy;
}
2023-12-05 18:33:18 +01:00
@@ -4789,8 +4789,10 @@ public enum Material implements Keyed, Translatable {
2022-05-16 04:33:03 +02:00
* Gets the MaterialData class associated with this Material
*
* @return MaterialData associated with this Material
+ * @deprecated use {@link #createBlockData()}
*/
@NotNull
+ @Deprecated // Paper
public Class<? extends MaterialData> getData() {
2022-06-07 19:20:30 +02:00
Preconditions.checkArgument(legacy, "Cannot get data class of Modern Material");
2022-05-16 04:33:03 +02:00
return ctor.getDeclaringClass();
2023-12-05 18:33:18 +01:00
@@ -9052,7 +9054,11 @@ public enum Material implements Keyed, Translatable {
2023-11-11 23:21:22 +01:00
* material.
*
* @return true if this material can be interacted with.
+ * @deprecated This method is not comprehensive and does not accurately reflect what block types are
+ * interactable. Many "interactions" are defined on the item not block, and many are conditional on some other world state
+ * checks being true.
*/
+ @Deprecated // Paper
public boolean isInteractable() {
switch (this) {
// <editor-fold defaultstate="collapsed" desc="isInteractable">
2022-04-23 11:25:30 +02:00
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
2023-10-26 23:56:40 +02:00
index 6fa219aef009f8dfb8a2b1e5ee0603b18cf3d0f5..8ac72cb0b05e2c493d98310f2e87c3714d15c5e3 100644
2022-04-23 11:25:30 +02:00
--- a/src/main/java/org/bukkit/NamespacedKey.java
+++ b/src/main/java/org/bukkit/NamespacedKey.java
2023-10-26 23:56:40 +02:00
@@ -74,12 +74,14 @@ public final class NamespacedKey implements net.kyori.adventure.key.Key, com.des
2022-04-23 11:25:30 +02:00
/**
* Create a key in a specific namespace.
+ * <p>
+ * For most plugin related code, you should prefer using the
+ * {@link NamespacedKey#NamespacedKey(Plugin, String)} constructor.
*
* @param namespace namespace
* @param key key
2023-10-26 23:56:40 +02:00
- * @apiNote should never be used by plugins, for internal use only!!
2022-04-23 11:25:30 +02:00
+ * @see #NamespacedKey(Plugin, String)
*/
2023-10-26 23:56:40 +02:00
- @ApiStatus.Internal
2022-04-23 11:25:30 +02:00
public NamespacedKey(@NotNull String namespace, @NotNull String key) {
2023-02-07 16:55:53 +01:00
Preconditions.checkArgument(namespace != null && isValidNamespace(namespace), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace);
Preconditions.checkArgument(key != null && isValidKey(key), "Invalid key. Must be [a-z0-9/._-]: %s", key);
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/NetherWartsState.java b/src/main/java/org/bukkit/NetherWartsState.java
index f43209cf7b752c26718c303ca8c3e1c7d9912ad3..f0094e6fb05e526736629ad3181c8d2c16ba6ca4 100644
--- a/src/main/java/org/bukkit/NetherWartsState.java
+++ b/src/main/java/org/bukkit/NetherWartsState.java
@@ -1,5 +1,11 @@
package org.bukkit;
+// Paper start
+/**
+ * @deprecated use {@link org.bukkit.block.data.BlockData} and {@link org.bukkit.block.data.Ageable}
+ */
+@Deprecated
+// Paper end
public enum NetherWartsState {
/**
2023-11-11 22:52:32 +01:00
diff --git a/src/main/java/org/bukkit/Note.java b/src/main/java/org/bukkit/Note.java
2023-11-25 23:34:42 +01:00
index 48aecc9421c500137bbef1dfe3bec8de277c3ff9..aff858346776386f1288b648b221404f7f412399 100644
2023-11-11 22:52:32 +01:00
--- a/src/main/java/org/bukkit/Note.java
+++ b/src/main/java/org/bukkit/Note.java
@@ -39,9 +39,9 @@ public class Note {
* Returns the not sharped id of this tone.
*
* @return the not sharped id of this tone.
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getId() {
return getId(false);
}
@@ -53,9 +53,9 @@ public class Note {
*
* @param sharped Set to true to return the sharped id.
* @return the id of this tone.
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getId(boolean sharped) {
byte id = (byte) (sharped && sharpable ? this.id + 1 : this.id);
@@ -78,9 +78,9 @@ public class Note {
* @return if the tone id is the sharped id of the tone.
* @throws IllegalArgumentException if neither the tone nor the
* semitone have the id.
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public boolean isSharped(byte id) {
if (id == getId(false)) {
return false;
@@ -97,9 +97,9 @@ public class Note {
*
* @param id the id of the tone.
* @return the tone to id.
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static Tone getById(byte id) {
return BY_DATA.get(id);
2023-11-25 23:34:42 +01:00
@@ -222,9 +222,9 @@ public class Note {
2023-11-11 22:52:32 +01:00
* Returns the internal id of this note.
*
* @return the internal id of this note.
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getId() {
return note;
}
2023-10-26 23:56:40 +02:00
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
2023-12-06 22:59:39 +01:00
index 26d02aa5da444112f8fa84c07e3080bb669983a1..0cb15350704955f4a1aeff184a8b60d9a9871ded 100644
2023-10-26 23:56:40 +02:00
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -54,7 +54,9 @@ public enum Particle implements Keyed {
BLOCK_CRACK("block", BlockData.class),
/**
* Uses {@link BlockData} as DataType
+ * @deprecated use {@link #BLOCK_CRACK}
*/
+ @Deprecated // Paper
BLOCK_DUST("block", BlockData.class, false),
WATER_DROP("rain"),
MOB_APPEARANCE("elder_guardian"),
2023-12-06 22:59:39 +01:00
@@ -148,15 +150,21 @@ public enum Particle implements Keyed {
2023-10-26 23:56:40 +02:00
// ----- Legacy Separator -----
/**
* Uses {@link MaterialData} as DataType
+ * @deprecated {@link MaterialData} is deprecated API
*/
+ @Deprecated // Paper
LEGACY_BLOCK_CRACK(null, MaterialData.class, false),
/**
* Uses {@link MaterialData} as DataType
+ * @deprecated {@link MaterialData} is deprecated API
*/
+ @Deprecated // Paper
LEGACY_BLOCK_DUST(null, MaterialData.class, false),
/**
* Uses {@link MaterialData} as DataType
+ * @deprecated {@link MaterialData} is deprecated API
*/
+ @Deprecated // Paper
LEGACY_FALLING_DUST(null, MaterialData.class, false);
private final NamespacedKey key;
2023-02-15 23:10:14 +01:00
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
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:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
index db45423936d48835dee35d01ee502cdfdce4f68a..b3f8a2611ceb57f5d0b5c300fa80d8bad121498d 100644
2023-02-15 23:10:14 +01:00
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
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:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
@@ -199,14 +199,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
2023-06-07 21:47:39 +02:00
*
* @see TrimMaterial
*/
- @ApiStatus.Experimental
Registry<TrimMaterial> TRIM_MATERIAL = Bukkit.getRegistry(TrimMaterial.class);
/**
* Trim patterns.
*
* @see TrimPattern
*/
- @ApiStatus.Experimental
Registry<TrimPattern> TRIM_PATTERN = Bukkit.getRegistry(TrimPattern.class);
/**
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
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:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
* Damage types.
@@ -295,8 +293,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
2023-02-15 23:10:14 +01:00
*
* @param input non-null input
* @return registered object or null if does not exist
+ * @deprecated this method's behavior is broken and not useful. If you want to get an object
+ * based on its vanilla name, or a key, wrap it in a {@link NamespacedKey} object and use {@link #get(NamespacedKey)}
*/
@Nullable
+ @Deprecated(forRemoval = true) // Paper
default T match(@NotNull String input) {
Preconditions.checkArgument(input != null, "input must not be null");
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/SandstoneType.java b/src/main/java/org/bukkit/SandstoneType.java
index 6277451c3c6c551078c237cd767b6d70c4f585ea..10f5cfb1885833a1d2c1027c03974da45ab28e2f 100644
--- a/src/main/java/org/bukkit/SandstoneType.java
+++ b/src/main/java/org/bukkit/SandstoneType.java
@@ -6,7 +6,9 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents the three different types of Sandstone
+ * @deprecated use {@link org.bukkit.block.data.BlockData}
*/
+@Deprecated // Paper
public enum SandstoneType {
CRACKED(0x0),
GLYPHED(0x1),
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
2024-04-06 23:20:29 +02:00
index 050cdd5147814b39d158f0ce0fa8f5aa20894cf7..1f98a99eea0fb9a7ebef5d650640e7dac392416e 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
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:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
@@ -728,9 +728,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
2023-05-15 02:23:57 +02:00
*
* @param id the id of the map to get
* @return a map view if it exists, or null otherwise
- * @deprecated Magic value
*/
- @Deprecated
+ //@Deprecated // Paper - Not a magic value
@Nullable
public MapView getMap(int id);
2024-04-06 23:20:29 +02:00
@@ -797,8 +796,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* Returns the primary logger associated with this server instance.
*
* @return Logger associated with this server
+ * @see org.bukkit.plugin.Plugin#getSLF4JLogger()
+ * @apiNote This logger is for the Minecraft server software, not for specific plugins. You should
+ * use a logger for a specific plugin, either via {@link org.bukkit.plugin.Plugin#getSLF4JLogger()}
+ * or {@link org.bukkit.plugin.Plugin#getLogger()} or create a specific logger for a class via slf4j.
+ * That way, log messages contain contextual information about the source of the message.
*/
@NotNull
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper - internalize Bukkit#getLogger
public Logger getLogger();
/**
@@ -1127,10 +1132,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
2022-05-06 14:21:58 +02:00
* @param name the name the player to retrieve
* @return an offline player
* @see #getOfflinePlayer(java.util.UUID)
- * @deprecated Persistent storage of users should be by UUID as names are no longer
- * unique past a single session.
*/
- @Deprecated
+ // @Deprecated // Paper
@NotNull
public OfflinePlayer getOfflinePlayer(@NotNull String name);
2024-04-06 23:20:29 +02:00
@@ -1630,7 +1633,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
2021-06-11 14:02:28 +02:00
*
* @return the scoreboard manager or null if no worlds are loaded.
*/
- @Nullable
+ @NotNull // Paper
ScoreboardManager getScoreboardManager();
2022-04-20 11:28:53 +02:00
/**
2022-08-14 18:18:39 +02:00
diff --git a/src/main/java/org/bukkit/UndefinedNullability.java b/src/main/java/org/bukkit/UndefinedNullability.java
2023-04-09 02:00:50 +02:00
index 4d4265c237179470e1fd017721a8dd595f114013..3babc9df26276300392d3f92ee6e317c33643b0b 100644
2022-08-14 18:18:39 +02:00
--- a/src/main/java/org/bukkit/UndefinedNullability.java
+++ b/src/main/java/org/bukkit/UndefinedNullability.java
2023-04-09 02:00:50 +02:00
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.ApiStatus;
2022-08-14 18:18:39 +02:00
* suggests a bad API design.
*/
@Retention(RetentionPolicy.CLASS)
+@java.lang.annotation.Documented // Paper
2023-04-09 02:00:50 +02:00
@ApiStatus.Internal
2022-08-14 18:18:39 +02:00
@Deprecated
public @interface UndefinedNullability {
2022-06-08 22:44:59 +02:00
diff --git a/src/main/java/org/bukkit/Vibration.java b/src/main/java/org/bukkit/Vibration.java
2022-09-24 03:38:12 +02:00
index e455eb21abf121dc6ff10ff8a13dd06f67096a8f..bbc01e7c192ae6689c301670047ff114306c57cb 100644
2022-06-08 22:44:59 +02:00
--- a/src/main/java/org/bukkit/Vibration.java
+++ b/src/main/java/org/bukkit/Vibration.java
@@ -13,6 +13,14 @@ public class Vibration {
private final Destination destination;
private final int arrivalTime;
+ // Paper start
+ public Vibration(@NotNull Destination destination, @NotNull int arrivalTime) {
+ this.destination = destination;
+ this.arrivalTime = arrivalTime;
+ this.origin = new Location(null, 0, 0, 0); // Dummy origin because getter expects null
+ }
+
+ @Deprecated(forRemoval = true) // Paper end
2022-09-24 03:38:12 +02:00
public Vibration(@NotNull Location origin, @NotNull Destination destination, int arrivalTime) {
2022-06-08 22:44:59 +02:00
this.origin = origin;
this.destination = destination;
@@ -22,9 +30,11 @@ public class Vibration {
/**
* Get the origin of the vibration.
*
+ * @deprecated unused as of 1.19
* @return origin
*/
@NotNull
+ @Deprecated(forRemoval = true) // Paper
public Location getOrigin() {
return origin;
}
2022-04-20 11:28:53 +02:00
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
2024-04-06 21:53:39 +02:00
index 675dea2e1e9742043c18098774b9fde2e6f4602f..0023b9737353c3c7dcfb38a143761bd8c03acf0d 100644
2022-04-20 11:28:53 +02:00
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
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:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
@@ -418,9 +418,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
2022-04-20 11:28:53 +02:00
* @param z Z-coordinate of the chunk
* @return Whether the chunk was actually refreshed
*
- * @deprecated This method is not guaranteed to work suitably across all client implementations.
*/
- @Deprecated
+ //@Deprecated // Paper
public boolean refreshChunk(int x, int z);
2022-05-16 04:33:03 +02:00
/**
2024-04-06 21:53:39 +02:00
@@ -3754,6 +3753,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
2023-12-25 23:51:56 +01:00
StructureSearchResult locateNearestStructure(@NotNull Location origin, @NotNull Structure structure, int radius, boolean findUnexplored);
2023-09-21 10:35:38 +02:00
// Spigot start
2023-12-25 23:51:56 +01:00
+ @Deprecated(forRemoval = true) // Paper
2023-09-21 10:35:38 +02:00
public class Spigot {
/**
2024-04-06 21:53:39 +02:00
@@ -3787,7 +3787,11 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
2023-09-21 10:35:38 +02:00
}
}
+ /**
+ * @deprecated Unsupported api
+ */
@NotNull
+ @Deprecated // Paper
Spigot spigot();
// Spigot end
2024-04-06 21:53:39 +02:00
@@ -4005,9 +4009,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
2023-11-11 22:52:32 +01:00
* Gets the dimension ID of this environment
*
* @return dimension ID
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public int getId() {
return id;
}
2024-04-06 21:53:39 +02:00
@@ -4017,9 +4021,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
2023-11-11 22:52:32 +01:00
*
* @param id The ID of the environment
* @return The environment
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static Environment getEnvironment(int id) {
return lookup.get(id);
2023-10-01 02:20:51 +02:00
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
2024-02-09 21:56:13 +01:00
index a71001677e2b1b0b6225a7be63b8ea5ce4456862..c7ef0386a09a07a2317c56274ed41218dfd7153d 100644
2023-10-01 02:20:51 +02:00
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
2024-01-27 18:35:09 +01:00
@@ -526,7 +526,7 @@ public interface Block extends Metadatable, Translatable {
2023-10-01 02:20:51 +02:00
* @return a list of dropped items for this type of block
*/
@NotNull
- Collection<ItemStack> getDrops(@NotNull ItemStack tool, @Nullable Entity entity);
+ Collection<ItemStack> getDrops(@Nullable ItemStack tool, @Nullable Entity entity); // Paper
/**
* Returns if the given item is a preferred choice to break this Block.
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java
2023-09-29 02:28:26 +02:00
index 7c5438fa92053cdbd7a01483a9baa4d48df07b24..a4f0a5270693e1c4af4fad827fa0a2ce753e07b5 100644
2022-05-16 04:33:03 +02:00
--- a/src/main/java/org/bukkit/block/BlockState.java
+++ b/src/main/java/org/bukkit/block/BlockState.java
2023-09-29 02:28:26 +02:00
@@ -36,8 +36,10 @@ public interface BlockState extends Metadatable {
2022-05-16 04:33:03 +02:00
* Gets the metadata for this block state.
*
* @return block specific metadata
+ * @deprecated use {@link #getBlockData()}
*/
@NotNull
+ @Deprecated // Paper
MaterialData getData();
/**
2023-09-29 02:28:26 +02:00
@@ -141,7 +143,9 @@ public interface BlockState extends Metadatable {
2022-05-16 04:33:03 +02:00
* Sets the metadata for this block state.
*
* @param data New block specific metadata
+ * @deprecated use {@link #setBlockData(BlockData)}
*/
+ @Deprecated // Paper
void setData(@NotNull MaterialData data);
2023-06-16 12:58:09 +02:00
/**
diff --git a/src/main/java/org/bukkit/block/BrushableBlock.java b/src/main/java/org/bukkit/block/BrushableBlock.java
index 4bd127b3646307398e0c937c3e36ab671235b72b..f2557a87f468ee20c2d276dbfc0e9a976656c75c 100644
--- a/src/main/java/org/bukkit/block/BrushableBlock.java
+++ b/src/main/java/org/bukkit/block/BrushableBlock.java
@@ -15,7 +15,7 @@ public interface BrushableBlock extends Lootable, TileState {
*
* @return the item
*/
- @Nullable
+ @org.jetbrains.annotations.NotNull // Paper
public ItemStack getItem();
2022-05-16 04:33:03 +02:00
/**
2023-11-11 22:52:32 +01:00
diff --git a/src/main/java/org/bukkit/block/PistonMoveReaction.java b/src/main/java/org/bukkit/block/PistonMoveReaction.java
index b90f5dc345ad2cdd3ae353dc57f42a14c231d18a..a7b915ded9154d53ac8ca599119c1699cfca2265 100644
--- a/src/main/java/org/bukkit/block/PistonMoveReaction.java
+++ b/src/main/java/org/bukkit/block/PistonMoveReaction.java
@@ -48,9 +48,9 @@ public enum PistonMoveReaction {
/**
* @return The ID of the move reaction
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public int getId() {
return this.id;
}
@@ -58,9 +58,9 @@ public enum PistonMoveReaction {
/**
* @param id An ID
* @return The move reaction with that ID
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static PistonMoveReaction getById(int id) {
return byId.get(id);
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
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:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
index 3afe2787de576f7190d87c796bea0ab34dc30248..58191017244f3949f6174fb108e3a245738a53c4 100644
2022-05-16 04:33:03 +02:00
--- a/src/main/java/org/bukkit/entity/Enderman.java
+++ b/src/main/java/org/bukkit/entity/Enderman.java
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
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:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
@@ -25,15 +25,19 @@ public interface Enderman extends Monster {
2022-05-16 04:33:03 +02:00
* Gets the id and data of the block that the Enderman is carrying.
*
* @return MaterialData containing the id and data of the block
+ * @deprecated use {@link #getCarriedBlock()}
*/
@NotNull
+ @Deprecated // Paper
public MaterialData getCarriedMaterial();
/**
* Sets the id and data of the block that the Enderman is carrying.
*
* @param material data to set the carried block to
+ * @deprecated use {@link #setCarriedBlock(BlockData)}
*/
+ @Deprecated // Paper
public void setCarriedMaterial(@NotNull MaterialData material);
2021-06-11 14:02:28 +02:00
/**
2023-11-11 22:52:32 +01:00
diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java
2023-12-05 18:33:18 +01:00
index e3f440c9d9ce3b5710ed1b7f71522899fb98459f..a4578c520aa1078a741aac4b12fe89bf82b3c465 100644
2023-11-11 22:52:32 +01:00
--- a/src/main/java/org/bukkit/entity/EntityType.java
+++ b/src/main/java/org/bukkit/entity/EntityType.java
2023-12-05 18:33:18 +01:00
@@ -397,9 +397,9 @@ public enum EntityType implements Keyed, Translatable {
2023-11-11 22:52:32 +01:00
*
* @param name the entity type's name
* @return the matching entity type or null
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Contract("null -> null")
@Nullable
public static EntityType fromName(@Nullable String name) {
2023-09-21 10:35:38 +02:00
diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java
2024-01-14 10:46:04 +01:00
index b27447d7a2833f84cf05946c851f5b6740a578e3..5afeb2f6c82e8f752229462c2d7846f6ae7a4b44 100644
2023-09-21 10:35:38 +02:00
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
2024-01-14 10:46:04 +01:00
@@ -84,6 +84,10 @@ public interface LightningStrike extends Entity {
2023-10-03 13:55:12 +02:00
public void setCausingPlayer(@Nullable Player player);
2023-09-21 10:35:38 +02:00
// Spigot start
+ /**
+ * @deprecated Unsupported api
+ */
+ @Deprecated // Paper
public class Spigot extends Entity.Spigot {
2024-01-14 10:46:04 +01:00
/**
@@ -98,8 +102,12 @@ public interface LightningStrike extends Entity {
2023-09-21 10:35:38 +02:00
}
}
+ /**
+ * @deprecated Unsupported api
+ */
@NotNull
@Override
+ @Deprecated // Paper
Spigot spigot();
// Spigot end
}
2021-07-30 01:04:26 +02:00
diff --git a/src/main/java/org/bukkit/entity/LingeringPotion.java b/src/main/java/org/bukkit/entity/LingeringPotion.java
2022-06-25 23:21:47 +02:00
index f124b35ec76e6cb6a1a0dc464005087043c3efd0..f50aaddf8582be55fd4860ad374d8f2206991897 100644
2021-07-30 01:04:26 +02:00
--- a/src/main/java/org/bukkit/entity/LingeringPotion.java
+++ b/src/main/java/org/bukkit/entity/LingeringPotion.java
2022-06-25 23:21:47 +02:00
@@ -3,6 +3,8 @@ package org.bukkit.entity;
/**
* Represents a thrown lingering potion bottle
2021-07-30 01:04:26 +02:00
*
2022-06-25 23:21:47 +02:00
- * @deprecated lingering status depends on only on the potion item.
+ * @deprecated should not be used for anything, use {@link ThrownPotion} and
+ * set the potion via the methods there.
2021-07-30 01:04:26 +02:00
*/
2022-06-25 23:21:47 +02:00
+@Deprecated(forRemoval = true) // Paper
2021-07-30 01:04:26 +02:00
public interface LingeringPotion extends ThrownPotion { }
2023-03-31 06:09:13 +02:00
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
2024-04-06 23:20:29 +02:00
index 6dbd3524af80adc9dd7a94444e668220d3fccaea..3e5b7dc8f72bd211a18ec6a930c4f02beea4205a 100644
2023-03-31 06:09:13 +02:00
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
2024-04-06 21:53:39 +02:00
@@ -716,7 +716,9 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
2023-03-31 06:09:13 +02:00
* This may have unexpected results if the entity is not in water.
*
* @param swimming True if the entity is swimming.
+ * @deprecated This does nothing and is immediately reverted by the server, in the next tick <!-- Paper - future note: should wait a mojang input client/server side -->
*/
+ @Deprecated // Paper
public void setSwimming(boolean swimming);
/**
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/entity/Minecart.java b/src/main/java/org/bukkit/entity/Minecart.java
index 95c79c5fa0c4e30201f887da6467ce5f81c8a255..7f9c4d4b430a3f0276461346ff2621bacf864075 100644
--- a/src/main/java/org/bukkit/entity/Minecart.java
+++ b/src/main/java/org/bukkit/entity/Minecart.java
@@ -101,7 +101,9 @@ public interface Minecart extends Vehicle {
* Passing a null value will set the minecart to have no display block.
*
* @param material the material to set as display block.
+ * @deprecated use {@link #setDisplayBlockData(BlockData)}
*/
+ @Deprecated // Paper
public void setDisplayBlock(@Nullable MaterialData material);
/**
@@ -109,8 +111,10 @@ public interface Minecart extends Vehicle {
* This function will return the type AIR if none is set.
*
* @return the block displayed by this minecart.
+ * @deprecated use {@link #getDisplayBlockData()}
*/
@NotNull
+ @Deprecated // Paper
public MaterialData getDisplayBlock();
2023-11-11 22:52:32 +01:00
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
2024-03-03 21:54:52 +01:00
index 5e17bab05276de4340c5f06866f2efce81a9ab65..8f2a6f8ac70a7d5c2b8f9c17199b6eb88750a703 100644
2023-11-11 22:52:32 +01:00
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
2024-03-03 21:54:52 +01:00
@@ -1591,11 +1591,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
2023-11-11 22:52:32 +01:00
/**
* Forces an update of the player's entire inventory.
- *
- * @apiNote It should not be necessary for plugins to use this method. If it
- * is required for some reason, it is probably a bug.
*/
- @ApiStatus.Internal
+ // @ApiStatus.Internal // Paper - is valid API
public void updateInventory();
2022-04-23 11:25:30 +02:00
/**
2022-05-19 02:46:01 +02:00
diff --git a/src/main/java/org/bukkit/entity/Projectile.java b/src/main/java/org/bukkit/entity/Projectile.java
2023-09-29 02:28:26 +02:00
index 906b33b7569fff5dd78258f9765e879180a52834..06e3ad9cd8f39de0ef6ead794df1492415bc4302 100644
2022-05-19 02:46:01 +02:00
--- a/src/main/java/org/bukkit/entity/Projectile.java
+++ b/src/main/java/org/bukkit/entity/Projectile.java
2023-09-29 02:28:26 +02:00
@@ -29,7 +29,7 @@ public interface Projectile extends Entity {
2022-05-19 02:46:01 +02:00
* @return true if it should bounce.
2023-09-29 02:28:26 +02:00
* @deprecated does not do anything
2022-05-19 02:46:01 +02:00
*/
2023-09-29 02:28:26 +02:00
- @Deprecated
+ @Deprecated(forRemoval = true)
2022-05-19 02:46:01 +02:00
public boolean doesBounce();
/**
2023-09-29 02:28:26 +02:00
@@ -39,6 +39,6 @@ public interface Projectile extends Entity {
2022-05-19 02:46:01 +02:00
* @param doesBounce whether or not it should bounce.
2023-09-29 02:28:26 +02:00
* @deprecated does not do anything
2022-05-19 02:46:01 +02:00
*/
2023-09-29 02:28:26 +02:00
- @Deprecated
+ @Deprecated(forRemoval = true)
2022-05-19 02:46:01 +02:00
public void setBounce(boolean doesBounce);
}
2022-06-25 23:21:47 +02:00
diff --git a/src/main/java/org/bukkit/entity/SplashPotion.java b/src/main/java/org/bukkit/entity/SplashPotion.java
index 9cb08fe7201a9f91e88c7b1ee22c17889a7bf1c3..c0fcfccdf476106b48e626a099658c04244ebff8 100644
--- a/src/main/java/org/bukkit/entity/SplashPotion.java
+++ b/src/main/java/org/bukkit/entity/SplashPotion.java
@@ -3,7 +3,8 @@ package org.bukkit.entity;
/**
* Represents a thrown splash potion bottle
*
- * @deprecated splash status depends on only on the potion item.
+ * @deprecated should not be used for anything, use {@link ThrownPotion} and
+ * set the potion via the methods there.
*/
-@Deprecated
+@Deprecated(forRemoval = true) // Paper
public interface SplashPotion extends ThrownPotion { }
2023-11-11 22:52:32 +01:00
diff --git a/src/main/java/org/bukkit/entity/TextDisplay.java b/src/main/java/org/bukkit/entity/TextDisplay.java
index f101ffde9e7b3f6c3ab6f1cffb8d6f4e720634b2..8abc129f5953807e7a451166dabcf3e14e55483f 100644
--- a/src/main/java/org/bukkit/entity/TextDisplay.java
+++ b/src/main/java/org/bukkit/entity/TextDisplay.java
@@ -62,19 +62,17 @@ public interface TextDisplay extends Display {
* Gets the text background color.
*
* @return the background color
- * @deprecated API subject to change
*/
@Nullable
- @Deprecated
+ // @Deprecated // Paper - is stable API
Color getBackgroundColor();
/**
* Sets the text background color.
*
* @param color new background color
- * @deprecated API subject to change
*/
- @Deprecated
+ // @Deprecated // Paper - is stable API
void setBackgroundColor(@Nullable Color color);
/**
2021-07-30 01:04:26 +02:00
diff --git a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
2023-03-31 06:09:13 +02:00
index e9a6e5be5f33a342f7e5c496f0f1c64b2f302ace..f0db59a556deaefefbdaca121585c0fd199c13c2 100644
2021-07-30 01:04:26 +02:00
--- a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
+++ b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
2022-04-02 05:14:56 +02:00
@@ -23,7 +23,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
private boolean cancelled;
private final Player enchanter;
- public PrepareItemEnchantEvent(@NotNull final Player enchanter, @NotNull InventoryView view, @NotNull final Block table, @NotNull final ItemStack item, @NotNull final EnchantmentOffer[] offers, final int bonus) {
+ public PrepareItemEnchantEvent(@NotNull final Player enchanter, @NotNull InventoryView view, @NotNull final Block table, @NotNull final ItemStack item, @org.jetbrains.annotations.Nullable final EnchantmentOffer @NotNull [] offers, final int bonus) { // Paper - offers can contain null values
super(view);
this.enchanter = enchanter;
this.table = table;
2021-07-30 01:04:26 +02:00
@@ -68,6 +68,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
* @return experience level costs offered
* @deprecated Use {@link #getOffers()} instead of this method
*/
+ @Deprecated // Paper
@NotNull
public int[] getExpLevelCostsOffered() {
int[] levelOffers = new int[offers.length];
2022-04-02 05:14:56 +02:00
@@ -85,8 +86,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
*
* @return list of available enchantment offers
*/
- @NotNull
- public EnchantmentOffer[] getOffers() {
+ public @org.jetbrains.annotations.Nullable EnchantmentOffer @NotNull [] getOffers() { // Paper offers can contain null values
return offers;
}
2023-09-14 12:44:12 +02:00
diff --git a/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java
index 090ec6f96ca9b7f760389994da988c44c32b9976..e6b4d4c1722bf4a11744a421d09646b22745b138 100644
--- a/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java
@@ -10,7 +10,7 @@ import org.jetbrains.annotations.Nullable;
* LivingEntity's.
*/
public class EntityTargetLivingEntityEvent extends EntityTargetEvent {
- public EntityTargetLivingEntityEvent(@NotNull final Entity entity, @Nullable final LivingEntity target, @Nullable final TargetReason reason) {
+ public EntityTargetLivingEntityEvent(@NotNull final Entity entity, @Nullable final LivingEntity target, @NotNull final TargetReason reason) { // Paper
super(entity, target, reason);
}
2023-03-31 06:09:13 +02:00
diff --git a/src/main/java/org/bukkit/event/entity/EntityToggleSwimEvent.java b/src/main/java/org/bukkit/event/entity/EntityToggleSwimEvent.java
index e1123295b9511a2c610a1baf7195638f7f3e64c4..273ae8e5da0a858d3b82d1b0f5992318ff49f145 100644
--- a/src/main/java/org/bukkit/event/entity/EntityToggleSwimEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityToggleSwimEvent.java
@@ -24,6 +24,14 @@ public class EntityToggleSwimEvent extends EntityEvent implements Cancellable {
return cancel;
}
+ /**
+ * @deprecated This does nothing, the server and the client doesn't work
+ * correctly when the server try to bypass this. A current workaround
+ * exists. If you want to cancel the switch from the ground state to the
+ * swimming state you need to disable the sprinting flag for the player after
+ * the cancel action.
+ */
+ @Deprecated // Paper
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
2023-10-29 00:02:13 +02:00
diff --git a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
index 775e3223aa5054f1883403e50c8f2241d97b1285..5d4817d2a3b709f1a1a1162309a1c923bd09cc1d 100644
--- a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
+++ b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
@@ -19,22 +19,27 @@ public class ProjectileHitEvent extends EntityEvent implements Cancellable {
private final BlockFace hitFace;
private boolean cancel = false;
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper
public ProjectileHitEvent(@NotNull final Projectile projectile) {
- this(projectile, null, null);
+ this(projectile, null, null, null); // Paper
}
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper
public ProjectileHitEvent(@NotNull final Projectile projectile, @Nullable Entity hitEntity) {
- this(projectile, hitEntity, null);
+ this(projectile, hitEntity, null, null); // Paper
}
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper
public ProjectileHitEvent(@NotNull final Projectile projectile, @Nullable Block hitBlock) {
- this(projectile, null, hitBlock);
+ this(projectile, null, hitBlock, null); // Paper
}
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper
public ProjectileHitEvent(@NotNull final Projectile projectile, @Nullable Entity hitEntity, @Nullable Block hitBlock) {
this(projectile, hitEntity, hitBlock, null);
}
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public ProjectileHitEvent(@NotNull final Projectile projectile, @Nullable Entity hitEntity, @Nullable Block hitBlock, @Nullable BlockFace hitFace) {
super(projectile);
this.hitEntity = hitEntity;
2023-09-14 12:44:12 +02:00
diff --git a/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java b/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java
index 9353f0d09272404f42167ab8b7ad83a03620c436..f3ec8f67328b266defb31a44a36d31401d5e9371 100644
--- a/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java
+++ b/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java
@@ -12,12 +12,19 @@ import org.jetbrains.annotations.NotNull;
public class SpawnerSpawnEvent extends EntitySpawnEvent {
private final CreatureSpawner spawner;
- public SpawnerSpawnEvent(@NotNull final Entity spawnee, @NotNull final CreatureSpawner spawner) {
+ public SpawnerSpawnEvent(@NotNull final Entity spawnee, @org.jetbrains.annotations.Nullable final CreatureSpawner spawner) { // Paper
super(spawnee);
this.spawner = spawner;
}
- @NotNull
+ /**
+ * Gets the spawner tile state, or null
+ * when the entity is spawned from a minecart
+ * spawner.
+ *
+ * @return the spawner tile state
+ */
+ @org.jetbrains.annotations.Nullable // Paper
public CreatureSpawner getSpawner() {
return spawner;
}
diff --git a/src/main/java/org/bukkit/event/hanging/HangingBreakByEntityEvent.java b/src/main/java/org/bukkit/event/hanging/HangingBreakByEntityEvent.java
index 68517811f63838bdad41073ee26be82f95042a8e..454885e47611edd707358ddfe0a01b7acf9ad5c8 100644
--- a/src/main/java/org/bukkit/event/hanging/HangingBreakByEntityEvent.java
+++ b/src/main/java/org/bukkit/event/hanging/HangingBreakByEntityEvent.java
@@ -11,22 +11,21 @@ import org.jetbrains.annotations.Nullable;
public class HangingBreakByEntityEvent extends HangingBreakEvent {
private final Entity remover;
- public HangingBreakByEntityEvent(@NotNull final Hanging hanging, @Nullable final Entity remover) {
+ public HangingBreakByEntityEvent(@NotNull final Hanging hanging, @NotNull final Entity remover) { // Paper
this(hanging, remover, HangingBreakEvent.RemoveCause.ENTITY);
}
- public HangingBreakByEntityEvent(@NotNull final Hanging hanging, @Nullable final Entity remover, @NotNull final HangingBreakEvent.RemoveCause cause) {
+ public HangingBreakByEntityEvent(@NotNull final Hanging hanging, @NotNull final Entity remover, @NotNull final HangingBreakEvent.RemoveCause cause) { // Paper
super(hanging, cause);
this.remover = remover;
}
/**
* Gets the entity that removed the hanging entity.
- * May be null, for example when broken by an explosion.
*
* @return the entity that removed the hanging entity
*/
- @Nullable
+ @NotNull // Paper
public Entity getRemover() {
return remover;
}
diff --git a/src/main/java/org/bukkit/event/inventory/HopperInventorySearchEvent.java b/src/main/java/org/bukkit/event/inventory/HopperInventorySearchEvent.java
index 80a0a4ad813d6453b30273d25942e6612bb05c1b..18bb808e73c7a78f367ccdb44d5fe12bc54672cb 100644
--- a/src/main/java/org/bukkit/event/inventory/HopperInventorySearchEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/HopperInventorySearchEvent.java
@@ -34,7 +34,7 @@ public class HopperInventorySearchEvent extends BlockEvent {
DESTINATION;
}
- public HopperInventorySearchEvent(@NotNull Inventory inventory, @NotNull ContainerType containerType, @NotNull Block hopper, @NotNull Block searchBlock) {
+ public HopperInventorySearchEvent(@Nullable Inventory inventory, @NotNull ContainerType containerType, @NotNull Block hopper, @NotNull Block searchBlock) { // Paper
super(hopper);
this.inventory = inventory;
this.containerType = containerType;
2023-09-16 23:18:09 +02:00
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
index fe58058f9b5d29388d48115cc81dc48ab08c58c1..ac67a4e321f43d1ede09dafe2daa1f07de8a923f 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
@@ -85,7 +85,7 @@ public class InventoryClickEvent extends InventoryInteractEvent {
*
* @return the cursor ItemStack
*/
- @Nullable
+ @NotNull // Paper - fix nullability
public ItemStack getCursor() {
return getView().getCursor();
}
2023-09-21 10:35:38 +02:00
diff --git a/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java b/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java
index 1cb70b5c8776863f44f1c4cdde152c35cb51edb5..f09b378508fcc6299e7cb40f174028f6f88ba067 100644
--- a/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java
@@ -43,7 +43,10 @@ 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;
}
@@ -59,7 +62,10 @@ 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;
}
2022-05-31 22:40:21 +02:00
diff --git a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
index 1b2267f4e8ebded198773ec80e2bff2c861c7084..1a58734d919fae247eeb85dd785fd59990856505 100644
--- a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
@@ -78,7 +78,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
*
* @return Location the player moved to
*/
- @Nullable
+ @NotNull // Paper
public Location getTo() {
return to;
}
2023-09-14 12:44:12 +02:00
diff --git a/src/main/java/org/bukkit/event/raid/RaidSpawnWaveEvent.java b/src/main/java/org/bukkit/event/raid/RaidSpawnWaveEvent.java
index cd58dd7de781823804701fc023706e805c0142a8..1b8bb5241efcf4a90fd098f2000f8394072dca4a 100644
--- a/src/main/java/org/bukkit/event/raid/RaidSpawnWaveEvent.java
+++ b/src/main/java/org/bukkit/event/raid/RaidSpawnWaveEvent.java
@@ -19,7 +19,7 @@ public class RaidSpawnWaveEvent extends RaidEvent {
private final List<Raider> raiders;
private final Raider leader;
- public RaidSpawnWaveEvent(@NotNull Raid raid, @NotNull World world, @Nullable Raider leader, @NotNull List<Raider> raiders) {
+ public RaidSpawnWaveEvent(@NotNull Raid raid, @NotNull World world, @NotNull Raider leader, @NotNull List<Raider> raiders) { // Paper
super(raid, world);
this.raiders = raiders;
this.leader = leader;
@@ -30,7 +30,7 @@ public class RaidSpawnWaveEvent extends RaidEvent {
*
* @return {@link Raider}
*/
- @Nullable
+ @NotNull // Paper
public Raider getPatrolLeader() {
return leader;
}
2022-10-29 19:18:17 +02:00
diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java
index 6bafc62e2235a6b783cbf96f4dabeeaf02bd5178..50c762d777ac90a05772501a28cacff8fd3f5126 100644
--- a/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java
+++ b/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java
@@ -36,18 +36,22 @@ public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implement
this.cancelled = cancel;
}
+ @Deprecated(forRemoval = true) // Paper - Unused
public boolean isPickupCancelled() {
return cancelledPickup;
}
+ @Deprecated(forRemoval = true) // Paper - Unused
public void setPickupCancelled(boolean cancel) {
cancelledPickup = cancel;
}
+ @Deprecated(forRemoval = true) // Paper - Unused
public boolean isCollisionCancelled() {
return cancelledCollision;
}
+ @Deprecated(forRemoval = true) // Paper - Unused
public void setCollisionCancelled(boolean cancel) {
cancelledCollision = cancel;
}
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java
2023-03-31 06:09:13 +02:00
index c0b749a5bbf4980d01fed74768bb61909b579cb9..7e7a53b41013f1bf8956c0e278820f18d77b2f0d 100644
2022-05-16 04:33:03 +02:00
--- a/src/main/java/org/bukkit/generator/ChunkGenerator.java
+++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java
2022-12-03 19:19:09 +01:00
@@ -656,7 +656,9 @@ public abstract class ChunkGenerator {
2022-05-16 04:33:03 +02:00
* @param y the y location in the chunk from minHeight (inclusive) - maxHeight (exclusive)
* @param z the z location in the chunk from 0-15 inclusive
* @param material the type to set the block to
+ * @deprecated use {@link #setBlock(int, int, int, BlockData)}
*/
+ @Deprecated // Paper
public void setBlock(int x, int y, int z, @NotNull MaterialData material);
/**
2022-12-03 19:19:09 +01:00
@@ -700,7 +702,9 @@ public abstract class ChunkGenerator {
2022-05-16 04:33:03 +02:00
* @param yMax maximum y location (exclusive) in the chunk to set
* @param zMax maximum z location (exclusive) in the chunk to set
* @param material the type to set the blocks to
+ * @deprecated use {@link #setRegion(int, int, int, int, int, int, BlockData)}
*/
+ @Deprecated // Paper
public void setRegion(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, @NotNull MaterialData material);
/**
2022-12-03 19:19:09 +01:00
@@ -741,8 +745,10 @@ public abstract class ChunkGenerator {
2022-05-16 04:33:03 +02:00
* @param y the y location in the chunk from minHeight (inclusive) - maxHeight (exclusive)
* @param z the z location in the chunk from 0-15 inclusive
* @return the type and data of the block or the MaterialData for air if x, y or z are outside the chunk's bounds
+ * @deprecated use {@link #getBlockData(int, int, int)}
*/
@NotNull
+ @Deprecated // Paper
public MaterialData getTypeAndData(int x, int y, int z);
/**
2022-10-15 21:20:12 +02:00
diff --git a/src/main/java/org/bukkit/inventory/CookingRecipe.java b/src/main/java/org/bukkit/inventory/CookingRecipe.java
2022-12-07 17:46:46 +01:00
index 571652ba8843a9493f1843523e24145baa958637..f7fa79393aef40027446b78bac8e9490cfafd8bc 100644
2022-10-15 21:20:12 +02:00
--- a/src/main/java/org/bukkit/inventory/CookingRecipe.java
+++ b/src/main/java/org/bukkit/inventory/CookingRecipe.java
2022-12-07 17:46:46 +01:00
@@ -68,7 +68,9 @@ public abstract class CookingRecipe<T extends CookingRecipe> implements Recipe,
2022-10-15 21:20:12 +02:00
* Get the input material.
*
* @return The input material.
+ * @deprecated Use {@link #getInputChoice()} instead for more complete data.
*/
+ @Deprecated // Paper
@NotNull
public ItemStack getInput() {
return this.ingredient.getItemStack();
2022-01-23 02:40:57 +01:00
diff --git a/src/main/java/org/bukkit/inventory/CraftingInventory.java b/src/main/java/org/bukkit/inventory/CraftingInventory.java
index df81bac9ecff697f98941e5c8490e10391e90090..a32977ba3ba60a1c9aee6e469d5d6cd1887c55a2 100644
--- a/src/main/java/org/bukkit/inventory/CraftingInventory.java
+++ b/src/main/java/org/bukkit/inventory/CraftingInventory.java
@@ -21,8 +21,7 @@ public interface CraftingInventory extends Inventory {
*
* @return The contents. Individual entries may be null.
*/
- @NotNull
- ItemStack[] getMatrix();
+ @Nullable ItemStack @NotNull [] getMatrix(); // Paper - make array elements nullable instead array
/**
* Set the item in the result slot of the crafting inventory.
@@ -38,7 +37,7 @@ public interface CraftingInventory extends Inventory {
* @throws IllegalArgumentException if the length of contents is greater
* than the size of the crafting matrix.
*/
- void setMatrix(@NotNull ItemStack[] contents);
+ void setMatrix(@Nullable ItemStack @NotNull [] contents); // Paper - make array elements nullable instead array
/**
* Get the current recipe formed on the crafting inventory, if any.
2022-05-31 22:40:21 +02:00
diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java
2024-04-06 21:53:39 +02:00
index 2dde946443fee1f6e79b882cbcb448549dc0c99c..127302aa7c22f59438de66fffa0b03ae84a2a8ad 100644
2022-05-31 22:40:21 +02:00
--- a/src/main/java/org/bukkit/inventory/EntityEquipment.java
+++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java
2024-04-06 21:53:39 +02:00
@@ -525,6 +525,6 @@ public interface EntityEquipment {
2022-05-31 22:40:21 +02:00
*
* @return the entity this EntityEquipment belongs to
*/
- @Nullable
+ @NotNull // Paper
Entity getHolder();
}
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
index 1d442dc16cbb0fed21714d47007f3f11e30c57d4..af8f7b88edf0fa790edcf16356a030c4834f531e 100644
--- a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
+++ b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
@@ -67,8 +67,10 @@ public class FurnaceRecipe extends CookingRecipe<FurnaceRecipe> {
*
* @param input The input material.
* @return The changed recipe, so you can chain calls.
+ * @deprecated use {@link #setInputChoice(RecipeChoice)}
*/
@NotNull
+ @Deprecated
public FurnaceRecipe setInput(@NotNull MaterialData input) {
return setInput(input.getItemType(), input.getData());
}
2021-11-24 21:15:19 +01:00
diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java
2022-08-08 08:17:51 +02:00
index f1a48eab1a357ae64545e1f1dc941c383cff8707..466d1bd7089b76f48f953e1a51c611ecd93dcd54 100644
2021-11-24 21:15:19 +01:00
--- a/src/main/java/org/bukkit/inventory/Inventory.java
+++ b/src/main/java/org/bukkit/inventory/Inventory.java
2022-08-08 08:17:51 +02:00
@@ -161,8 +161,7 @@ public interface Inventory extends Iterable<ItemStack> {
2021-11-24 21:15:19 +01:00
*
* @return An array of ItemStacks from the inventory. Individual items may be null.
*/
- @NotNull
- public ItemStack[] getContents();
+ public @Nullable ItemStack @NotNull [] getContents(); // Paper - make array elements nullable instead array
/**
* Completely replaces the inventory's contents. Removes all existing
2022-08-08 08:17:51 +02:00
@@ -173,7 +172,7 @@ public interface Inventory extends Iterable<ItemStack> {
2022-01-23 02:40:57 +01:00
* @throws IllegalArgumentException If the array has more items than the
* inventory.
*/
- public void setContents(@NotNull ItemStack[] items) throws IllegalArgumentException;
+ public void setContents(@Nullable ItemStack @NotNull [] items) throws IllegalArgumentException; // Paper - make array elements nullable instead array
/**
* Return the contents from the section of the inventory where items can
2022-08-08 08:17:51 +02:00
@@ -186,8 +185,7 @@ public interface Inventory extends Iterable<ItemStack> {
2022-01-23 02:40:57 +01:00
*
* @return inventory storage contents. Individual items may be null.
*/
- @NotNull
- public ItemStack[] getStorageContents();
+ public @Nullable ItemStack @NotNull [] getStorageContents(); // Paper - make array elements nullable instead array
/**
* Put the given ItemStacks into the storage slots
2022-08-08 08:17:51 +02:00
@@ -196,7 +194,7 @@ public interface Inventory extends Iterable<ItemStack> {
2022-01-23 02:40:57 +01:00
* @throws IllegalArgumentException If the array has more items than the
* inventory.
*/
- public void setStorageContents(@NotNull ItemStack[] items) throws IllegalArgumentException;
+ public void setStorageContents(@Nullable ItemStack @NotNull [] items) throws IllegalArgumentException; // Paper - make array elements nullable instead array
/**
* Checks if the inventory contains any ItemStacks with the given
2023-09-16 23:18:09 +02:00
diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java
2023-11-11 22:52:32 +01:00
index 002acfbdce1db10f7ba1b6a013e678f504ac6e69..8d14426eb1ebea27058d5f22ea652f22d00fccb9 100644
2023-09-16 23:18:09 +02:00
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
2023-11-11 22:52:32 +01:00
@@ -126,9 +126,9 @@ public abstract class InventoryView {
* Gets the id of this view.
*
* @return the id of this view
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public int getId() {
return id;
}
2023-09-16 23:18:09 +02:00
@@ -210,10 +210,10 @@ public abstract class InventoryView {
/**
* Get the item on the cursor of one of the viewing players.
*
- * @return The item on the player's cursor, or null if they aren't holding
- * one.
+ * @return The item on the player's cursor, or an empty stack
+ * if they aren't holding one.
*/
- @Nullable
+ @NotNull // Paper - fix nullability
public final ItemStack getCursor() {
return getPlayer().getItemOnCursor();
}
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
2024-01-14 10:46:04 +01:00
index a3d40ca984202a5fec0cfcc97266f32408c37638..6aeae6b78106b8fd434614591adb5ead41dec8e1 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
2023-11-11 21:25:45 +01:00
@@ -30,7 +30,7 @@ public interface ItemFactory {
2021-06-11 14:02:28 +02:00
* @return a new ItemMeta that could be applied to an item stack of the
* specified material
*/
- @Nullable
2022-04-16 10:29:50 +02:00
+ @org.bukkit.UndefinedNullability // Paper
2021-06-11 14:02:28 +02:00
ItemMeta getItemMeta(@NotNull final Material material);
/**
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
2024-01-26 20:17:06 +01:00
index dbd0d0610f33105ee83ab589c84e73004f684fb5..fd3d4dd231d756d51db0155a4c3ad970c4f456ed 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
2023-02-15 23:10:14 +01:00
@@ -8,6 +8,7 @@ import java.util.Map;
2021-06-11 14:02:28 +02:00
import org.bukkit.Bukkit;
import org.bukkit.Material;
2023-02-15 23:10:14 +01:00
import org.bukkit.Translatable;
2021-06-11 14:02:28 +02:00
+import org.bukkit.UndefinedNullability;
import org.bukkit.Utility;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.enchantments.Enchantment;
2023-02-15 23:10:14 +01:00
@@ -68,6 +69,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
2021-07-30 01:04:26 +02:00
* @param damage durability / damage
* @deprecated see {@link #setDurability(short)}
*/
+ @Deprecated // Paper
public ItemStack(@NotNull final Material type, final int amount, final short damage) {
this(type, amount, damage, null);
}
2023-02-15 23:10:14 +01:00
@@ -169,8 +171,10 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
2022-05-16 04:33:03 +02:00
* Gets the MaterialData for this stack of items
*
* @return MaterialData for this item
+ * @deprecated cast to {@link org.bukkit.inventory.meta.BlockDataMeta} and use {@link org.bukkit.inventory.meta.BlockDataMeta#getBlockData(Material)}
*/
@Nullable
+ @Deprecated // Paper
public MaterialData getData() {
Material mat = Bukkit.getUnsafe().toLegacy(getType());
if (data == null && mat != null && mat.getData() != null) {
2023-02-15 23:10:14 +01:00
@@ -184,7 +188,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
2022-05-16 04:33:03 +02:00
* Sets the MaterialData for this stack of items
*
* @param data New MaterialData for this item
+ * @deprecated cast to {@link org.bukkit.inventory.meta.BlockDataMeta} and use {@link org.bukkit.inventory.meta.BlockDataMeta#setBlockData(org.bukkit.block.data.BlockData)}
*/
+ @Deprecated // Paper
public void setData(@Nullable MaterialData data) {
if (data == null) {
this.data = data;
2024-01-26 20:17:06 +01:00
@@ -557,7 +563,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
2021-06-11 14:02:28 +02:00
*
* @return a copy of the current ItemStack's ItemData
*/
- @Nullable
+ @UndefinedNullability // Paper
public ItemMeta getItemMeta() {
return this.meta == null ? Bukkit.getItemFactory().getItemMeta(this.type) : this.meta.clone();
}
2022-01-23 02:40:57 +01:00
diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java
2024-04-06 21:53:39 +02:00
index 476fe14faa39f02444cab8ad95d4401033dc6938..2c54660dc1fbc7c1232096797a23cae1262888e9 100644
2022-01-23 02:40:57 +01:00
--- a/src/main/java/org/bukkit/inventory/PlayerInventory.java
+++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java
2024-04-06 21:53:39 +02:00
@@ -16,8 +16,7 @@ public interface PlayerInventory extends Inventory {
* null and are returned in a fixed order starting from the boots and going
* up to the helmet
2022-01-23 02:40:57 +01:00
*/
- @NotNull
- public ItemStack[] getArmorContents();
+ public @Nullable ItemStack @NotNull [] getArmorContents(); // Paper - make array elements nullable instead array
/**
* Get all additional ItemStacks stored in this inventory.
2024-04-06 21:53:39 +02:00
@@ -28,8 +27,7 @@ public interface PlayerInventory extends Inventory {
2022-01-23 02:40:57 +01:00
*
* @return All additional ItemStacks. Individual items can be null.
*/
- @NotNull
- public ItemStack[] getExtraContents();
+ public @Nullable ItemStack @NotNull [] getExtraContents(); // Paper - make array elements nullable instead array
/**
* Return the ItemStack from the helmet slot
2024-04-06 21:53:39 +02:00
@@ -106,9 +104,9 @@ public interface PlayerInventory extends Inventory {
2022-03-16 16:57:51 +01:00
*
* @param slot the slot to get the ItemStack
*
- * @return the ItemStack in the given slot or null if there is not one
+ * @return the ItemStack in the given slot
*/
- @Nullable
+ @NotNull // Paper
public ItemStack getItem(@NotNull EquipmentSlot slot);
/**
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
2023-08-06 02:21:59 +02:00
index 97d5d9c6347bc401e3f4ab7c0ba1391ad5b0449a..da878c6d4928ddbc16b50ace86d992685a2b7873 100644
2022-05-16 04:33:03 +02:00
--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
2023-08-06 02:21:59 +02:00
@@ -100,8 +100,10 @@ public class ShapedRecipe extends CraftingRecipe {
2022-05-16 04:33:03 +02:00
* @param ingredient The ingredient.
* @return The changed recipe, so you can chain calls.
2023-05-12 13:10:08 +02:00
* @throws IllegalArgumentException if the {@code key} does not appear in the shape.
2022-05-16 04:33:03 +02:00
+ * @deprecated use {@link #setIngredient(char, RecipeChoice)}
*/
@NotNull
+ @Deprecated // Paper
public ShapedRecipe setIngredient(char key, @NotNull MaterialData ingredient) {
return setIngredient(key, ingredient.getItemType(), ingredient.getData());
}
2023-08-06 02:21:59 +02:00
@@ -179,7 +181,9 @@ public class ShapedRecipe extends CraftingRecipe {
2022-10-15 21:20:12 +02:00
* Get a copy of the ingredients map.
*
* @return The mapping of character to ingredients.
+ * @deprecated Use {@link #getChoiceMap()} instead for more complete data.
*/
+ @Deprecated // Paper
@NotNull
public Map<Character, ItemStack> getIngredientMap() {
HashMap<Character, ItemStack> result = new HashMap<Character, ItemStack>();
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
2023-08-06 02:21:59 +02:00
index b8ac602cd2718d615ec243ce648951a1a46c26ec..beb798482479c58a8628c314b510ab6349576ce8 100644
2022-05-16 04:33:03 +02:00
--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
2023-08-06 02:21:59 +02:00
@@ -43,8 +43,10 @@ public class ShapelessRecipe extends CraftingRecipe {
2022-05-16 04:33:03 +02:00
*
* @param ingredient The ingredient to add.
* @return The changed recipe, so you can chain calls.
+ * @deprecated use {@link #addIngredient(RecipeChoice)}
*/
@NotNull
+ @Deprecated
public ShapelessRecipe addIngredient(@NotNull MaterialData ingredient) {
return addIngredient(1, ingredient);
}
2023-08-06 02:21:59 +02:00
@@ -80,8 +82,10 @@ public class ShapelessRecipe extends CraftingRecipe {
2022-05-16 04:33:03 +02:00
* @param count How many to add (can't be more than 9!)
* @param ingredient The ingredient to add.
* @return The changed recipe, so you can chain calls.
+ * @deprecated use {@link #addIngredient(int, Material)}
*/
@NotNull
+ @Deprecated // Paper
public ShapelessRecipe addIngredient(int count, @NotNull MaterialData ingredient) {
return addIngredient(count, ingredient.getItemType(), ingredient.getData());
}
2023-08-06 02:21:59 +02:00
@@ -198,8 +202,10 @@ public class ShapelessRecipe extends CraftingRecipe {
2022-05-16 04:33:03 +02:00
*
* @param ingredient The ingredient to remove
* @return The changed recipe.
+ * @deprecated use {@link #removeIngredient(Material)}
*/
@NotNull
+ @Deprecated // Paper
public ShapelessRecipe removeIngredient(@NotNull MaterialData ingredient) {
return removeIngredient(ingredient.getItemType(), ingredient.getData());
}
2023-08-06 02:21:59 +02:00
@@ -226,8 +232,10 @@ public class ShapelessRecipe extends CraftingRecipe {
2022-05-16 04:33:03 +02:00
* @param count The number of copies to remove.
* @param ingredient The ingredient to remove.
* @return The changed recipe.
+ * @deprecated use {@link #removeIngredient(int, Material)}
*/
@NotNull
+ @Deprecated // Paper
public ShapelessRecipe removeIngredient(int count, @NotNull MaterialData ingredient) {
return removeIngredient(count, ingredient.getItemType(), ingredient.getData());
}
2023-08-06 02:21:59 +02:00
@@ -277,7 +285,9 @@ public class ShapelessRecipe extends CraftingRecipe {
2022-10-15 21:20:12 +02:00
* Get the list of ingredients used for this recipe.
*
* @return The input list
+ * @deprecated Use {@link #getChoiceList()} instead for more complete data.
*/
+ @Deprecated // Paper
@NotNull
public List<ItemStack> getIngredientList() {
ArrayList<ItemStack> result = new ArrayList<ItemStack>(ingredients.size());
diff --git a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java
2023-03-31 06:09:13 +02:00
index 597a18a767b68b47e81454b7d44613c7178c1366..bc3440eb72127824b3961fbdae583bb61385f65e 100644
2022-10-15 21:20:12 +02:00
--- a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java
+++ b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java
@@ -57,7 +57,9 @@ public class StonecuttingRecipe implements Recipe, Keyed {
* Get the input material.
*
* @return The input material.
+ * @deprecated Use {@link #getInputChoice()} instead for more complete data.
*/
+ @Deprecated // Paper
@NotNull
public ItemStack getInput() {
return this.ingredient.getItemStack();
2021-12-28 20:13:27 +01:00
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
2024-01-26 20:17:06 +01:00
index f800e776329c1b42f834cb30ebf2d0ace195d1a2..f23c0c942f200a68d2620f225ab90399a9057dfc 100644
2021-12-28 20:13:27 +01:00
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
2023-10-26 23:56:40 +02:00
@@ -75,8 +75,10 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
2021-12-28 20:13:27 +01:00
/**
* Checks for existence of a localized name.
*
+ * @deprecated Use {@link ItemMeta#displayName()} and check if it is instanceof a {@link net.kyori.adventure.text.TranslatableComponent}.
* @return true if this has a localized name
*/
+ @Deprecated // Paper - Deprecate old localized API
boolean hasLocalizedName();
/**
2023-10-26 23:56:40 +02:00
@@ -85,16 +87,20 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
2021-12-28 20:13:27 +01:00
* Plugins should check that hasLocalizedName() returns <code>true</code>
* before calling this method.
*
+ * @deprecated Use {@link ItemMeta#displayName()} and cast it to a {@link net.kyori.adventure.text.TranslatableComponent}. No longer used by the client.
* @return the localized name that is set
*/
+ @Deprecated // Paper - Deprecate old localized API
@NotNull
String getLocalizedName();
/**
* Sets the localized name.
*
+ * @deprecated Use {@link ItemMeta#displayName(Component)} with a {@link net.kyori.adventure.text.TranslatableComponent}. No longer used by the client.
* @param name the name to set
*/
+ @Deprecated // Paper - Deprecate old localized API
void setLocalizedName(@Nullable String name);
2023-05-15 02:23:57 +02:00
/**
diff --git a/src/main/java/org/bukkit/inventory/meta/MapMeta.java b/src/main/java/org/bukkit/inventory/meta/MapMeta.java
index 32055a8890425e0b819930f3059da5ea9dfca553..26a336dade83baee97d20eb39a058925659f5777 100644
--- a/src/main/java/org/bukkit/inventory/meta/MapMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/MapMeta.java
@@ -16,13 +16,8 @@ public interface MapMeta extends ItemMeta {
*
* @return true if this has a map ID number.
* @see #hasMapView()
- * @deprecated These methods are poor API: They rely on the caller to pass
- * in an only an integer property, and have poorly defined implementation
- * behavior if that integer is not a valid map (the current implementation
- * for example will generate a new map with a different ID). The xxxMapView
- * family of methods should be used instead.
*/
- @Deprecated
+ //@Deprecated // Paper
boolean hasMapId();
/**
@@ -34,13 +29,8 @@ public interface MapMeta extends ItemMeta {
*
* @return the map ID that is set
* @see #getMapView()
- * @deprecated These methods are poor API: They rely on the caller to pass
- * in an only an integer property, and have poorly defined implementation
- * behavior if that integer is not a valid map (the current implementation
- * for example will generate a new map with a different ID). The xxxMapView
- * family of methods should be used instead.
*/
- @Deprecated
+ //@Deprecated // Paper
int getMapId();
2023-06-03 20:09:43 +02:00
/**
2023-11-11 22:52:32 +01:00
diff --git a/src/main/java/org/bukkit/map/MapCanvas.java b/src/main/java/org/bukkit/map/MapCanvas.java
index 00437719722830c087ff925015086c29bbb04497..ae9bcc8262dbf6eb8673ca82395d09169db38f9d 100644
--- a/src/main/java/org/bukkit/map/MapCanvas.java
+++ b/src/main/java/org/bukkit/map/MapCanvas.java
@@ -94,9 +94,9 @@ public interface MapCanvas {
* @param x The x coordinate, from 0 to 127.
* @param y The y coordinate, from 0 to 127.
* @return The color. See {@link MapPalette}.
- * @deprecated Magic value, use {@link #getPixelColor(int, int)}
+ * @deprecated use {@link #getPixelColor(int, int)}
*/
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.2") // Paper
public byte getPixel(int x, int y);
/**
@@ -105,9 +105,9 @@ public interface MapCanvas {
* @param x The x coordinate, from 0 to 127.
* @param y The y coordinate, from 0 to 127.
* @return The color. See {@link MapPalette}.
- * @deprecated Magic value, use {@link #getBasePixelColor(int, int)}
+ * @deprecated use {@link #getBasePixelColor(int, int)}
*/
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.2") // Paper
public byte getBasePixel(int x, int y);
/**
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index 7d4f4970dae6fe4eeea6b6b6810dcecfe20d6e51..599399e4d8ca7c46747439ad2dd0186d0a289a19 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -156,9 +156,9 @@ public final class MapCursor {
* Get the type of this cursor.
*
* @return The type (color/style) of the map cursor.
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getRawType() {
return type;
}
@@ -215,9 +215,9 @@ public final class MapCursor {
* Set the type of this cursor.
*
* @param type The type (color/style) of the map cursor.
- * @deprecated Magic value
+ * @deprecated use {@link #setType(Type)}
*/
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.2") // Paper
public void setRawType(byte type) {
if (type < 0 || type > 26) {
throw new IllegalArgumentException("Type must be in the range 0-26");
@@ -328,9 +328,9 @@ public final class MapCursor {
* Gets the internal value of the cursor.
*
* @return the value
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getValue() {
return value;
}
@@ -340,9 +340,9 @@ public final class MapCursor {
*
* @param value the value
* @return the matching type
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static Type byValue(byte value) {
for (Type t : values()) {
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
index 3a9aaca2e76411a9c27f9f5e0f22d060d5a66d06..c80faa079eca1564847070f0338fc98024639829 100644
--- a/src/main/java/org/bukkit/map/MapPalette.java
+++ b/src/main/java/org/bukkit/map/MapPalette.java
@@ -197,9 +197,9 @@ public final class MapPalette {
*
* @param image The image to convert.
* @return A byte[] containing the pixels of the image.
- * @deprecated Magic value
+ * @deprecated use color-related methods
*/
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.2") // Paper
@NotNull
public static byte[] imageToBytes(@NotNull Image image) {
BufferedImage temp = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
@@ -225,9 +225,9 @@ public final class MapPalette {
* @param b The blue component of the color.
* @param g The green component of the color.
* @return The index in the palette.
- * @deprecated Magic value
+ * @deprecated use color-related methods
*/
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.2") // Paper
public static byte matchColor(int r, int g, int b) {
return matchColor(new Color(r, g, b));
}
@@ -238,9 +238,9 @@ public final class MapPalette {
*
* @param color The Color to match.
* @return The index in the palette.
- * @deprecated Magic value
+ * @deprecated use color-related methods
*/
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.2") // Paper
public static byte matchColor(@NotNull Color color) {
if (color.getAlpha() < 128) return 0;
@@ -268,9 +268,9 @@ public final class MapPalette {
*
* @param index The index in the palette.
* @return The Color of the palette entry.
- * @deprecated Magic value
+ * @deprecated use color directly
*/
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.2") // Paper
@NotNull
public static Color getColor(byte index) {
// Minecraft has 143 colors, some of which have negative byte representations
@@ -311,9 +311,9 @@ public final class MapPalette {
* @param color The Color to match.
* @return The index in the palette.
* @throws IllegalStateException if {@link #isCached()} returns false
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
byte matchColor(@NotNull Color color);
}
}
diff --git a/src/main/java/org/bukkit/map/MapView.java b/src/main/java/org/bukkit/map/MapView.java
index 9b8b68b66dc15b06800251702c2722623c8462a0..e998c5d871e02564c24260a8205dcfafb6e703d9 100644
--- a/src/main/java/org/bukkit/map/MapView.java
+++ b/src/main/java/org/bukkit/map/MapView.java
@@ -32,9 +32,9 @@ public interface MapView {
*
* @param value The raw scale
* @return The enum scale, or null for an invalid input
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static Scale valueOf(byte value) {
switch (value) {
@@ -51,9 +51,9 @@ public interface MapView {
* Get the raw value of this scale level.
*
* @return The scale value
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getValue() {
return value;
}
2023-06-03 20:09:43 +02:00
diff --git a/src/main/java/org/bukkit/material/Openable.java b/src/main/java/org/bukkit/material/Openable.java
index 0ae54f973d11df74abb3105cf9226afb130b4f33..597036bad6bc61b4aa63a61b45e886dd74a0b7f6 100644
--- a/src/main/java/org/bukkit/material/Openable.java
+++ b/src/main/java/org/bukkit/material/Openable.java
@@ -1,5 +1,6 @@
package org.bukkit.material;
+@Deprecated // Paper
public interface Openable {
/**
diff --git a/src/main/java/org/bukkit/material/Redstone.java b/src/main/java/org/bukkit/material/Redstone.java
index 3e46603f8cd38041394e0e1baf788d9009b3ffc7..b15c141f1db07296bb349f11c6f39b0fbe53e7b1 100644
--- a/src/main/java/org/bukkit/material/Redstone.java
+++ b/src/main/java/org/bukkit/material/Redstone.java
@@ -3,6 +3,7 @@ package org.bukkit.material;
/**
* Indicated a Material that may carry or create a Redstone current
*/
+@Deprecated // Paper
public interface Redstone {
2021-12-28 20:13:27 +01:00
/**
2021-07-30 01:04:26 +02:00
diff --git a/src/main/java/org/bukkit/material/Step.java b/src/main/java/org/bukkit/material/Step.java
index 9f502e7ee05d0512e190a1722cc112ece068c4e2..10c0465cf58d680bfa9a0f9233f94e8b6d5a9b93 100644
--- a/src/main/java/org/bukkit/material/Step.java
+++ b/src/main/java/org/bukkit/material/Step.java
@@ -78,6 +78,7 @@ public class Step extends TexturedMaterial {
*
* @deprecated Magic value
*/
+ @Deprecated // Paper
@Override
protected int getTextureIndex() {
return getData() & 0x7;
2022-05-16 04:33:03 +02:00
diff --git a/src/main/java/org/bukkit/material/types/MushroomBlockTexture.java b/src/main/java/org/bukkit/material/types/MushroomBlockTexture.java
index 0ea9c6b2420a0f990bd1fdf50fc015e37a7060d8..e99644eae1c662b117aa19060d2484aca19fe0a4 100644
--- a/src/main/java/org/bukkit/material/types/MushroomBlockTexture.java
+++ b/src/main/java/org/bukkit/material/types/MushroomBlockTexture.java
@@ -7,7 +7,9 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents the different textured blocks of mushroom.
+ * @deprecated use BlockData
*/
+@Deprecated // Paper
public enum MushroomBlockTexture {
/**
2023-11-11 22:52:32 +01:00
diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java
2024-04-06 21:53:39 +02:00
index 28dd05c706211f78eb27329a4284e2f21c5f5eb5..f97dff2fd90cc8c35cbde04d1ace81320a8e4658 100644
2023-11-11 22:52:32 +01:00
--- a/src/main/java/org/bukkit/potion/PotionEffectType.java
+++ b/src/main/java/org/bukkit/potion/PotionEffectType.java
2024-04-06 21:53:39 +02:00
@@ -240,9 +240,9 @@ public abstract class PotionEffectType implements Keyed, Translatable {
2023-11-11 22:52:32 +01:00
* Returns the unique ID of this type.
*
* @return Unique ID
- * @deprecated Magic value
+ * @deprecated use {@link #key()}
*/
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.2") // Paper
2023-12-05 18:33:18 +01:00
public abstract int getId();
/**
2024-04-06 21:53:39 +02:00
@@ -278,9 +278,9 @@ public abstract class PotionEffectType implements Keyed, Translatable {
2023-11-11 22:52:32 +01:00
*
* @param id Unique ID to fetch
* @return Resulting type, or null if not found.
- * @deprecated Magic value
+ * @apiNote Internal Use Only
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static PotionEffectType getById(int id) {
2023-12-05 18:33:18 +01:00
PotionEffectType type = ID_MAP.get(id);
2023-06-03 20:09:43 +02:00
diff --git a/src/test/java/org/bukkit/materials/MaterialDataTest.java b/src/test/java/org/bukkit/materials/MaterialDataTest.java
2023-09-24 09:16:58 +02:00
index 8d78435cc42a9e668b2d4d674b79b4094c3bd1b1..24a8ce4387b897c717b55405f363ffafff45894d 100644
2023-06-03 20:09:43 +02:00
--- a/src/test/java/org/bukkit/materials/MaterialDataTest.java
+++ b/src/test/java/org/bukkit/materials/MaterialDataTest.java
@@ -22,6 +22,7 @@ import org.bukkit.material.WoodenStep;
import org.bukkit.material.types.MushroomBlockTexture;
2023-09-24 09:16:58 +02:00
import org.junit.jupiter.api.Test;
2023-06-03 20:09:43 +02:00
+@Deprecated // Paper
public class MaterialDataTest {
@Test