use of net.minecraft.entity.item.EntityFallingBlock in project Railcraft by Railcraft.
the class CrushedObsidian method tryToFall.
/**
* If there is space to fall below will start this block falling
*/
private void tryToFall(World world, BlockPos pos) {
if (canFallInto(world, pos.down()) && pos.getY() >= 0) {
byte size = 32;
if (!BlockSand.fallInstantly && WorldPlugin.isAreaLoaded(world, pos.add(-size, -size, -size), pos.add(size, size, size))) {
if (!world.isRemote) {
EntityFallingBlock entity = new EntityFallingBlock(world, pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, world.getBlockState(pos));
world.spawnEntity(entity);
}
} else {
WorldPlugin.setBlockToAir(world, pos);
BlockPos blockPos;
for (blockPos = pos.down(); canFallInto(world, blockPos) && blockPos.getY() > 0; blockPos = blockPos.down()) {
// NOOP
}
if (blockPos.getY() > 0)
WorldPlugin.setBlockState(world, blockPos.up(), BlockGeneric.getBlock().getDefaultState().withProperty(BlockGeneric.getBlock().getVariantEnumProperty(), EnumGeneric.CRUSHED_OBSIDIAN));
}
}
}
use of net.minecraft.entity.item.EntityFallingBlock in project BloodMagic by WayofTime.
the class MeleeDefaultEarth method onCenteredWorldEffect.
@Override
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ) {
int radius = this.potencyUpgrades;
for (int i = -radius; i <= radius; i++) {
for (int j = -radius; j <= radius; j++) {
for (int k = -radius; k <= radius; k++) {
if (!world.isAirBlock(posX + i, posY + j, posZ + k) && world.getTileEntity(posX + i, posY + j, posZ + k) == null) {
Block block = world.getBlock(posX + i, posY + j, posZ + k);
if (block.getBlockHardness(world, posX + i, posY + j, posZ + k) == -1) {
continue;
}
int meta = world.getBlockMetadata(posX + i, posY + j, posZ + k);
EntityFallingBlock entity = new EntityFallingBlock(world, posX + i + 0.5f, posY + j + 0.5f, posZ + k + 0.5f, block, meta);
world.spawnEntityInWorld(entity);
}
}
}
}
}
Aggregations