Search in sources :

Example 1 with BlockAdvancedBarrelBase

use of com.latmod.yabba.block.BlockAdvancedBarrelBase in project YABBA by LatvianModder.

the class ItemBlockBarrel method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World world, List<String> tooltip, ITooltipFlag flag) {
    if (stack.hasTagCompound() && stack.getTagCompound().hasKey("BlockEntityTag")) {
        TileBarrelBase barrel = (TileBarrelBase) block.createTileEntity(world, block.getDefaultState());
        barrel.readFromNBT(stack.getTagCompound().getCompoundTag("BlockEntityTag"));
        if (block instanceof BlockAdvancedBarrelBase) {
            BarrelLook look = barrel.getLook();
            tooltip.add(ItemHammer.getModelTooltip(look.model));
            tooltip.add(ItemPainter.getSkinTooltip(look.skin));
        }
        barrel.addInformation(tooltip, flag);
    } else if (block instanceof BlockAdvancedBarrelBase) {
        tooltip.add(ItemHammer.getModelTooltip(""));
        tooltip.add(ItemPainter.getSkinTooltip(""));
    }
}
Also used : TileBarrelBase(com.latmod.yabba.tile.TileBarrelBase) BlockAdvancedBarrelBase(com.latmod.yabba.block.BlockAdvancedBarrelBase) BarrelLook(com.latmod.yabba.util.BarrelLook) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with BlockAdvancedBarrelBase

use of com.latmod.yabba.block.BlockAdvancedBarrelBase in project YABBA by LatvianModder.

the class TileAdvancedBarrelBase method getRotationAngleY.

public float getRotationAngleY() {
    if (cachedRotationY == -1F) {
        IBlockState state = getBlockState();
        if (!(state.getBlock() instanceof BlockAdvancedBarrelBase)) {
            return 0F;
        }
        cachedRotationY = state.getValue(BlockHorizontal.FACING).getHorizontalAngle() + 180F;
    }
    return cachedRotationY;
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockAdvancedBarrelBase(com.latmod.yabba.block.BlockAdvancedBarrelBase)

Example 3 with BlockAdvancedBarrelBase

use of com.latmod.yabba.block.BlockAdvancedBarrelBase in project YABBA by LatvianModder.

the class TileAdvancedBarrelBase method getRotationAngleX.

public float getRotationAngleX() {
    if (cachedRotationX == -1F) {
        IBlockState state = getBlockState();
        if (!(state.getBlock() instanceof BlockAdvancedBarrelBase)) {
            return 0F;
        }
        cachedRotationX = state.getValue(BlockAdvancedBarrelBase.ROTATION).ordinal() * 90F;
    }
    return cachedRotationX;
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) BlockAdvancedBarrelBase(com.latmod.yabba.block.BlockAdvancedBarrelBase)

Aggregations

BlockAdvancedBarrelBase (com.latmod.yabba.block.BlockAdvancedBarrelBase)3 IBlockState (net.minecraft.block.state.IBlockState)2 TileBarrelBase (com.latmod.yabba.tile.TileBarrelBase)1 BarrelLook (com.latmod.yabba.util.BarrelLook)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1