Search in sources :

Example 61 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, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
    if (level == 3) {
        if (par1ItemStack.getTagCompound() == null) {
            par1ItemStack.setTagCompound(new NBTTagCompound());
            par1ItemStack.getTagCompound().setInteger("Uses", 5);
        }
        par3List.add(StatCollector.translateToLocal("tooltip.keycard.uses") + " " + par1ItemStack.getTagCompound().getInteger("Uses"));
    }
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 62 with SideOnly

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

the class ItemModule method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
    if (nbtCanBeModified || canBeCustomized())
        par3List.add(StatCollector.translateToLocal("tooltip.module.modifiable"));
    else
        par3List.add(StatCollector.translateToLocal("tooltip.module.notModifiable"));
    if (nbtCanBeModified) {
        par3List.add(StatCollector.translateToLocal("tooltip.module.playerCustomization.usage"));
        par3List.add(" ");
        par3List.add(StatCollector.translateToLocal("tooltip.module.playerCustomization.players") + ":");
        if (par1ItemStack.getTagCompound() != null)
            for (int i = 1; i <= 10; i++) if (!par1ItemStack.getTagCompound().getString("Player" + i).isEmpty())
                par3List.add(par1ItemStack.getTagCompound().getString("Player" + i));
    }
    if (canBeCustomized()) {
        if (numberOfItemAddons > 0 && numberOfBlockAddons > 0)
            par3List.add(StatCollector.translateToLocal("tooltip.module.itemAddons.usage.blocksAndItems").replace("#blocks", numberOfBlockAddons + "").replace("#items", numberOfItemAddons + ""));
        if (numberOfItemAddons > 0 && numberOfBlockAddons == 0)
            par3List.add(StatCollector.translateToLocal("tooltip.module.itemAddons.usage.items").replace("#", numberOfItemAddons + ""));
        if (numberOfItemAddons == 0 && numberOfBlockAddons > 0)
            par3List.add(StatCollector.translateToLocal("tooltip.module.itemAddons.usage.blocks").replace("#", numberOfBlockAddons + ""));
        if (getNumberOfAddons() > 0) {
            par3List.add(" ");
            par3List.add(StatCollector.translateToLocal("tooltip.module.itemAddons.added") + ":");
            for (Item item : getItemAddons(par1ItemStack.getTagCompound())) par3List.add("- " + StatCollector.translateToLocal(item.getUnlocalizedName() + ".name"));
            for (Block block : getBlockAddons(par1ItemStack.getTagCompound())) par3List.add("- " + StatCollector.translateToLocal(block.getLocalizedName()));
        }
    }
}
Also used : Item(net.minecraft.item.Item) Block(net.minecraft.block.Block) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 63 with SideOnly

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

the class BlockReinforcedOldLog 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, List list) {
    list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.OAK.getMetadata()));
    list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.SPRUCE.getMetadata()));
    list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.BIRCH.getMetadata()));
    list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()));
}
Also used : ItemStack(net.minecraft.item.ItemStack) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 64 with SideOnly

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

the class BlockReinforcedSlabs2 method getSubBlocks.

@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) {
    BlockReinforcedSlabs2.EnumType[] aenumtype = BlockReinforcedSlabs2.EnumType.values();
    for (int i = 0; i < aenumtype.length; i++) {
        BlockReinforcedSlabs2.EnumType enumtype = aenumtype[i];
        list.add(new ItemStack(itemIn, 1, enumtype.getMetadata()));
    }
}
Also used : ItemStack(net.minecraft.item.ItemStack) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 65 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project Bookshelf by Darkhax-Minecraft.

the class PlayerUtils method sendSpamlessMessage.

/**
     * Sends a spamless message to the chat. A spamless message is one that only shows up in
     * the chat once. If another version of the message were to be added to chat, the earlier
     * one would be removed.
     *
     * @param messageID A unique message ID used to separate your message from the others. It
     *        is highly recommended to use a random number to prevent conflicts with other mods
     *        doing similar things. Each message type should have it's own ID.
     * @param message The message to send to chat, this message will replace earlier messages
     *        in the gui that use the same ID.
     */
@SideOnly(Side.CLIENT)
public static void sendSpamlessMessage(int messageID, ITextComponent message) {
    final GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
    chat.printChatMessageWithOptionalDeletion(message, messageID);
}
Also used : GuiNewChat(net.minecraft.client.gui.GuiNewChat) 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