From d48ecdeb4556e22991d03625ba3f3be23e6101ec Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 18 Jul 2018 16:55:44 +1000 Subject: [PATCH] Delete Block.setData byte methods from API --- .../java/org/bukkit/craftbukkit/util/Commodore.java | 2 ++ .../java/org/bukkit/craftbukkit/util/CraftEvil.java | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java index cc877f0a4d..b4c1c68c76 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -39,6 +39,8 @@ public class Commodore "org/bukkit/block/Block (I)Z setTypeId", "org/bukkit/block/Block (IZ)Z setTypeId", "org/bukkit/block/Block (IBZ)Z setTypeIdAndData", + "org/bukkit/block/Block (B)V setData", + "org/bukkit/block/Block (BZ)V setData", "org/bukkit/inventory/ItemStack ()I getTypeId", "org/bukkit/inventory/ItemStack (I)V setTypeId" ) ); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftEvil.java b/src/main/java/org/bukkit/craftbukkit/util/CraftEvil.java index 14fef6f41e..609606e189 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftEvil.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftEvil.java @@ -8,6 +8,7 @@ import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockState; +import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.inventory.ItemStack; /** @@ -49,10 +50,18 @@ public class CraftEvil { public static boolean setTypeIdAndData(Block block, int type, byte data, boolean applyPhysics) { block.setType(getMaterial(type), applyPhysics); - block.setData(data); + setData(block, data); return true; } + public static void setData(Block block, byte data) { + ((CraftBlock) block).setData(data); + } + + public static void setData(Block block, byte data, boolean applyPhysics) { + ((CraftBlock) block).setData(data, applyPhysics); + } + public static int getTypeId(BlockState state) { return getId(state.getType()); }