Search in sources :

Example 1 with WallSign

use of org.bukkit.block.data.type.WallSign in project MagicPlugin by elBukkit.

the class CompatibilityUtils method getSignFacing.

@Override
public BlockFace getSignFacing(Block signBlock) {
    BlockData blockData = signBlock.getBlockData();
    if (!(blockData instanceof WallSign)) {
        return null;
    }
    WallSign sign = (WallSign) blockData;
    return sign.getFacing();
}
Also used : WallSign(org.bukkit.block.data.type.WallSign) BlockData(org.bukkit.block.data.BlockData)

Example 2 with WallSign

use of org.bukkit.block.data.type.WallSign in project MagicPlugin by elBukkit.

the class CompatibilityUtils method getSignFacing.

@Override
public BlockFace getSignFacing(Block signBlock) {
    BlockData blockData = signBlock.getBlockData();
    if (!(blockData instanceof WallSign)) {
        return null;
    }
    WallSign sign = (WallSign) blockData;
    return sign.getFacing();
}
Also used : WallSign(org.bukkit.block.data.type.WallSign) BlockData(org.bukkit.block.data.BlockData)

Example 3 with WallSign

use of org.bukkit.block.data.type.WallSign in project MagicPlugin by elBukkit.

the class CompatibilityUtils method getSignFacing.

@Override
public BlockFace getSignFacing(Block signBlock) {
    BlockData blockData = signBlock.getBlockData();
    if (!(blockData instanceof WallSign)) {
        return null;
    }
    WallSign sign = (WallSign) blockData;
    return sign.getFacing();
}
Also used : WallSign(org.bukkit.block.data.type.WallSign) BlockData(org.bukkit.block.data.BlockData)

Example 4 with WallSign

use of org.bukkit.block.data.type.WallSign in project MagicPlugin by elBukkit.

the class CompatibilityUtils method getSignFacing.

@Override
public BlockFace getSignFacing(Block signBlock) {
    BlockData blockData = signBlock.getBlockData();
    if (!(blockData instanceof WallSign)) {
        return null;
    }
    WallSign sign = (WallSign) blockData;
    return sign.getFacing();
}
Also used : WallSign(org.bukkit.block.data.type.WallSign) BlockData(org.bukkit.block.data.BlockData)

Example 5 with WallSign

use of org.bukkit.block.data.type.WallSign in project AreaShop by NLthijs48.

the class BukkitHandler1_13 method getSignFacing.

// Uses BlockData, which does not yet exist in 1.12-
@Override
public BlockFace getSignFacing(Block block) {
    if (block == null) {
        return null;
    }
    BlockState blockState = block.getState();
    if (blockState == null) {
        return null;
    }
    BlockData blockData = blockState.getBlockData();
    if (blockData == null) {
        return null;
    }
    if (blockData instanceof WallSign) {
        return ((WallSign) blockData).getFacing();
    } else if (blockData instanceof Sign) {
        return ((Sign) blockData).getRotation();
    }
    return null;
}
Also used : WallSign(org.bukkit.block.data.type.WallSign) BlockState(org.bukkit.block.BlockState) Sign(org.bukkit.block.data.type.Sign) WallSign(org.bukkit.block.data.type.WallSign) BlockData(org.bukkit.block.data.BlockData)

Aggregations

WallSign (org.bukkit.block.data.type.WallSign)17 BlockData (org.bukkit.block.data.BlockData)8 EventHandler (org.bukkit.event.EventHandler)8 Block (org.bukkit.block.Block)7 Player (org.bukkit.entity.Player)7 BlockState (org.bukkit.block.BlockState)5 Sign (org.bukkit.block.Sign)5 Location (org.bukkit.Location)4 Sign (org.bukkit.block.data.type.Sign)4 Craft (net.countercraft.movecraft.craft.Craft)2 TownBlock (com.palmergames.bukkit.towny.object.TownBlock)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 MovecraftLocation (net.countercraft.movecraft.MovecraftLocation)1 CruiseOnPilotCraft (net.countercraft.movecraft.craft.CruiseOnPilotCraft)1 CruiseOnPilotSubCraft (net.countercraft.movecraft.craft.CruiseOnPilotSubCraft)1 PlayerCraftImpl (net.countercraft.movecraft.craft.PlayerCraftImpl)1 SubCraft (net.countercraft.movecraft.craft.SubCraft)1 CraftType (net.countercraft.movecraft.craft.type.CraftType)1 CraftPilotEvent (net.countercraft.movecraft.events.CraftPilotEvent)1