Search in sources :

Example 1 with UnsafeList

use of org.bukkit.craftbukkit.v1_8_R1.util.UnsafeList in project MyPet by xXKeyleXx.

the class PlatformHelper method getBlockBBsInBB.

@SuppressWarnings("unchecked")
public List getBlockBBsInBB(World world, AxisAlignedBB axisalignedbb) {
    UnsafeList unsafeList = new UnsafeList();
    int minX = MathHelper.floor(axisalignedbb.a);
    int maxX = MathHelper.floor(axisalignedbb.d + 1.0D);
    int minY = MathHelper.floor(axisalignedbb.b);
    int maxY = MathHelper.floor(axisalignedbb.e + 1.0D);
    int minZ = MathHelper.floor(axisalignedbb.c);
    int maxZ = MathHelper.floor(axisalignedbb.f + 1.0D);
    for (int x = minX; x <= maxX; x++) {
        for (int z = minZ; z <= maxZ; z++) {
            if (world.isChunkLoaded(x >> 4, z >> 4)) {
                for (int y = minY - 1; y <= maxY; y++) {
                    Block block = CraftMagicNumbers.getBlock(world.getBlockAt(x, y, z));
                    if (block != null && block.getMaterial().isSolid()) {
                        block.a(((CraftWorld) world).getHandle(), x, y, z, axisalignedbb, unsafeList, null);
                    }
                }
            }
        }
    }
    return unsafeList;
}
Also used : UnsafeList(org.bukkit.craftbukkit.v1_7_R4.util.UnsafeList)

Example 2 with UnsafeList

use of org.bukkit.craftbukkit.v1_8_R1.util.UnsafeList in project MyPet by xXKeyleXx.

the class PlatformHelper method getBlockBBsInBB.

@SuppressWarnings("unchecked")
public List getBlockBBsInBB(World world, AxisAlignedBB axisalignedbb) {
    UnsafeList unsafeList = new UnsafeList();
    int minX = MathHelper.floor(axisalignedbb.a);
    int maxX = MathHelper.floor(axisalignedbb.d + 1.0D);
    int minY = MathHelper.floor(axisalignedbb.b);
    int maxY = MathHelper.floor(axisalignedbb.e + 1.0D);
    int minZ = MathHelper.floor(axisalignedbb.c);
    int maxZ = MathHelper.floor(axisalignedbb.f + 1.0D);
    for (int x = minX; x <= maxX; x++) {
        for (int z = minZ; z <= maxZ; z++) {
            if (world.isChunkLoaded(x >> 4, z >> 4)) {
                for (int y = minY - 1; y <= maxY; y++) {
                    Block block = CraftMagicNumbers.getBlock(world.getBlockAt(x, y, z));
                    if (block != null && block.getMaterial().isSolid()) {
                        block.a(((CraftWorld) world).getHandle(), new BlockPosition(x, y, z), block.getBlockData(), axisalignedbb, unsafeList, null);
                    }
                }
            }
        }
    }
    return unsafeList;
}
Also used : UnsafeList(org.bukkit.craftbukkit.v1_8_R1.util.UnsafeList)

Example 3 with UnsafeList

use of org.bukkit.craftbukkit.v1_8_R1.util.UnsafeList in project MyPet by xXKeyleXx.

the class PlatformHelper method getBlockBBsInBB.

@SuppressWarnings("unchecked")
public List getBlockBBsInBB(World world, AxisAlignedBB axisalignedbb) {
    UnsafeList unsafeList = new UnsafeList();
    int minX = MathHelper.floor(axisalignedbb.a);
    int maxX = MathHelper.floor(axisalignedbb.d + 1.0D);
    int minY = MathHelper.floor(axisalignedbb.b);
    int maxY = MathHelper.floor(axisalignedbb.e + 1.0D);
    int minZ = MathHelper.floor(axisalignedbb.c);
    int maxZ = MathHelper.floor(axisalignedbb.f + 1.0D);
    for (int x = minX; x <= maxX; x++) {
        for (int z = minZ; z <= maxZ; z++) {
            if (world.isChunkLoaded(x >> 4, z >> 4)) {
                for (int y = minY - 1; y <= maxY; y++) {
                    Block block = CraftMagicNumbers.getBlock(world.getBlockAt(x, y, z));
                    if (block != null && block.getMaterial().isSolid()) {
                        block.a(((CraftWorld) world).getHandle(), new BlockPosition(x, y, z), block.getBlockData(), axisalignedbb, unsafeList, null);
                    }
                }
            }
        }
    }
    return unsafeList;
}
Also used : UnsafeList(org.bukkit.craftbukkit.v1_8_R3.util.UnsafeList)

