use of net.minecraft.block.BlockFlower in project ArsMagica2 by Mithion.
the class Ignition method applyEffectBlock.
@Override
public boolean applyEffectBlock(ItemStack stack, World world, int blockx, int blocky, int blockz, int blockFace, double impactX, double impactY, double impactZ, EntityLivingBase caster) {
switch(blockFace) {
case 5:
blockx++;
break;
case 2:
blockz--;
break;
case 3:
blockz++;
break;
case 4:
blockx--;
break;
}
Block block = world.getBlock(blockx, blocky, blockz);
if (world.isAirBlock(blockx, blocky, blockz) || block == Blocks.snow || block instanceof BlockFlower) {
if (!world.isRemote)
world.setBlock(blockx, blocky, blockz, Blocks.fire);
return true;
} else {
blocky++;
block = world.getBlock(blockx, blocky, blockz);
if (world.isAirBlock(blockx, blocky, blockz) || block == Blocks.snow || block instanceof BlockFlower) {
if (!world.isRemote)
world.setBlock(blockx, blocky, blockz, Blocks.fire);
return true;
}
}
return false;
}
use of net.minecraft.block.BlockFlower in project ArsMagica2 by Mithion.
the class CreateWater method applyEffectBlock.
@Override
public boolean applyEffectBlock(ItemStack stack, World world, int blockx, int blocky, int blockz, int blockFace, double impactX, double impactY, double impactZ, EntityLivingBase caster) {
Block block = world.getBlock(blockx, blocky, blockz);
if (block == Blocks.cauldron) {
world.setBlockMetadataWithNotify(blockx, blocky, blockz, 3, 2);
world.notifyBlockChange(blockx, blocky, blockz, block);
return true;
}
switch(blockFace) {
case 5:
blockx++;
break;
case 2:
blockz--;
break;
case 3:
blockz++;
break;
case 4:
blockx--;
break;
case 0:
blocky--;
break;
case 1:
blocky++;
break;
}
block = world.getBlock(blockx, blocky, blockz);
if (world.isAirBlock(blockx, blocky, blockz) || block == Blocks.snow || block == Blocks.water || block == Blocks.flowing_water || block instanceof BlockFlower) {
world.setBlock(blockx, blocky, blockz, Blocks.water);
Blocks.water.onNeighborBlockChange(world, blockx, blocky, blockz, Blocks.air);
return true;
}
return false;
}
use of net.minecraft.block.BlockFlower in project NewHorizonsCoreMod by GTNewHorizons.
the class OilGeneratorFix method getTopBlock.
private int getTopBlock(World pWorld, int pLocX, int pLocZ) {
Chunk tChunk = pWorld.getChunkFromBlockCoords(pLocX, pLocZ);
int y = tChunk.getTopFilledSegment() + 15;
int trimmedX = pLocX & 0xF;
int trimmedZ = pLocZ & 0xF;
for (; y > 0; y--) {
Block tBlock = tChunk.getBlock(trimmedX, y, trimmedZ);
if (!tBlock.isAir(pWorld, pLocX, y, pLocZ)) {
if ((tBlock instanceof BlockStaticLiquid)) {
return y;
}
if ((tBlock instanceof BlockFluidBase)) {
return y;
}
if ((tBlock instanceof IFluidBlock)) {
return y;
}
if (tBlock.getMaterial().blocksMovement()) {
if (!(tBlock instanceof BlockFlower)) {
return y - 1;
}
}
}
}
return -1;
}
Aggregations