Search in sources :

Example 66 with IBlockData

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

the class PlayerNavigation method superF_.

protected void superF_() {
    if (this.c != null) {
        for (int var0 = 0; var0 < this.c.e(); ++var0) {
            PathPoint var1 = this.c.a(var0);
            PathPoint var2 = var0 + 1 < this.c.e() ? this.c.a(var0 + 1) : null;
            IBlockData var3 = this.b.getType(new BlockPosition(var1.a, var1.b, var1.c));
            Block var4 = var3.getBlock();
            if (var4 == Blocks.CAULDRON) {
                this.c.a(var0, var1.a(var1.a, var1.b + 1, var1.c));
                if (var2 != null && var1.b >= var2.b) {
                    this.c.a(var0 + 1, var2.a(var2.a, var1.b + 1, var2.c));
                }
            }
        }
    }
}
Also used : PathPoint(net.minecraft.server.v1_15_R1.PathPoint) IBlockData(net.minecraft.server.v1_15_R1.IBlockData) BlockPosition(net.minecraft.server.v1_15_R1.BlockPosition) Block(net.minecraft.server.v1_15_R1.Block) PathPoint(net.minecraft.server.v1_15_R1.PathPoint)

Example 67 with IBlockData

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

the class PlayerNavigation method superD_.

protected void superD_() {
    if (this.c != null) {
        for (int var0 = 0; var0 < this.c.e(); ++var0) {
            PathPoint var1 = this.c.a(var0);
            PathPoint var2 = var0 + 1 < this.c.e() ? this.c.a(var0 + 1) : null;
            IBlockData var3 = this.b.getType(new BlockPosition(var1.a, var1.b, var1.c));
            Block var4 = var3.getBlock();
            if (var4 == Blocks.CAULDRON) {
                this.c.a(var0, var1.a(var1.a, var1.b + 1, var1.c));
                if (var2 != null && var1.b >= var2.b) {
                    this.c.a(var0 + 1, var2.a(var2.a, var1.b + 1, var2.c));
                }
            }
        }
    }
}
Also used : PathPoint(net.minecraft.server.v1_14_R1.PathPoint) IBlockData(net.minecraft.server.v1_14_R1.IBlockData) BlockPosition(net.minecraft.server.v1_14_R1.BlockPosition) Block(net.minecraft.server.v1_14_R1.Block) PathPoint(net.minecraft.server.v1_14_R1.PathPoint)

Example 68 with IBlockData

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

the class PlayerPathfinderNormal method b.