Example 4 with UnsafeList

use of org.bukkit.craftbukkit.v1_8_R1.util.UnsafeList in project MyPet by xXKeyleXx.

the class PlatformHelper method getBlockBBsInBB.

@SuppressWarnings("unchecked")
public List getBlockBBsInBB(World world, AxisAlignedBB axisalignedbb) {
    UnsafeList unsafeList = new UnsafeList();
    int minX = MathHelper.floor(axisalignedbb.a);
    int maxX = (int) Math.ceil(axisalignedbb.d);
    int minY = MathHelper.floor(axisalignedbb.b);
    int maxY = (int) Math.ceil(axisalignedbb.e);
    int minZ = MathHelper.floor(axisalignedbb.c);
    int maxZ = (int) Math.ceil(axisalignedbb.f);
    for (int x = minX; x <= maxX; x++) {
        for (int z = minZ; z <= maxZ; z++) {
            if (world.isChunkLoaded(x >> 4, z >> 4)) {
                for (int y = minY - 1; y <= maxY; y++) {
                    Block block = CraftMagicNumbers.getBlock(world.getBlockAt(x, y, z));
                    if (block != null && block.getBlockData().getMaterial().isSolid()) {
                        block.a(block.getBlockData(), ((CraftWorld) world).getHandle(), new BlockPosition(x, y, z), axisalignedbb, unsafeList, null);
                    }
                }
            }
        }
    }
    return unsafeList;
}
Also used : UnsafeList(org.bukkit.craftbukkit.v1_9_R2.util.UnsafeList)

Example 5 with UnsafeList

use of org.bukkit.craftbukkit.v1_8_R1.util.UnsafeList in project MyPet by xXKeyleXx.

the class PlatformHelper method getBlockBBsInBB.

@SuppressWarnings("unchecked")
public List getBlockBBsInBB(World world, AxisAlignedBB axisalignedbb) {
    UnsafeList unsafeList = new UnsafeList();
    int minX = MathHelper.floor(axisalignedbb.a);
    int maxX = (int) Math.ceil(axisalignedbb.d);
    int minY = MathHelper.floor(axisalignedbb.b);
    int maxY = (int) Math.ceil(axisalignedbb.e);
    int minZ = MathHelper.floor(axisalignedbb.c);
    int maxZ = (int) Math.ceil(axisalignedbb.f);
    for (int x = minX; x <= maxX; x++) {
        for (int z = minZ; z <= maxZ; z++) {
            if (world.isChunkLoaded(x >> 4, z >> 4)) {
                for (int y = minY - 1; y <= maxY; y++) {
                    Block block = CraftMagicNumbers.getBlock(world.getBlockAt(x, y, z));
                    if (block != null && block.getBlockData().getMaterial().isSolid()) {
                        BlockPosition bp = new BlockPosition(x, y, z);
                        AxisAlignedBB res = block.getBlockData().c(((CraftWorld) world).getHandle(), bp);
                        if (res != null && res != Block.k) {
                            AxisAlignedBB axisalignedbb2 = res.a(bp);
                            if (axisalignedbb.c(axisalignedbb2)) {
                                unsafeList.add(axisalignedbb2);
                            }
                        }
                    }
                }
            }
        }
    }
    return unsafeList;
}
Also used : UnsafeList(org.bukkit.craftbukkit.v1_11_R1.util.UnsafeList)

Aggregations

UnsafeList (org.bukkit.craftbukkit.v1_10_R1.util.UnsafeList)1 UnsafeList (org.bukkit.craftbukkit.v1_11_R1.util.UnsafeList)1 UnsafeList (org.bukkit.craftbukkit.v1_12_R1.util.UnsafeList)1 UnsafeList (org.bukkit.craftbukkit.v1_7_R4.util.UnsafeList)1 UnsafeList (org.bukkit.craftbukkit.v1_8_R1.util.UnsafeList)1 UnsafeList (org.bukkit.craftbukkit.v1_8_R2.util.UnsafeList)1 UnsafeList (org.bukkit.craftbukkit.v1_8_R3.util.UnsafeList)1 UnsafeList (org.bukkit.craftbukkit.v1_9_R1.util.UnsafeList)1 UnsafeList (org.bukkit.craftbukkit.v1_9_R2.util.UnsafeList)1