Search in sources :

Example 1 with Tree

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

the class BlockLog 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 Tree) {
        ((Tree) data).setDirection(face);
        ((Tree) data).setSpecies(TreeSpecies.getByData((byte) holding.getDurability()));
    } else {
        warnMaterialData(Tree.class, data);
    }
    state.setData(data);
}
Also used : Tree(org.bukkit.material.Tree) MaterialData(org.bukkit.material.MaterialData)

Aggregations

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