Search in sources :

Example 1 with TileCeramicBrick

use of binnie.botany.tile.TileCeramicBrick in project Binnie by ForestryMC.

the class BlockCeramicBrick method onBlockPlacedBy.

@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
    TileCeramicBrick ceramic = TileUtil.getTile(worldIn, pos, TileCeramicBrick.class);
    if (ceramic != null) {
        CeramicBrickPair pair = new CeramicBrickPair(stack);
        ceramic.setColors(pair.getColorFirst(), pair.getColorSecond());
    }
}
Also used : CeramicBrickPair(binnie.botany.ceramic.brick.CeramicBrickPair) TileCeramicBrick(binnie.botany.tile.TileCeramicBrick)

Example 2 with TileCeramicBrick

use of binnie.botany.tile.TileCeramicBrick in project Binnie by ForestryMC.

the class BlockCeramicBrick method getWorldKey.

@Override
@SideOnly(Side.CLIENT)
public CeramicBrickPair getWorldKey(IBlockState state) {
    IExtendedBlockState extendedState = (IExtendedBlockState) state;
    IBlockAccess world = extendedState.getValue(UnlistedBlockAccess.BLOCKACCESS);
    BlockPos pos = extendedState.getValue(UnlistedBlockPos.POS);
    TileCeramicBrick ceramic = TileUtil.getTile(world, pos, TileCeramicBrick.class);
    if (ceramic != null) {
        return ceramic.pair();
    }
    return CeramicBrickPair.EMPTY;
}
Also used : IExtendedBlockState(net.minecraftforge.common.property.IExtendedBlockState) TileCeramicBrick(binnie.botany.tile.TileCeramicBrick) IBlockAccess(net.minecraft.world.IBlockAccess) BlockPos(net.minecraft.util.math.BlockPos) UnlistedBlockPos(forestry.core.blocks.properties.UnlistedBlockPos) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

TileCeramicBrick (binnie.botany.tile.TileCeramicBrick)2 CeramicBrickPair (binnie.botany.ceramic.brick.CeramicBrickPair)1 UnlistedBlockPos (forestry.core.blocks.properties.UnlistedBlockPos)1 BlockPos (net.minecraft.util.math.BlockPos)1 IBlockAccess (net.minecraft.world.IBlockAccess)1 IExtendedBlockState (net.minecraftforge.common.property.IExtendedBlockState)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1