Search in sources :

Example 1 with BlockDynamicLiquid

use of net.minecraft.block.BlockDynamicLiquid 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;
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockStaticLiquid(net.minecraft.block.BlockStaticLiquid) Fluid(net.minecraftforge.fluids.Fluid) IFluidBlock(net.minecraftforge.fluids.IFluidBlock) IFluidBlock(net.minecraftforge.fluids.IFluidBlock) Block(net.minecraft.block.Block) BlockDynamicLiquid(net.minecraft.block.BlockDynamicLiquid)

Example 2 with BlockDynamicLiquid

use of net.minecraft.block.BlockDynamicLiquid in project SecurityCraft by Geforce132.

the class BlockFakeWaterBase method updateLiquid.

private void updateLiquid(World worldIn, BlockPos p_176370_2_, IBlockState p_176370_3_) {
    BlockDynamicLiquid blockdynamicliquid = getFlowingBlock(this.blockMaterial);
    worldIn.setBlockState(p_176370_2_, blockdynamicliquid.getDefaultState().withProperty(LEVEL, p_176370_3_.getValue(LEVEL)), 2);
    worldIn.scheduleUpdate(p_176370_2_, blockdynamicliquid, this.tickRate(worldIn));
}
Also used : BlockDynamicLiquid(net.minecraft.block.BlockDynamicLiquid)

Example 3 with BlockDynamicLiquid

use of net.minecraft.block.BlockDynamicLiquid in project SecurityCraft by Geforce132.

the class BlockFakeLavaBase method updateLiquid.

private void updateLiquid(World worldIn, BlockPos p_176370_2_, IBlockState p_176370_3_) {
    BlockDynamicLiquid blockdynamicliquid = getFlowingBlock(this.blockMaterial);
    worldIn.setBlockState(p_176370_2_, blockdynamicliquid.getDefaultState().withProperty(LEVEL, p_176370_3_.getValue(LEVEL)), 2);
    worldIn.scheduleUpdate(p_176370_2_, blockdynamicliquid, this.tickRate(worldIn));
}
Also used : BlockDynamicLiquid(net.minecraft.block.BlockDynamicLiquid)

Aggregations

BlockDynamicLiquid (net.minecraft.block.BlockDynamicLiquid)3 Block (net.minecraft.block.Block)1 BlockStaticLiquid (net.minecraft.block.BlockStaticLiquid)1 IBlockState (net.minecraft.block.state.IBlockState)1 Fluid (net.minecraftforge.fluids.Fluid)1 IFluidBlock (net.minecraftforge.fluids.IFluidBlock)1