Added a "pos1" pseudo block type, which uses the block type from the "primary position".

This commit is contained in:
TomyLobo 2013-11-24 16:54:01 +01:00
parent 768adee389
commit 1b9445b6f2

View File

@ -404,6 +404,18 @@ public class WorldEdit {
return blockInHand;
}
blockId = blockInHand.getId();
blockType = BlockType.fromID(blockId);
data = blockInHand.getData();
} else if ("pos1".equalsIgnoreCase(testID)) {
// Get the block type from the "primary position"
final LocalWorld world = player.getWorld();
final BlockVector primaryPosition = getSession(player).getRegionSelector(world).getPrimaryPosition();
final BaseBlock blockInHand = world.getBlock(primaryPosition);
if (blockInHand.getClass() != BaseBlock.class) {
return blockInHand;
}
blockId = blockInHand.getId();
blockType = BlockType.fromID(blockId);
data = blockInHand.getData();