Delete Block.setData byte methods from API

This commit is contained in:
md_5 2018-07-18 16:55:44 +10:00
parent b9fd5c60e9
commit d48ecdeb45
2 changed files with 12 additions and 1 deletions

View file

@ -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"
) );

View file

@ -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());
}