public void setBlockMaterial(int xx, int yy, int zz, BlockMaterial material, short data) {
final Vector3f transformed = transform(xx, yy, zz);
position.getWorld().setBlockMaterial(transformed.getFloorX(), transformed.getFloorY(), transformed.getFloorZ(),
material, data, null);
if (material instanceof Directional) {
final Directional directional = (Directional) material;
final Block block = position.getWorld().getBlock(transformed);
final BlockFace face = directional.getFacing(block);
if (face != BlockFace.BOTTOM && face != BlockFace.TOP) {
directional.setFacing(block, BlockFace.fromYaw(face.getDirection().getAxesAngleDeg().getY()
+ rotation.getAxesAngleDeg().getY()));
}
} else if (material instanceof Attachable) {
final Attachable attachable = (Attachable) material;
final Block block = position.getWorld().getBlock(transformed);