Archiviert
13
0

Delete Block.setData byte methods from API

Dieser Commit ist enthalten in:
md_5 2018-07-18 16:55:44 +10:00
Ursprung b9fd5c60e9
Commit d48ecdeb45
2 geänderte Dateien mit 12 neuen und 1 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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