Search in sources :

Example 1 with IAdvancedDirectionalTile

use of blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IAdvancedDirectionalTile in project Immersive-Tech by FerroO2000.

the class BlockITTileProvider method onIEBlockPlacedBy.

@Override
public void onIEBlockPlacedBy(World world, BlockPos pos, IBlockState state, EnumFacing side, float hitX, float hitY, float hitZ, EntityLivingBase placer, ItemStack stack) {
    TileEntity tile = world.getTileEntity(pos);
    if (tile instanceof IDirectionalTile) {
        EnumFacing f = ((IDirectionalTile) tile).getFacingForPlacement(placer, pos, side, hitX, hitY, hitZ);
        ((IDirectionalTile) tile).setFacing(f);
        if (tile instanceof IAdvancedDirectionalTile)
            ((IAdvancedDirectionalTile) tile).onDirectionalPlacement(side, hitX, hitY, hitZ, placer);
    }
    if (tile instanceof IHasDummyBlocks) {
        ((IHasDummyBlocks) tile).placeDummies(pos, state, side, hitX, hitY, hitZ);
    }
    if (tile instanceof ITileDrop) {
        ((ITileDrop) tile).readOnPlacement(placer, stack);
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) EnumFacing(net.minecraft.util.EnumFacing) ITileDrop(blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.ITileDrop) IHasDummyBlocks(blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IHasDummyBlocks) IDirectionalTile(blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile) IAdvancedDirectionalTile(blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IAdvancedDirectionalTile)

Aggregations

IAdvancedDirectionalTile (blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IAdvancedDirectionalTile)1 IDirectionalTile (blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile)1 IHasDummyBlocks (blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IHasDummyBlocks)1 ITileDrop (blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.ITileDrop)1 TileEntity (net.minecraft.tileentity.TileEntity)1 EnumFacing (net.minecraft.util.EnumFacing)1