use of net.minecraft.block.BlockStaticLiquid in project ImmersiveEngineering by BluSunrize.
the class TileEntityThermoelectricGen method getFluid.
Fluid getFluid(BlockPos pos) {
IBlockState state = worldObj.getBlockState(pos);
Block b = state.getBlock();
Fluid f = FluidRegistry.lookupFluidForBlock(b);
if (f == null && b instanceof BlockDynamicLiquid && b.getMetaFromState(state) == 0)
if (state.getMaterial().equals(Material.WATER))
f = FluidRegistry.WATER;
else if (state.getMaterial().equals(Material.LAVA))
f = FluidRegistry.LAVA;
if (b instanceof IFluidBlock && !((IFluidBlock) b).canDrain(worldObj, pos))
return null;
if (b instanceof BlockStaticLiquid && b.getMetaFromState(state) != 0)
return null;
if (f == null)
return null;
return f;
}
use of net.minecraft.block.BlockStaticLiquid 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