Archiviert
13
0

deprecate old MaterialData api (#7585)

Dieser Commit ist enthalten in:
Jake Potrebic 2022-05-15 19:33:03 -07:00 committet von GitHub
Ursprung 9fd870db0b
Commit 8d1de8de8d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
12 geänderte Dateien mit 316 neuen und 28 gelöschten Zeilen

Datei anzeigen

@ -42,6 +42,20 @@ index ca6f3a18ca8902b99c1c8c21b6da5def7fdb2aa8..b4256e2c66e3f578a4499dc1fff50f21
public static <T extends Keyed> Tag<T> getTag(@NotNull String registry, @NotNull NamespacedKey tag, @NotNull Class<T> clazz) { public static <T extends Keyed> Tag<T> getTag(@NotNull String registry, @NotNull NamespacedKey tag, @NotNull Class<T> clazz) {
return server.getTag(registry, tag, clazz); return server.getTag(registry, tag, clazz);
} }
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 {
/**
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 57cb548683f7b2972c998afd34176952426f8b47..d4c87bfed81b2d73919705912f59fab05c0ee61b 100644 index 57cb548683f7b2972c998afd34176952426f8b47..d4c87bfed81b2d73919705912f59fab05c0ee61b 100644
--- a/src/main/java/org/bukkit/Location.java --- a/src/main/java/org/bukkit/Location.java
@ -74,7 +88,7 @@ index 57cb548683f7b2972c998afd34176952426f8b47..d4c87bfed81b2d73919705912f59fab0
if (this.world == null) { if (this.world == null) {
return null; return null;
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 53d1609e2a75c007cb7e5e8f963b0deb53bae5f7..a8561434d56f7db7e4f52283759b282e9c2116a2 100644 index 53d1609e2a75c007cb7e5e8f963b0deb53bae5f7..88d9ca5d5c240bb6810a843c27eb1613235bffdd 100644
--- a/src/main/java/org/bukkit/Material.java --- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java
@@ -4003,11 +4003,11 @@ public enum Material implements Keyed { @@ -4003,11 +4003,11 @@ public enum Material implements Keyed {
@ -91,6 +105,17 @@ index 53d1609e2a75c007cb7e5e8f963b0deb53bae5f7..a8561434d56f7db7e4f52283759b282e
public boolean isLegacy() { public boolean isLegacy() {
return legacy; return legacy;
} }
@@ -4078,8 +4078,10 @@ public enum Material implements Keyed {
* 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() {
Validate.isTrue(legacy, "Cannot get data class of Modern Material");
return ctor.getDeclaringClass();
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
index 01bcb3a1bdb5accdf844d0178cec3d25746b3eaa..236c9aea9ffc36269e5c32eacc9f1fd6bd039c88 100644 index 01bcb3a1bdb5accdf844d0178cec3d25746b3eaa..236c9aea9ffc36269e5c32eacc9f1fd6bd039c88 100644
--- a/src/main/java/org/bukkit/NamespacedKey.java --- a/src/main/java/org/bukkit/NamespacedKey.java
@ -112,6 +137,36 @@ index 01bcb3a1bdb5accdf844d0178cec3d25746b3eaa..236c9aea9ffc36269e5c32eacc9f1fd6
public NamespacedKey(@NotNull String namespace, @NotNull String key) { public NamespacedKey(@NotNull String namespace, @NotNull String key) {
Preconditions.checkArgument(namespace != null && VALID_NAMESPACE.matcher(namespace).matches(), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace); Preconditions.checkArgument(namespace != null && VALID_NAMESPACE.matcher(namespace).matches(), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace);
Preconditions.checkArgument(key != null && VALID_KEY.matcher(key).matches(), "Invalid key. Must be [a-z0-9/._-]: %s", key); Preconditions.checkArgument(key != null && VALID_KEY.matcher(key).matches(), "Invalid key. Must be [a-z0-9/._-]: %s", key);
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 {
/**
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),
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 28be40d6844f801c26e8359e509afc5e3dedd71f..e0ad194697b0333e760ee5d66dac406921018479 100644 index 28be40d6844f801c26e8359e509afc5e3dedd71f..e0ad194697b0333e760ee5d66dac406921018479 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
@ -138,7 +193,7 @@ index 28be40d6844f801c26e8359e509afc5e3dedd71f..e0ad194697b0333e760ee5d66dac4069
/** /**
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index f36eb8896ee84c1d3bbce17b11ed05c5f99f2e29..b8c4d25d49ea65d36b052faba8863efa813d9bc5 100644 index b4c77e92f286e0159c8f25a063a964aaf1b1bd8c..4f9f8e51e1a99a2d19643d105b839562ebe0b600 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -427,9 +427,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient @@ -427,9 +427,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@ -151,6 +206,66 @@ index f36eb8896ee84c1d3bbce17b11ed05c5f99f2e29..b8c4d25d49ea65d36b052faba8863efa
+ //@Deprecated // Paper + //@Deprecated // Paper
public boolean refreshChunk(int x, int z); public boolean refreshChunk(int x, int z);
/**
@@ -2142,8 +2141,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @return The spawned {@link FallingBlock} instance
* @throws IllegalArgumentException if {@link Location} or {@link
* MaterialData} are null or {@link Material} of the {@link MaterialData} is not a block
+ * @deprecated use {@link #spawnFallingBlock(Location, BlockData)}
*/
@NotNull
+ @Deprecated // Paper
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull MaterialData data) throws IllegalArgumentException;
/**
diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java
index 631cbf2be51040eee00aa39a39c5ec4003f91843..3147e278eac674ed21d714bbe318b135c0a6b408 100644
--- a/src/main/java/org/bukkit/block/BlockState.java
+++ b/src/main/java/org/bukkit/block/BlockState.java
@@ -35,8 +35,10 @@ public interface BlockState extends Metadatable {
* Gets the metadata for this block state.
*
* @return block specific metadata
+ * @deprecated use {@link #getBlockData()}
*/
@NotNull
+ @Deprecated // Paper
MaterialData getData();
/**
@@ -131,7 +133,9 @@ public interface BlockState extends Metadatable {
* 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);
/**
diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java
index 821c690f8a32918bdb284ffec4af98f411f76ccc..94f3a8c4bf8cf14263d34d866db66728e98dfdb0 100644
--- a/src/main/java/org/bukkit/entity/Enderman.java
+++ b/src/main/java/org/bukkit/entity/Enderman.java
@@ -25,15 +25,19 @@ public interface Enderman extends Monster {
* 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);
/** /**
diff --git a/src/main/java/org/bukkit/entity/LingeringPotion.java b/src/main/java/org/bukkit/entity/LingeringPotion.java diff --git a/src/main/java/org/bukkit/entity/LingeringPotion.java b/src/main/java/org/bukkit/entity/LingeringPotion.java
index f124b35ec76e6cb6a1a0dc464005087043c3efd0..94a2fef0dc9e13c754cd31d5eabc1bde2dbbe6a5 100644 index f124b35ec76e6cb6a1a0dc464005087043c3efd0..94a2fef0dc9e13c754cd31d5eabc1bde2dbbe6a5 100644
@ -162,6 +277,31 @@ index f124b35ec76e6cb6a1a0dc464005087043c3efd0..94a2fef0dc9e13c754cd31d5eabc1bde
*/ */
+@Deprecated // Paper +@Deprecated // Paper
public interface LingeringPotion extends ThrownPotion { } public interface LingeringPotion extends ThrownPotion { }
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();
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 98b856d068c765a277d1e218a04e05588e18fdcb..2c3aba0b8d89d74bfa22ae01232712c8e3516b6b 100644 index 98b856d068c765a277d1e218a04e05588e18fdcb..2c3aba0b8d89d74bfa22ae01232712c8e3516b6b 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
@ -260,6 +400,41 @@ index 5408a8c123942a56ef11597ae6cdb77e14f741e3..29bb84145be18ef9162abdfc8820f2b3
@Warning(false) @Warning(false)
public class PlayerShowEntityEvent extends PlayerEvent { public class PlayerShowEntityEvent extends PlayerEvent {
diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java
index d14d3851a7b0340668f44f5213f0e18072d7481b..eff4c1cb410e032ee287084cb51b59fd9f84df8d 100644
--- a/src/main/java/org/bukkit/generator/ChunkGenerator.java
+++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java
@@ -515,7 +515,9 @@ public abstract class ChunkGenerator {
* @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);
/**
@@ -559,7 +561,9 @@ public abstract class ChunkGenerator {
* @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);
/**
@@ -600,8 +604,10 @@ public abstract class ChunkGenerator {
* @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);
/**
diff --git a/src/main/java/org/bukkit/inventory/CraftingInventory.java b/src/main/java/org/bukkit/inventory/CraftingInventory.java diff --git a/src/main/java/org/bukkit/inventory/CraftingInventory.java b/src/main/java/org/bukkit/inventory/CraftingInventory.java
index df81bac9ecff697f98941e5c8490e10391e90090..a32977ba3ba60a1c9aee6e469d5d6cd1887c55a2 100644 index df81bac9ecff697f98941e5c8490e10391e90090..a32977ba3ba60a1c9aee6e469d5d6cd1887c55a2 100644
--- a/src/main/java/org/bukkit/inventory/CraftingInventory.java --- a/src/main/java/org/bukkit/inventory/CraftingInventory.java
@ -283,6 +458,21 @@ index df81bac9ecff697f98941e5c8490e10391e90090..a32977ba3ba60a1c9aee6e469d5d6cd1
/** /**
* Get the current recipe formed on the crafting inventory, if any. * Get the current recipe formed on the crafting inventory, if any.
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());
}
diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java
index 9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883..875c401153349b0f2468525e54cf10ca86430087 100644 index 9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883..875c401153349b0f2468525e54cf10ca86430087 100644
--- a/src/main/java/org/bukkit/inventory/Inventory.java --- a/src/main/java/org/bukkit/inventory/Inventory.java
@ -339,7 +529,7 @@ index 66ffc658dba85942f179760dc6c50258e24ab903..50fe28b48d885c782278bdb53a0bbae3
/** /**
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 487e6a6391123a4792c3bdeba869aa2bcb5922cc..3dd8205dd070901be82c2bef390df5df58b2a9a0 100644 index 487e6a6391123a4792c3bdeba869aa2bcb5922cc..46bf24aed3e959d216d94603560cb75af43ba9d9 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java --- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -8,6 +8,7 @@ import java.util.Set; // Paper @@ -8,6 +8,7 @@ import java.util.Set; // Paper
@ -358,7 +548,28 @@ index 487e6a6391123a4792c3bdeba869aa2bcb5922cc..3dd8205dd070901be82c2bef390df5df
public ItemStack(@NotNull final Material type, final int amount, final short damage) { public ItemStack(@NotNull final Material type, final int amount, final short damage) {
this(type, amount, damage, null); this(type, amount, damage, null);
} }
@@ -546,7 +548,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor @@ -169,8 +171,10 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
* 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) {
@@ -184,7 +188,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
* 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;
@@ -546,7 +552,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
* *
* @return a copy of the current ItemStack's ItemData * @return a copy of the current ItemStack's ItemData
*/ */
@ -403,6 +614,69 @@ index 62fbd7f6d8195bebcab7f704a0a485a1bbeca26c..8b5385e39f64c4df8e235a8832d91e55
public ItemStack getItem(@NotNull EquipmentSlot slot); public ItemStack getItem(@NotNull EquipmentSlot slot);
/** /**
diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
index 222a12baa8e93ad686ab59426653f066d5876e38..2475e00ba2be671cf7c9a5aea83acf094b1a3c62 100644
--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
@@ -96,8 +96,10 @@ public class ShapedRecipe implements Recipe, Keyed {
* @param key The character that represents the ingredient in the shape.
* @param ingredient The ingredient.
* @return The changed recipe, so you can chain calls.
+ * @deprecated use {@link #setIngredient(char, RecipeChoice)}
*/
@NotNull
+ @Deprecated // Paper
public ShapedRecipe setIngredient(char key, @NotNull MaterialData ingredient) {
return setIngredient(key, ingredient.getItemType(), ingredient.getData());
}
diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
index 7f6d3c71c5b3a9aa54c84a4c3b7c3614a0d477ce..1bab04b44d99c974b1cc099d127b93df5947cd4e 100644
--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
@@ -55,8 +55,10 @@ public class ShapelessRecipe implements Recipe, Keyed {
*
* @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);
}
@@ -92,8 +94,10 @@ public class ShapelessRecipe implements Recipe, Keyed {
* @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());
}
@@ -210,8 +214,10 @@ public class ShapelessRecipe implements Recipe, Keyed {
*
* @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());
}
@@ -238,8 +244,10 @@ public class ShapelessRecipe implements Recipe, Keyed {
* @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());
}
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 45baebc97f0aec8abc9a894bc135e4767d7c9e35..a761b8369e1f78b28146b0a4cce121e507d4a738 100644 index 45baebc97f0aec8abc9a894bc135e4767d7c9e35..a761b8369e1f78b28146b0a4cce121e507d4a738 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@ -451,3 +725,17 @@ index 9f502e7ee05d0512e190a1722cc112ece068c4e2..10c0465cf58d680bfa9a0f9233f94e8b
@Override @Override
protected int getTextureIndex() { protected int getTextureIndex() {
return getData() & 0x7; return getData() & 0x7;
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 {
/**

Datei anzeigen

@ -20,10 +20,10 @@ index db272568d7dee924083e37c55bdbf90f05fafc69..f9434c19c1bf355a734b3a1ddf32c81f
// Paper end // Paper end
} }
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 3dd8205dd070901be82c2bef390df5df58b2a9a0..011d8cf2b2358d17e475ce88633c6843fa548834 100644 index 46bf24aed3e959d216d94603560cb75af43ba9d9..f0ba7ba369aad67f6af0f946dc52b3e1c8958b15 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java --- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -629,6 +629,30 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor @@ -633,6 +633,30 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
return Bukkit.getServer().getItemFactory().ensureServerConversions(this); return Bukkit.getServer().getItemFactory().ensureServerConversions(this);
} }

Datei anzeigen

@ -337,7 +337,7 @@ index c799ac46dbe257d470d3b236cf55b41240f5fda8..d61855b83da0776fe910dee8cde184c7
// Paper start - Add villager reputation API // Paper start - Add villager reputation API
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 011d8cf2b2358d17e475ce88633c6843fa548834..91a228239cf2ba6d50f4489b14ee6fa9069af07f 100644 index f0ba7ba369aad67f6af0f946dc52b3e1c8958b15..d13cedfab28a4de469bbc3f6b141922979628333 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java --- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable; @@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
@ -349,7 +349,7 @@ index 011d8cf2b2358d17e475ce88633c6843fa548834..91a228239cf2ba6d50f4489b14ee6fa9
private Material type = Material.AIR; private Material type = Material.AIR;
private int amount = 0; private int amount = 0;
private MaterialData data = null; private MaterialData data = null;
@@ -855,5 +855,30 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor @@ -859,5 +859,30 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
ItemMeta itemMeta = getItemMeta(); ItemMeta itemMeta = getItemMeta();
return itemMeta != null && itemMeta.hasItemFlag(flag); return itemMeta != null && itemMeta.hasItemFlag(flag);
} }

Datei anzeigen

@ -31,7 +31,7 @@ index 24751b5c4e3bc24bdfa85af8f6fcba37413aa002..e0d0537606d4f9a3fe588ebf7d02f314
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/entity/Minecart.java b/src/main/java/org/bukkit/entity/Minecart.java diff --git a/src/main/java/org/bukkit/entity/Minecart.java b/src/main/java/org/bukkit/entity/Minecart.java
index 95c79c5fa0c4e30201f887da6467ce5f81c8a255..53b042f8ebbbf6ee77435b93d4e89371375cc515 100644 index 7f9c4d4b430a3f0276461346ff2621bacf864075..bc1e62759c995a1463ebcd10d73c7d502c9acc45 100644
--- a/src/main/java/org/bukkit/entity/Minecart.java --- a/src/main/java/org/bukkit/entity/Minecart.java
+++ b/src/main/java/org/bukkit/entity/Minecart.java +++ b/src/main/java/org/bukkit/entity/Minecart.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -41,7 +41,7 @@ index 95c79c5fa0c4e30201f887da6467ce5f81c8a255..53b042f8ebbbf6ee77435b93d4e89371
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;
import org.bukkit.material.MaterialData; import org.bukkit.material.MaterialData;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
@@ -143,4 +144,14 @@ public interface Minecart extends Vehicle { @@ -147,4 +148,14 @@ public interface Minecart extends Vehicle {
* @return the current block offset for this minecart. * @return the current block offset for this minecart.
*/ */
public int getDisplayBlockOffset(); public int getDisplayBlockOffset();

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Cache the result of Material#isBlock
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 82bd673f43f26d62f1f4bea3638fd89d9eef3887..9f0048888a2fe40316154613a722d1c709fd3856 100644 index 733223b0b0a1490afd0957957798e010a2373216..9e6380ed86b11cc763afa02ddaf124ee98e24797 100644
--- a/src/main/java/org/bukkit/Material.java --- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java
@@ -3932,6 +3932,7 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata @@ -3932,6 +3932,7 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
@ -16,7 +16,7 @@ index 82bd673f43f26d62f1f4bea3638fd89d9eef3887..9f0048888a2fe40316154613a722d1c7
private Material(final int id) { private Material(final int id) {
this(id, 64); this(id, 64);
@@ -4136,6 +4137,11 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata @@ -4138,6 +4139,11 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
* @return true if this material is a block * @return true if this material is a block
*/ */
public boolean isBlock() { public boolean isBlock() {
@ -28,7 +28,7 @@ index 82bd673f43f26d62f1f4bea3638fd89d9eef3887..9f0048888a2fe40316154613a722d1c7
switch (this) { switch (this) {
//<editor-fold defaultstate="collapsed" desc="isBlock"> //<editor-fold defaultstate="collapsed" desc="isBlock">
case ACACIA_BUTTON: case ACACIA_BUTTON:
@@ -5217,6 +5223,7 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata @@ -5219,6 +5225,7 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
static { static {
for (Material material : values()) { for (Material material : values()) {
BY_NAME.put(material.name(), material); BY_NAME.put(material.name(), material);

Datei anzeigen

@ -39,7 +39,7 @@ index 0000000000000000000000000000000000000000..74ef8395cc040ce488c2acaa416db202
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 9f0048888a2fe40316154613a722d1c709fd3856..709ae1eaabd81ee712d7d6f353c4983f20f6dc4f 100644 index 9e6380ed86b11cc763afa02ddaf124ee98e24797..96199694504da0008998471efe7bc45d5a57b13d 100644
--- a/src/main/java/org/bukkit/Material.java --- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java
@@ -4006,6 +4006,17 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata @@ -4006,6 +4006,17 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
@ -88,10 +88,10 @@ index 0697214210a6e87f690b9454d9651d06ca57a524..8cbd493f695229a7dad46916087aeb31
// Paper end // Paper end
} }
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 91a228239cf2ba6d50f4489b14ee6fa9069af07f..ebc44aae46d67ae565eeafb5bb3af74bbc88dbc1 100644 index d13cedfab28a4de469bbc3f6b141922979628333..e29fc737968898ada7aa860d1887bd3b93f4b292 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java --- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -880,5 +880,15 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor @@ -884,5 +884,15 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
public @NotNull String translationKey() { public @NotNull String translationKey() {
return Bukkit.getUnsafe().getTranslationKey(this); return Bukkit.getUnsafe().getTranslationKey(this);
} }

Datei anzeigen

@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/Worl
index c31c58ea83845ef032bc477e33aa94713454f194..7a519e242a6fb2de41fd1e9cd6e7a237f78ef004 100644 index c31c58ea83845ef032bc477e33aa94713454f194..7a519e242a6fb2de41fd1e9cd6e7a237f78ef004 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -3637,6 +3637,114 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient @@ -3639,6 +3639,114 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable @Nullable
public Location locateNearestStructure(@NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored); public Location locateNearestStructure(@NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored);

Datei anzeigen

@ -26,10 +26,10 @@ index 45a5e148ae5582a805e350b526cfb3ad87f6f945..d712a2c7a8ec02d3abbbcb8e616e002e
* Returns the server's protocol version. * Returns the server's protocol version.
* *
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index ebc44aae46d67ae565eeafb5bb3af74bbc88dbc1..e126c45a4184cd637c94b55c5eb14fe4b5afe32e 100644 index e29fc737968898ada7aa860d1887bd3b93f4b292..6082ee2fb68433e1d42a7f0617f25a232960ded6 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java --- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -890,5 +890,27 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor @@ -894,5 +894,27 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
public io.papermc.paper.inventory.ItemRarity getRarity() { public io.papermc.paper.inventory.ItemRarity getRarity() {
return Bukkit.getUnsafe().getItemStackRarity(this); return Bukkit.getUnsafe().getItemStackRarity(this);
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack#editMeta
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index e126c45a4184cd637c94b55c5eb14fe4b5afe32e..7dfc84c77d8e185bb0513d9f9c603ce1b501a5e0 100644 index 6082ee2fb68433e1d42a7f0617f25a232960ded6..66352c63bcacb9b418a3cc61d8a6219b4cdfbb32 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java --- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -543,6 +543,50 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor @@ -547,6 +547,50 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
return result.ensureServerConversions(); // Paper return result.ensureServerConversions(); // Paper
} }

Datei anzeigen

@ -144,10 +144,10 @@ index c2a566b864c82ffb094b7334d9e6e25a1bfc87d1..c340fecb61bac66baf0f44189d21bc85
+ // Paper End - More cat api + // Paper End - More cat api
} }
diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java
index 821c690f8a32918bdb284ffec4af98f411f76ccc..f4664855f22ba9d6c5aa1db4f8551fe28b7d980c 100644 index 94f3a8c4bf8cf14263d34d866db66728e98dfdb0..7937a0e082199554d3e8db1f9811be29abc9b3fd 100644
--- a/src/main/java/org/bukkit/entity/Enderman.java --- a/src/main/java/org/bukkit/entity/Enderman.java
+++ b/src/main/java/org/bukkit/entity/Enderman.java +++ b/src/main/java/org/bukkit/entity/Enderman.java
@@ -50,4 +50,36 @@ public interface Enderman extends Monster { @@ -54,4 +54,36 @@ public interface Enderman extends Monster {
* @param blockData data to set the carried block to, or null to remove * @param blockData data to set the carried block to, or null to remove
*/ */
public void setCarriedBlock(@Nullable BlockData blockData); public void setCarriedBlock(@Nullable BlockData blockData);

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add isCollidable methods to various places
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index fb8758970a76ee263fc85aaccbafb0bf1745afb8..ef7054fec75d91082be27fdd2a06469f37a6c174 100644 index 24df195ed5809969ba8229360b3e57465ae9301d..065ca80518c215cbebb068b0d59bf233a744b0db 100644
--- a/src/main/java/org/bukkit/Material.java --- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java
@@ -4032,6 +4032,16 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata @@ -4032,6 +4032,16 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
@ -63,10 +63,10 @@ index cff83028e9a08466551db4698cf4860553dd750d..3e980c630452c8ea72227bc4cd92c605
/** /**
diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java
index 631cbf2be51040eee00aa39a39c5ec4003f91843..96cde879922c796f3ac8d14ee99d7b190ff67bd9 100644 index 3147e278eac674ed21d714bbe318b135c0a6b408..10cbe71917bc32cca61748bcb0aa3395c554dbf8 100644
--- a/src/main/java/org/bukkit/block/BlockState.java --- a/src/main/java/org/bukkit/block/BlockState.java
+++ b/src/main/java/org/bukkit/block/BlockState.java +++ b/src/main/java/org/bukkit/block/BlockState.java
@@ -221,4 +221,13 @@ public interface BlockState extends Metadatable { @@ -225,4 +225,13 @@ public interface BlockState extends Metadatable {
* or 'virtual' (e.g. on an itemstack) * or 'virtual' (e.g. on an itemstack)
*/ */
boolean isPlaced(); boolean isPlaced();

Datei anzeigen

@ -32,10 +32,10 @@ index 2acafae468fcbb7213d6b6c30803a3924a3bbc30..40edff7c93b6bf75de81102326667135
* Creates a hover event for the given item. * Creates a hover event for the given item.
* *
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 7dfc84c77d8e185bb0513d9f9c603ce1b501a5e0..56897cfb96b53e43fec343568e514ee636ddd5c5 100644 index 66352c63bcacb9b418a3cc61d8a6219b4cdfbb32..62841846ec3e14daa46564509671cab146984cc6 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java --- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -645,6 +645,24 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor @@ -649,6 +649,24 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
} }
// Paper start // Paper start