Search in sources :

Example 1 with IMultiBlock

use of micdoodle8.mods.galacticraft.core.tile.IMultiBlock in project Galacticraft by micdoodle8.

the class BlockMachineMars method breakBlock.

@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
    final TileEntity var9 = worldIn.getTileEntity(pos);
    if (var9 instanceof IMultiBlock) {
        ((IMultiBlock) var9).onDestroy(var9);
    }
    super.breakBlock(worldIn, pos, state);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IMultiBlock(micdoodle8.mods.galacticraft.core.tile.IMultiBlock)

Example 2 with IMultiBlock

use of micdoodle8.mods.galacticraft.core.tile.IMultiBlock in project Galacticraft by micdoodle8.

the class BlockSpaceStationBase method breakBlock.

@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
    final TileEntity tileAt = worldIn.getTileEntity(pos);
    if (tileAt instanceof IMultiBlock) {
        ((IMultiBlock) tileAt).onDestroy(tileAt);
    }
    super.breakBlock(worldIn, pos, state);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IMultiBlock(micdoodle8.mods.galacticraft.core.tile.IMultiBlock)

Example 3 with IMultiBlock

use of micdoodle8.mods.galacticraft.core.tile.IMultiBlock in project Galacticraft by micdoodle8.

the class BlockSpaceStationBase method onBlockPlacedBy.

@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
    super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
    TileEntity tile = worldIn.getTileEntity(pos);
    if (tile instanceof IMultiBlock) {
        ((IMultiBlock) tile).onCreate(worldIn, pos);
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IMultiBlock(micdoodle8.mods.galacticraft.core.tile.IMultiBlock)

Example 4 with IMultiBlock

use of micdoodle8.mods.galacticraft.core.tile.IMultiBlock in project Galacticraft by micdoodle8.

the class BlockNasaWorkbench method breakBlock.

@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
    final TileEntity var9 = worldIn.getTileEntity(pos);
    int fakeBlockCount = 0;
    for (int x = -1; x < 2; x++) {
        for (int y = 0; y < 4; y++) {
            for (int z = -1; z < 2; z++) {
                if (!(x == 0 && y == 0 && z == 0)) {
                    if (Math.abs(x) != 1 || Math.abs(z) != 1) {
                        Block block = worldIn.getBlockState(pos.add(x, y, z)).getBlock();
                        if ((y == 0 || y == 3) && x == 0 && z == 0) {
                            if (block == GCBlocks.fakeBlock) {
                                fakeBlockCount++;
                            }
                        } else if (y != 0 && y != 3) {
                            if (block == GCBlocks.fakeBlock) {
                                fakeBlockCount++;
                            }
                        }
                    }
                }
            }
        }
    }
    if (fakeBlockCount >= 11 && var9 instanceof IMultiBlock) {
        ((IMultiBlock) var9).onDestroy(var9);
    }
    super.breakBlock(worldIn, pos, state);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IMultiBlock(micdoodle8.mods.galacticraft.core.tile.IMultiBlock) IPartialSealableBlock(micdoodle8.mods.galacticraft.api.block.IPartialSealableBlock) Block(net.minecraft.block.Block) IMultiBlock(micdoodle8.mods.galacticraft.core.tile.IMultiBlock) EnumSortCategoryBlock(micdoodle8.mods.galacticraft.core.util.EnumSortCategoryBlock)

Example 5 with IMultiBlock

use of micdoodle8.mods.galacticraft.core.tile.IMultiBlock in project MorePlanets by SteveKunG.

the class BlockSpaceWarpPadFull method breakBlock.

@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
    TileEntity tile = world.getTileEntity(pos);
    if (tile instanceof IMultiBlock) {
        ((IMultiBlock) tile).onDestroy(tile);
    }
    super.breakBlock(world, pos, state);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IMultiBlock(micdoodle8.mods.galacticraft.core.tile.IMultiBlock)

Aggregations

TileEntity (net.minecraft.tileentity.TileEntity)12 IMultiBlock (micdoodle8.mods.galacticraft.core.tile.IMultiBlock)11 BlockPos (net.minecraft.util.BlockPos)3 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)2 Block (net.minecraft.block.Block)2 IBlockState (net.minecraft.block.state.IBlockState)2 ItemStack (net.minecraft.item.ItemStack)2 IPartialSealableBlock (micdoodle8.mods.galacticraft.api.block.IPartialSealableBlock)1 BlockMulti (micdoodle8.mods.galacticraft.core.blocks.BlockMulti)1 EntityHangingSchematic (micdoodle8.mods.galacticraft.core.entities.EntityHangingSchematic)1 TileEntityCargoLoader (micdoodle8.mods.galacticraft.core.tile.TileEntityCargoLoader)1 TileEntityCrafting (micdoodle8.mods.galacticraft.core.tile.TileEntityCrafting)1 TileEntityEnergyStorageModule (micdoodle8.mods.galacticraft.core.tile.TileEntityEnergyStorageModule)1 TileEntityFluidTank (micdoodle8.mods.galacticraft.core.tile.TileEntityFluidTank)1 EnumSortCategoryBlock (micdoodle8.mods.galacticraft.core.util.EnumSortCategoryBlock)1 ITileEntityProvider (net.minecraft.block.ITileEntityProvider)1 EntityItem (net.minecraft.entity.item.EntityItem)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 TileEntityBrewingStand (net.minecraft.tileentity.TileEntityBrewingStand)1