Search in sources :

Example 1 with Banner

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

the class BlockBanner 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 Banner)) {
        warnMaterialData(Banner.class, data);
        return;
    }
    Banner banner = (Banner) data;
    if (banner.isWallBanner()) {
        banner.setFacingDirection(face);
    } else {
        banner.setFacingDirection(player.getFacing().getOppositeFace());
    }
}
Also used : GlowBanner(net.glowstone.block.state.GlowBanner) Banner(org.bukkit.material.Banner) MaterialData(org.bukkit.material.MaterialData)

Aggregations

GlowBanner (net.glowstone.block.state.GlowBanner)1 Banner (org.bukkit.material.Banner)1 MaterialData (org.bukkit.material.MaterialData)1