Search in sources :

Example 1 with BlockTriStateSignalBox

use of club.nsdn.nyasamarailway.tileblock.signal.core.BlockTriStateSignalBox in project NyaSamaRailway by NSDN.

the class BlockPillar method checkBlock.

public boolean checkBlock(IBlockAccess world, int x, int y, int z) {
    Block block = world.getBlock(x, y, z);
    if (block instanceof BlockAir)
        return false;
    if (block instanceof BlockSlab)
        return false;
    if (block instanceof BlockPane)
        return false;
    if (block instanceof BlockWall)
        return false;
    if (block instanceof BlockSignalBox || block instanceof BlockSignalBoxSender || block instanceof BlockTriStateSignalBox || block instanceof BlockSignalLight || block instanceof BlockSignalLamp || block instanceof BlockSignalStick || block instanceof BlockBiSignalLight || block instanceof BlockTriSignalLight) {
        if (world.getBlock(x, y - 1, z) == this)
            return true;
    }
    if (world.getTileEntity(x, y, z) != null) {
        if (!(world.getTileEntity(x, y, z) instanceof Pillar))
            return false;
    }
    Material material = block.getMaterial();
    if (material == Material.clay || material == Material.ground || material == Material.iron || material == Material.rock || material == Material.glass || material == Material.sand || material == Material.wood)
        return true;
    return material.isSolid();
}
Also used : BlockTriStateSignalBox(club.nsdn.nyasamarailway.tileblock.signal.core.BlockTriStateSignalBox) Material(net.minecraft.block.material.Material) BlockSignalBoxSender(club.nsdn.nyasamarailway.tileblock.signal.core.BlockSignalBoxSender) TileBlock(club.nsdn.nyasamarailway.tileblock.TileBlock) BlockSignalBox(club.nsdn.nyasamarailway.tileblock.signal.core.BlockSignalBox)

Aggregations

TileBlock (club.nsdn.nyasamarailway.tileblock.TileBlock)1 BlockSignalBox (club.nsdn.nyasamarailway.tileblock.signal.core.BlockSignalBox)1 BlockSignalBoxSender (club.nsdn.nyasamarailway.tileblock.signal.core.BlockSignalBoxSender)1 BlockTriStateSignalBox (club.nsdn.nyasamarailway.tileblock.signal.core.BlockTriStateSignalBox)1 Material (net.minecraft.block.material.Material)1