protected PathType b(IBlockAccess var1, int var2, int var3, int var4) {
    BlockPosition var5 = new BlockPosition(var2, var3, var4);
    IBlockData var6 = var1.getType(var5);
    Block var7 = var6.getBlock();
    Material var8 = var6.getMaterial();
    if (var6.isAir()) {
        return PathType.OPEN;
    } else if (var7 != Blocks.OAK_TRAPDOOR && var7 != Blocks.IRON_TRAPDOOR && var7 != Blocks.LILY_PAD) {
        if (var7 == Blocks.FIRE) {
            return PathType.DAMAGE_FIRE;
        } else if (var7 == Blocks.CACTUS) {
            return PathType.DAMAGE_CACTUS;
        } else if (var7 instanceof BlockDoor && var8 == Material.WOOD && !var6.get(BlockDoor.OPEN).booleanValue()) {
            return PathType.DOOR_WOOD_CLOSED;
        } else if (var7 instanceof BlockDoor && var8 == Material.ORE && !var6.get(BlockDoor.OPEN).booleanValue()) {
            return PathType.DOOR_IRON_CLOSED;
        } else if (var7 instanceof BlockDoor && var6.get(BlockDoor.OPEN).booleanValue()) {
            return PathType.DOOR_OPEN;
        } else if (var7 instanceof BlockMinecartTrackAbstract) {
            return PathType.RAIL;
        } else if (var7 instanceof BlockFence || var7 instanceof BlockCobbleWall || var7 instanceof BlockFenceGate && !var6.get(BlockFenceGate.OPEN).booleanValue()) {
            return PathType.FENCE;
        } else {
            Fluid var9;
            try {
                var9 = var1.getFluid(var5);
            } catch (NoSuchMethodError ex) {
                try {
                    var9 = (Fluid) GET_FLUID.invoke(var1, var5);
                } catch (Throwable ex2) {
                    ex2.printStackTrace();
                    return PathType.BLOCKED;
                }
            }
            if (var9.a(TagsFluid.WATER)) {
                return PathType.WATER;
            } else if (var9.a(TagsFluid.LAVA)) {
                return PathType.LAVA;
            } else {
                return var6.a(var1, var5, PathMode.LAND) ? PathType.OPEN : PathType.BLOCKED;
            }
        }
    } else {
        return PathType.TRAPDOOR;
    }
}
Also used : BlockDoor(net.minecraft.server.v1_13_R2.BlockDoor) IBlockData(net.minecraft.server.v1_13_R2.IBlockData) BlockFenceGate(net.minecraft.server.v1_13_R2.BlockFenceGate) BlockCobbleWall(net.minecraft.server.v1_13_R2.BlockCobbleWall) MutableBlockPosition(net.minecraft.server.v1_13_R2.BlockPosition.MutableBlockPosition) BlockPosition(net.minecraft.server.v1_13_R2.BlockPosition) TagsFluid(net.minecraft.server.v1_13_R2.TagsFluid) Fluid(net.minecraft.server.v1_13_R2.Fluid) Block(net.minecraft.server.v1_13_R2.Block) Material(net.minecraft.server.v1_13_R2.Material) BlockMinecartTrackAbstract(net.minecraft.server.v1_13_R2.BlockMinecartTrackAbstract) BlockFence(net.minecraft.server.v1_13_R2.BlockFence)

Example 69 with IBlockData

use of net.minecraft.server.v1_14_R1.IBlockData in project RoseStacker by Rosewood-Development.

the class StackedSpawnerTileImpl method setSpawnData.

@Override
public void setSpawnData(MobSpawnerData var0) {
    super.setSpawnData(var0);
    if (this.a() != null) {
        IBlockData var1 = this.a().getType(this.b());
        this.a().notify(this.blockPos, var1, var1, 4);
    }
}
Also used : IBlockData(net.minecraft.server.v1_16_R2.IBlockData)

Example 70 with IBlockData

use of net.minecraft.server.v1_14_R1.IBlockData in project RoseStacker by Rosewood-Development.

the class StackedSpawnerTileImpl method setSpawnData.

@Override
public void setSpawnData(MobSpawnerData var0) {
    super.setSpawnData(var0);
    if (this.a() != null) {
        IBlockData var1 = this.a().getType(this.b());
        this.a().notify(this.blockPos, var1, var1, 4);
    }
}
Also used : IBlockData(net.minecraft.server.v1_16_R3.IBlockData)

Aggregations

HashMap (java.util.HashMap)24 ArrayList (java.util.ArrayList)20 Block (org.bukkit.block.Block)19 List (java.util.List)16 IBlockData (net.minecraft.server.v1_16_R3.IBlockData)16 NotNull (org.jetbrains.annotations.NotNull)16 Chunk (org.bukkit.Chunk)15 IBlockData (net.minecraft.server.v1_12_R1.IBlockData)11 IBlockData (net.minecraft.server.v1_14_R1.IBlockData)10 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)9 IBlockData (net.minecraft.server.v1_10_R1.IBlockData)8 BlockPosition (net.minecraft.server.v1_14_R1.BlockPosition)8 IBlockData (net.minecraft.server.v1_15_R1.IBlockData)8 BlockPosition (net.minecraft.server.v1_16_R3.BlockPosition)8 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)7 IBlockData (net.minecraft.server.v1_11_R1.IBlockData)7 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)7 IBlockData (net.minecraft.server.v1_8_R3.IBlockData)7 IdentityHashMap (java.util.IdentityHashMap)6 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)6