mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-13 15:08:35 +00:00
Added data value mappings for certain blocks and made all other block types wildcard matches.
This commit is contained in:
@ -166,9 +166,6 @@ public class BukkitUtil {
|
||||
|
||||
public static BaseBlock toBlock(LocalWorld world, ItemStack itemStack) throws WorldEditException {
|
||||
final int typeId = itemStack.getTypeId();
|
||||
if (world.isValidBlockType(typeId)) {
|
||||
return new BaseBlock(typeId, itemStack.getDurability());
|
||||
}
|
||||
|
||||
switch (typeId) {
|
||||
case ItemID.INK_SACK:
|
||||
@ -182,13 +179,17 @@ public class BukkitUtil {
|
||||
return new SkullBlock(0, (byte) itemStack.getDurability());
|
||||
|
||||
default:
|
||||
final BaseBlock baseBlock = BlockType.getBlockForItem(typeId);
|
||||
final BaseBlock baseBlock = BlockType.getBlockForItem(typeId, itemStack.getDurability());
|
||||
if (baseBlock != null) {
|
||||
return baseBlock;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (world.isValidBlockType(typeId)) {
|
||||
return new BaseBlock(typeId, -1);
|
||||
}
|
||||
|
||||
throw new NotABlockException(typeId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user