Search in sources :

Example 56 with BlockLiquid

use of net.minecraft.block.BlockLiquid in project Gaia-Dimension by Andromander.

the class GDFluidBlock method mixFluids.

public void mixFluids(World world, BlockPos pos) {
    for (EnumFacing side : EnumFacing.VALUES) {
        if (side != EnumFacing.DOWN) {
            IBlockState offset = world.getBlockState(pos.offset(side));
            if (offset.getMaterial().isLiquid()) {
                if ((offset.getMaterial() == Material.LAVA) && (offset.getBlock() != GDBlocks.superhot_magma_block) && (offset.getBlock() instanceof BlockFluidBase || offset.getBlock() instanceof BlockLiquid)) {
                    world.setBlockState(pos, GDBlocks.gaia_cobblestone.getDefaultState());
                    this.playSound(world, pos);
                    break;
                }
            }
        }
    }
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockLiquid(net.minecraft.block.BlockLiquid) BlockFluidBase(net.minecraftforge.fluids.BlockFluidBase) EnumFacing(net.minecraft.util.EnumFacing)

Example 57 with BlockLiquid

use of net.minecraft.block.BlockLiquid in project Gaia-Dimension by Andromander.

the class GDSuperhotMagma method mixFluids.

@Override
public void mixFluids(World world, BlockPos pos) {
    for (EnumFacing side : EnumFacing.VALUES) {
        if (side != EnumFacing.DOWN) {
            IBlockState offset = world.getBlockState(pos.offset(side));
            if (offset.getMaterial().isLiquid()) {
                if (offset.getBlock() instanceof GDFluidBlock) {
                    if (offset.getBlock() == GDBlocks.mineral_water_block) {
                        world.setBlockState(pos, GDBlocks.gaia_stone.getDefaultState());
                        this.playSound(world, pos);
                        break;
                    }
                    if (offset.getBlock() == GDBlocks.sweet_muck_block) {
                        world.setBlockState(pos, GDBlocks.primal_mass.getDefaultState());
                        this.playSound(world, pos);
                        break;
                    }
                } else if (offset.getBlock() instanceof BlockFluidBase || offset.getBlock() instanceof BlockLiquid) {
                    if (offset.getMaterial() == Material.WATER) {
                        world.setBlockState(pos, GDBlocks.gaia_cobblestone.getDefaultState());
                        this.playSound(world, pos);
                        break;
                    }
                }
            }
        }
    }
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockLiquid(net.minecraft.block.BlockLiquid) BlockFluidBase(net.minecraftforge.fluids.BlockFluidBase) EnumFacing(net.minecraft.util.EnumFacing)

Aggregations

BlockLiquid (net.minecraft.block.BlockLiquid)57 IBlockState (net.minecraft.block.state.IBlockState)44 Block (net.minecraft.block.Block)27 BlockPos (net.minecraft.util.math.BlockPos)22 IFluidBlock (net.minecraftforge.fluids.IFluidBlock)20 Material (net.minecraft.block.material.Material)11 ItemStack (net.minecraft.item.ItemStack)8 EnumFacing (net.minecraft.util.EnumFacing)5 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)5 BlockPos (net.minecraft.util.BlockPos)4 BlockFluidBase (net.minecraftforge.fluids.BlockFluidBase)4 FluidStack (net.minecraftforge.fluids.FluidStack)4 IFluidHandler (net.minecraftforge.fluids.capability.IFluidHandler)4 EntityFlyingBlock (icbm.classic.content.entity.EntityFlyingBlock)3 Entity (net.minecraft.entity.Entity)3 World (net.minecraft.world.World)3 IPlantable (net.minecraftforge.common.IPlantable)3 Location (com.builtbroken.mc.imp.transform.vector.Location)2 ImmutableMap (com.google.common.collect.ImmutableMap)2 ArrayList (java.util.ArrayList)2