Search in sources :

Example 26 with IBlockData

use of net.minecraft.server.v1_11_R1.IBlockData in project Citizens2 by CitizensDev.

the class PlayerPathfinderNormal method b.

private PathType b(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3) {
    BlockPosition localBlockPosition = new BlockPosition(paramInt1, paramInt2, paramInt3);
    IBlockData localIBlockData = paramIBlockAccess.getType(localBlockPosition);
    Block localBlock = localIBlockData.getBlock();
    Material localMaterial = localIBlockData.getMaterial();
    if (localMaterial == Material.AIR) {
        return PathType.OPEN;
    }
    if ((localBlock == Blocks.TRAPDOOR) || (localBlock == Blocks.IRON_TRAPDOOR) || (localBlock == Blocks.WATERLILY)) {
        return PathType.TRAPDOOR;
    }
    if (localBlock == Blocks.FIRE) {
        return PathType.DAMAGE_FIRE;
    }
    if (localBlock == Blocks.CACTUS) {
        return PathType.DAMAGE_CACTUS;
    }
    if (((localBlock instanceof BlockDoor)) && (localMaterial == Material.WOOD) && (!localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
        return PathType.DOOR_WOOD_CLOSED;
    }
    if (((localBlock instanceof BlockDoor)) && (localMaterial == Material.ORE) && (!localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
        return PathType.DOOR_IRON_CLOSED;
    }
    if (((localBlock instanceof BlockDoor)) && (localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
        return PathType.DOOR_OPEN;
    }
    if ((localBlock instanceof BlockMinecartTrackAbstract)) {
        return PathType.RAIL;
    }
    if (((localBlock instanceof BlockFence)) || ((localBlock instanceof BlockCobbleWall)) || (((localBlock instanceof BlockFenceGate)) && (!localIBlockData.get(BlockFenceGate.OPEN).booleanValue()))) {
        return PathType.FENCE;
    }
    if (localMaterial == Material.WATER) {
        return PathType.WATER;
    }
    if (localMaterial == Material.LAVA) {
        return PathType.LAVA;
    }
    if (localBlock.b(paramIBlockAccess, localBlockPosition)) {
        return PathType.OPEN;
    }
    return PathType.BLOCKED;
}
Also used : BlockDoor(net.minecraft.server.v1_11_R1.BlockDoor) IBlockData(net.minecraft.server.v1_11_R1.IBlockData) BlockFenceGate(net.minecraft.server.v1_11_R1.BlockFenceGate) BlockCobbleWall(net.minecraft.server.v1_11_R1.BlockCobbleWall) MutableBlockPosition(net.minecraft.server.v1_11_R1.BlockPosition.MutableBlockPosition) BlockPosition(net.minecraft.server.v1_11_R1.BlockPosition) Block(net.minecraft.server.v1_11_R1.Block) Material(net.minecraft.server.v1_11_R1.Material) BlockMinecartTrackAbstract(net.minecraft.server.v1_11_R1.BlockMinecartTrackAbstract) BlockFence(net.minecraft.server.v1_11_R1.BlockFence)

Aggregations

BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)5 IBlockData (net.minecraft.server.v1_10_R1.IBlockData)5 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)5 IBlockData (net.minecraft.server.v1_11_R1.IBlockData)5 NPC (net.citizensnpcs.api.npc.NPC)4 NPCHolder (net.citizensnpcs.npc.ai.NPCHolder)4 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)4 IBlockData (net.minecraft.server.v1_12_R1.IBlockData)4 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)3 IBlockData (net.minecraft.server.v1_8_R3.IBlockData)3 Block (net.minecraft.server.v1_10_R1.Block)2 Block (net.minecraft.server.v1_11_R1.Block)2 BlockPosition (net.minecraft.server.v1_8_R1.BlockPosition)2 IBlockData (net.minecraft.server.v1_8_R1.IBlockData)2 BlockPosition (net.minecraft.server.v1_8_R2.BlockPosition)2 IBlockData (net.minecraft.server.v1_8_R2.IBlockData)2 BlockPosition (net.minecraft.server.v1_9_R1.BlockPosition)2 IBlockData (net.minecraft.server.v1_9_R1.IBlockData)2 BlockPosition (net.minecraft.server.v1_9_R2.BlockPosition)2 CraftWorld (org.bukkit.craftbukkit.v1_10_R1.CraftWorld)2