Search in sources :

Example 56 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project SecurityCraft by Geforce132.

the class BlockReinforcedPurpur method getSubBlocks.

/**
 * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
 */
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
    list.add(new ItemStack(this, 1, BlockReinforcedPurpur.EnumType.DEFAULT.getMetadata()));
    list.add(new ItemStack(this, 1, BlockReinforcedPurpur.EnumType.LINES_Y.getMetadata()));
}
Also used : ItemStack(net.minecraft.item.ItemStack) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 57 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project SecurityCraft by Geforce132.

the class BlockReinforcedNewLog method getSubBlocks.

/**
 * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
 */
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
    list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.ACACIA.getMetadata() - 4));
    list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4));
}
Also used : ItemStack(net.minecraft.item.ItemStack) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 58 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project SecurityCraft by Geforce132.

the class BlockReinforcedPurpur method getSubBlocks.

/**
 * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
 */
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
    list.add(new ItemStack(itemIn, 1, BlockReinforcedPurpur.EnumType.DEFAULT.getMetadata()));
    list.add(new ItemStack(itemIn, 1, BlockReinforcedPurpur.EnumType.LINES_Y.getMetadata()));
}
Also used : ItemStack(net.minecraft.item.ItemStack) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 59 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project SecurityCraft by Geforce132.

the class ItemKeycardBase method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, World world, List par3List, ITooltipFlag flagIn) {
    if (level == 3) {
        if (par1ItemStack.getTagCompound() == null) {
            par1ItemStack.setTagCompound(new NBTTagCompound());
            par1ItemStack.getTagCompound().setInteger("Uses", 5);
        }
        par3List.add(ClientUtils.localize("tooltip.keycard.uses") + " " + par1ItemStack.getTagCompound().getInteger("Uses"));
    }
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 60 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project SecurityCraft by Geforce132.

the class ItemBlockReinforcedSlabs2 method canPlaceBlockOnSide.

@Override
@SideOnly(Side.CLIENT)
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) {
    BlockPos blockpos1 = pos;
    IProperty iproperty = singleSlab.getVariantProperty();
    Object object = singleSlab.getVariant(stack);
    IBlockState iblockstate = worldIn.getBlockState(pos);
    if (iblockstate.getBlock() == singleSlab) {
        boolean flag = iblockstate.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP;
        if ((side == EnumFacing.UP && !flag || side == EnumFacing.DOWN && flag) && object == iblockstate.getValue(iproperty))
            return true;
    }
    pos = pos.offset(side);
    IBlockState iblockstate1 = worldIn.getBlockState(pos);
    return iblockstate1.getBlock() == singleSlab && object == iblockstate1.getValue(iproperty) ? true : super.canPlaceBlockOnSide(worldIn, blockpos1, side, player, stack);
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) IProperty(net.minecraft.block.properties.IProperty) BlockPos(net.minecraft.util.BlockPos) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1328 ItemStack (net.minecraft.item.ItemStack)238 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)149 IBlockState (net.minecraft.block.state.IBlockState)140 ResourceLocation (net.minecraft.util.ResourceLocation)139 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)127 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)126 BlockPos (net.minecraft.util.math.BlockPos)85 Block (net.minecraft.block.Block)82 TileEntity (net.minecraft.tileentity.TileEntity)80 EntityPlayer (net.minecraft.entity.player.EntityPlayer)72 Vec3d (net.minecraft.util.math.Vec3d)71 World (net.minecraft.world.World)69 EnumFacing (net.minecraft.util.EnumFacing)64 Minecraft (net.minecraft.client.Minecraft)62 ArrayList (java.util.ArrayList)50 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)42 Nonnull (javax.annotation.Nonnull)41 Entity (net.minecraft.entity.Entity)39 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)39