Search in sources :

Example 1 with Torch

use of org.bukkit.material.Torch in project Glowstone by GlowstoneMC.

the class BlockTorch method placeBlock.

@Override
public void placeBlock(GlowPlayer player, GlowBlockState state, BlockFace face, ItemStack holding, Vector clickedLoc) {
    super.placeBlock(player, state, face, holding, clickedLoc);
    MaterialData data = state.getData();
    if (data instanceof Torch) {
        if (canAttachTo(state.getBlock(), face)) {
            ((Torch) data).setFacingDirection(face);
        } else {
            ((Torch) data).setFacingDirection(BlockFace.UP);
        }
    } else {
        warnMaterialData(Torch.class, data);
    }
}
Also used : MaterialData(org.bukkit.material.MaterialData) Torch(org.bukkit.material.Torch)

Aggregations

MaterialData (org.bukkit.material.MaterialData)1 Torch (org.bukkit.material.Torch)1