Jump to content

Recommended Posts

Posted

How much of my code? I'll just put the @Mod Class file (which contains the sounds).

 

 

package EmeraldsPlus.common;

import java.io.File;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.client.Minecraft;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.inventory.IInventory;

import net.minecraft.item.Item;

import net.minecraft.item.ItemRecord;

import net.minecraft.item.ItemStack;

import net.minecraft.src.BaseMod;

import net.minecraft.src.ModLoader;

import net.minecraft.stats.Achievement;

import net.minecraft.stats.AchievementList;

import net.minecraftforge.client.event.sound.SoundLoadEvent;

import net.minecraftforge.common.AchievementPage;

import net.minecraftforge.common.MinecraftForge;

import EmeraldsPlus.client.ClientProxyEmeraldsPlus;

import cpw.mods.fml.common.FMLCommonHandler;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.Init;

import cpw.mods.fml.common.Mod.PreInit;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.network.NetworkMod;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.minecraftforge.common.Configuration;

import net.minecraftforge.event.ForgeSubscribe;

 

@Mod(modid = "EmeraldsPlus", name = "Emeralds Plus", version = "1.4.7")

@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class mod_EmeraldsPlus

{

    private static final Object emeraldsplus_EventSounds = null;

    @SidedProxy(clientSide = "EmeraldsPlus.client.ClientProxyEmeraldsPlus",

            serverSide = "EmeraldsPlus.common.CommonProxyEmeraldsPlus")

    public static ClientProxyEmeraldsPlus proxy = new ClientProxyEmeraldsPlus();

    public static CreativeTabs customTab = new EmeraldsPlusTab("EmeraldsPlusTab");

   

    //Easter eggs////////////////////////////////////////////////////////////////

    Item GCRecord;

    int GCRecordID = 4000;

    // Achievements

    public static AchievementPage Page1 = new AchievementPage("EmeraldsPlus");

    // God Stuff/////////////////////////////////////////////////////////////////

    Item GodSword;

    int GodSwordID = 2200;

    public static Item GodGem;

    public static int GodGemID = 2202;

    Item GodGemPiece;

    int GodGemPieceID = 2201;

    // Magic Items//////////////////////////////////////////////

    Item MagicPile;

    int MagicPileID = 2300;

    Item MagicDust;

    int MagicDustID = 2301;

    Item WaterSummoner;

    int WaterSummonerID = 2302;

    Item LavaSummoner;

    int LavaSummonerID = 2303;

    //Blocks/////////////////////////////////////////////////////////////////////

    Block RubyBlock;

    int RubyBlockID = 160;

    Block FlameBlock;

    int FlameBlockID = 164;

    Block WeakIronBlock;

    int WeakIronBlockID = 168;

    // Ores////////////////////////////////////////////////////////////////////////

    public static Block ChipOre;

    int ChipOreID = 161;

    public static Block RubyOre;

    int RubyOreID = 162;

    public static Block GodOre;

    int GodOreID = 200;

    // Misc.//////////////////////////////////////////////////////////////////////////

    public static Item Chisel;

    int ChiselID = 2101;

    public static Item Hammer;

    int HammerID = 2140;

    Item DiamondShard;

    int DiamondShardID = 2141;

    Item DiamondStick;

    int DiamondStickID = 2142;

    // Emerald Stuff

    public static Item EmeraldChip;

    public static int EmeraldChipID = 2104;

    public static Item EmeraldPick;

    int EmeraldPickID = 2102;

    Item EmeraldAxe;

    int EmeraldAxeID = 2105;

    Item EmeraldSpade;

    int EmeraldSpadeID = 2107;

    Item EmeraldSword;

    int EmeraldSwordID = 2103;

    Item EmeraldHoe;

    int EmeraldHoeID = 2106;

    Item EmeraldHandlePiece;

    int EmeraldHandlePieceID = 2304;

    Item EmeraldHandle;

    int EmeraldHandleID = 2305;

    // Ruby Stuff////////////////////////////////////////////////////////////////

    public static Item Ruby;

    public static int RubyID = 2123;

    Item RubyPick;

    int RubyPickID = 2124;

    Item RubyAxe;

    int RubyAxeID = 2127;

    Item RubySpade;

    int RubySpadeID = 2126;

    Item RubySword;

    int RubySwordID = 2125;

    Item RubyHoe;

    int RubyHoeID = 2128;

    static Block RubyLamp;

    //Chain Stuff///////////////////////////////////////////////////////////////

    Item ironShard;

    int ironShardID = 2139;

    Item Chain;

    int ChainID = 2138;

    // Flame Stuff//////////////////////////////////////////////////////////////

    static Item FlameGem;

    int FlameGemID = 2130;

    static Item FlameSword;

    int FlameSwordID = 2132;

    static Item FlamePick;

    int FlamePickID = 2133;

    static Item FlamePickSword;

    int FlamePickSwordID = 2137;

    //Carrot Stuff////////////////////////////////////////////////////////

    public static Block CarrotCake;

    int CarrotCakeID = 167;

    Item CarrotPlacer;

    int CarrotPlacerID = 2135;

    // Upgraded Iron Stuff/////////////////////////////////////////////////////////////////

    Item UpgradedIronPick;

    int UpgradedIronPickID = 2120;

    Item UpgradedIronSword;

    int UpgradedIronSwordID = 2122;

    Item UpgradedIronAxe;

    int UpgradedIronAxeID = 2118;

    Item UpgradedIronHoe;

    int UpgradedIronHoeID = 2119;

    Item UpgradedIronSpade;

    int UpgradedIronSpadeID = 2121;

    // Upgraded Gold Stuff///////////////////////////////////////////////////////////////////

    Item UpgradedGoldPick;

    int UpgradedGoldPickID = 2115;

    Item UpgradedGoldSword;

    int UpgradedGoldSwordID = 2117;

    Item UpgradedGoldAxe;

    int UpgradedGoldAxeID = 2113;

    Item UpgradedGoldHoe;

    int UpgradedGoldHoeID = 2114;

    Item UpgradedGoldSpade;

    int UpgradedGoldSpadeID = 2116;

    // Upgraded Diamond Stuff/////////////////////////////////////////////////////////////////

    Item UpgradedDiamondPick;

    int UpgradedDiamondPickID = 2109;

    Item UpgradedDiamondSword;

    int UpgradedDiamondSwordID = 2111;

    Item UpgradedDiamondAxe;

    int UpgradedDiamondAxeID = 2112;

    Item UpgradedDiamondHoe;

    int UpgradedDiamondHoeID = 2108;

    Item UpgradedDiamondSpade;

    int UpgradedDiamondSpadeID = 2110;

    public void onCrafting(EntityPlayer player, ItemStack item, IInventory inv)

    {

        for (int i = 0; i < inv.getSizeInventory(); i++)

        {

            if (inv.getStackInSlot(i) != null)

            {

                ItemStack j = inv.getStackInSlot(i);

 

                if (j.getItem() != null && j.getItem() == Chisel)

                {

                    if (j.getItemDamage() < j.getMaxDamage())

                    {

                        ItemStack k = new ItemStack(Chisel, 2, (j.getItemDamage() + 1));

                        inv.setInventorySlotContents(i, k);

                    }

                }

            }

        }

    }

    @SideOnly(Side.CLIENT)

    @ForgeSubscribe

    public void onSoundLoad(SoundLoadEvent event) {

            Minecraft mc = Minecraft.getMinecraft();

            event.manager.soundPoolSounds.addSound("streaming/Departure.ogg",

            new File(mc.mcDataDir, "resources/streaming/Departure.ogg"));

    }

    @PreInit

    public void preInit(FMLPreInitializationEvent event)

    {

        // you will be able to find the config file in .minecraft/config/ and it will be named Dummy.cfg

        // here our Configuration has been instantiated, and saved under the name "config"

        Configuration config = new Configuration(event.getSuggestedConfigurationFile());

        // loading the configuration from its file

        config.load();

        // saving the configuration to its file

        config.save();

    }

    @Init

    public void load(FMLInitializationEvent event)

    {

        AchievementPage.registerAchievementPage(Page1);

        LanguageRegistry.instance().addStringLocalization("itemGroup.EmeraldsPlusTab", "en_US", "EmeraldsPlus");

        gameRegisters();

        languageRegisters();

        craftingRecipes();

        load();

        // God Stuff////////////////////////////////////////////////////////////////////////////////////////////////////////

        GodSword = new ItemGodSword(GodSwordID, EnumModToolMaterialE.GOD).setItemName("God Sword").setIconIndex(24).setCreativeTab(mod_EmeraldsPlus.customTab);

        GameRegistry.registerItem(GodSword, "God Sword");

        LanguageRegistry.addName(GodSword, "God Sword");

        GodGem = new ItemGodItems(GodGemID).setItemName("God Gem").setIconIndex(25).setCreativeTab(mod_EmeraldsPlus.customTab);

        GameRegistry.registerItem(GodGem, "God Gem");

        LanguageRegistry.addName(GodGem, "God Gem");

        GodGemPiece = new ItemGodItems(GodGemPieceID).setItemName("Piece of God Gem").setIconIndex(26).setCreativeTab(mod_EmeraldsPlus.customTab);

        GameRegistry.registerItem(GodGemPiece, "Piece of God Gem");

        LanguageRegistry.addName(GodGemPiece, "Piece of God Gem");

        // Magic Stuff///////////////////////////////////////////////////////////////////////////////////////////////////////////

        MagicPile = new ItemGodItems(MagicPileID).setItemName("Pile of MagicDust").setIconIndex(44).setCreativeTab(mod_EmeraldsPlus.customTab);

        GameRegistry.registerItem(MagicPile, "Pile of MagicDust");

        LanguageRegistry.addName(MagicPile, "Pile of MagicDust");

        MagicDust = new ItemGodItems(MagicDustID).setItemName("MagicDust").setIconIndex(45).setCreativeTab(this.customTab);

        GameRegistry.registerItem(MagicDust, "MagicDust");

        LanguageRegistry.addName(MagicDust, "MagicDust");

        WaterSummoner = new ItemWaterSummoner(WaterSummonerID).setItemName("Water Summoner").setIconIndex(46).setCreativeTab(mod_EmeraldsPlus.customTab);

        GameRegistry.registerItem(WaterSummoner, "Water Summoner");

        LanguageRegistry.addName(WaterSummoner, "Water Summoner");

        LavaSummoner = new ItemLavaSummoner(LavaSummonerID).setItemName("Lava Summoner").setIconIndex(47).setCreativeTab(mod_EmeraldsPlus.customTab);

        GameRegistry.registerItem(LavaSummoner, "Lava Summoner");

        LanguageRegistry.addName(LavaSummoner, "Lava Summoner");

        // Blocks//////////////////////////////////////////////////////////////////

        RubyBlock = new BlockRuby(RubyBlockID, 250, Material.iron).setBlockName("Block of Ruby").setStepSound(Block.soundMetalFootstep).setHardness(5F).setResistance(6.0F).setCreativeTab(this.customTab);

        GameRegistry.registerBlock(RubyBlock, "Block of Ruby");

        LanguageRegistry.addName(RubyBlock, "Block of Ruby");

        MinecraftForge.setBlockHarvestLevel(RubyBlock, "pickaxe", 2);

        FlameBlock = new BlockFlame(FlameBlockID, 248, Material.iron).setHardness(5F).setResistance(6.0F).setStepSound(Block.soundStoneFootstep).setBlockName("Block of Flames").setLightValue(0.4F).setCreativeTab(this.customTab);

        GameRegistry.registerBlock(FlameBlock, "Block of Flames");

        LanguageRegistry.addName(FlameBlock, "Block of Flames");

        MinecraftForge.setBlockHarvestLevel(FlameBlock, "pickaxe", 2);

        WeakIronBlock = new BlockWeakIron(WeakIronBlockID, 249, Material.rock).setHardness(3.5F).setResistance(7.5F).setStepSound(Block.soundMetalFootstep).setBlockName("Weak Block of Iron").setCreativeTab(this.customTab);

        GameRegistry.registerBlock(WeakIronBlock, "Weak Block of Iron");

        LanguageRegistry.addName(WeakIronBlock, "Weak Block of Iron");

        MinecraftForge.setBlockHarvestLevel(WeakIronBlock, "pickaxe", 1);

        // Ores////////////////////////////////////////////////////

        ChipOre = new BlockChipOre(ChipOreID, 252, Material.iron).setHardness(4F).setResistance(6.0F).setStepSound(Block.soundStoneFootstep).setBlockName("Chipped Emerale Ore").setCreativeTab(this.customTab);

        GameRegistry.registerBlock(ChipOre, "ChipOre");

        LanguageRegistry.addName(ChipOre, "Emerald Chip Ore");

        MinecraftForge.setBlockHarvestLevel(ChipOre, "pickaxe", 2);

        RubyOre = new BlockRubyOre(RubyOreID, 251, Material.iron).setHardness(4F).setResistance(6.0F).setStepSound(Block.soundStoneFootstep).setBlockName("Ruby Ore").setCreativeTab(this.customTab);

        GameRegistry.registerBlock(RubyOre, "Ruby Ore");

        LanguageRegistry.addName(RubyOre, "Ruby Ore");

        MinecraftForge.setBlockHarvestLevel(RubyOre, "pickaxe", 2);

        GodOre = new BlockGodOre(GodOreID, 245, Material.iron).setHardness(6F).setResistance(8.0F).setStepSound(Block.soundStoneFootstep).setBlockName("God Ore").setCreativeTab(this.customTab);

        GameRegistry.registerBlock(GodOre, "God Ore");

        LanguageRegistry.addName(GodOre, "God Ore");

        MinecraftForge.setBlockHarvestLevel(GodOre, "pickaxe", 3);

        // Mist./////////////////////////////////////////////////////////

        Chisel = new ItemChisel(ChiselID).setItemName("Chisel").setIconIndex(0).setCreativeTab(this.customTab);

        GameRegistry.registerItem(Chisel, "Chisel");

        LanguageRegistry.addName(Chisel, "Chisel");

        GameRegistry.addRecipe(new ItemStack(Chisel, 0), new Object[]

                {

                    "I", "S",

                    'I', Item.ingotIron, 'S', Item.stick

                });

        Hammer = new ItemEmeraldChip(HammerID).setItemName("Hammer").setIconIndex(43).setCreativeTab(this.customTab);

        GameRegistry.registerItem(Hammer, "Hammer");

        LanguageRegistry.addName(Hammer, "Hammer");

        GameRegistry.addRecipe(new ItemStack(Hammer, 10), new Object[]

                {

                    "II ", " S ",

                    'I', Item.diamond, 'S', Item.stick

                });

        // Emerald Stuff////////////////////////////////////////////////

        EmeraldChip = new ItemEmeraldChip(EmeraldChipID).setItemName("Emerald Chip").setIconIndex(10).setCreativeTab(this.customTab);

        GameRegistry.registerItem(EmeraldChip, "Emerald Chip");

        LanguageRegistry.addName(EmeraldChip, "Emerald Chip");

        GameRegistry.addShapelessRecipe(new ItemStack(EmeraldChip, 04), new Object[]

                {

                    new ItemStack(Chisel, 1, -1), Item.emerald

                });

        GameRegistry.addRecipe(new ItemStack(Item.emerald, 01), new Object[]

                {

                    "EE", "EE",

                    'E', EmeraldChip

                });

        EmeraldPick = new ItemModPickaxeE(EmeraldPickID, EnumModToolMaterialE.EMERALD2).setIconIndex(1).setItemName("Emerald Pickaxe").setCreativeTab(this.customTab);

        GameRegistry.registerItem(EmeraldPick, "Emerald Pickaxe");

        LanguageRegistry.addName(EmeraldPick, "Emerald Pickaxe");

        GameRegistry.addRecipe(new ItemStack(EmeraldPick, 01), new Object[]

                {

                    "EEE", " S ", " S ",

                    'E', Item.emerald, 'S', Item.stick

                });

        EmeraldAxe = new ItemModAxeE(EmeraldAxeID, EnumModToolMaterialE.EMERALD2).setIconIndex(4).setItemName("Emerald Axe").setCreativeTab(this.customTab);

        GameRegistry.registerItem(EmeraldAxe, "Emerald Axe");

        LanguageRegistry.addName(EmeraldAxe, "Emerald Axe");

        GameRegistry.addRecipe(new ItemStack(EmeraldAxe, 01), new Object[]

                {

                    "EE ", "ES ", " S ",

                    'E', Item.emerald, 'S', Item.stick

                });

        EmeraldSpade = new ItemModSpadeE(EmeraldSpadeID, EnumModToolMaterialE.EMERALD2).setIconIndex(3).setItemName("Emerald Spade").setCreativeTab(this.customTab);

        GameRegistry.registerItem(EmeraldSpade, "Emerald Spade");

        LanguageRegistry.addName(EmeraldSpade, "Emerald Spade");

        GameRegistry.addRecipe(new ItemStack(EmeraldSpade, 01), new Object[]

                {

                    " E ", " S ", " S ",

                    'E', Item.emerald, 'S', Item.stick

                });

        EmeraldSword = new ItemModSwordE(EmeraldSwordID, EnumModToolMaterialE.EMERALD2).setIconIndex(2).setItemName("Emerald Sword").setCreativeTab(this.customTab);

        GameRegistry.registerItem(EmeraldSword, "Emerald Sword");

        LanguageRegistry.addName(EmeraldSword, "Emerald Sword");

        GameRegistry.addRecipe(new ItemStack(EmeraldSword, 01), new Object[]

                {

                    " E ", " S ", " S ",

                    'E', Item.emerald, 'S', Item.stick

                });

        EmeraldHoe = new ItemModHoeE(EmeraldHoeID, EnumModToolMaterialE.EMERALD2).setIconIndex(5).setItemName("Emerald Hoe").setCreativeTab(this.customTab);

        GameRegistry.registerItem(EmeraldHoe, "Emerald Hoe");

        LanguageRegistry.addName(EmeraldHoe, "Emerald Hoe");

        GameRegistry.addRecipe(new ItemStack(EmeraldHoe, 01), new Object[]

                {

                    "EE ", " S ", " S ",

                    'E', Item.emerald, 'S', Item.stick

                });

        EmeraldHandlePiece = new ItemEmeraldChip(EmeraldHandlePieceID).setItemName("Emerald Strip").setIconIndex(48).setCreativeTab(this.customTab);

        GameRegistry.registerItem(EmeraldHandlePiece, "Emerald Strip");

        LanguageRegistry.addName(EmeraldHandlePiece, "Emerald Strip");

        GameRegistry.addShapelessRecipe(new ItemStack(EmeraldHandlePiece, 01), new Object[]

                {

                    Hammer, EmeraldChip

                });

        EmeraldHandle = new ItemEmeraldChip(EmeraldHandleID).setItemName("Emerald Stick").setIconIndex(49).setCreativeTab(this.customTab);

        GameRegistry.registerItem(EmeraldHandle, "Emerald Stick");

        LanguageRegistry.addName(EmeraldHandle, "Emerald Stick");

        GameRegistry.addRecipe(new ItemStack(EmeraldHandle, 01), new Object[]

                {

                    "E", "E",

                    'E', EmeraldHandlePiece

                });

        // Ruby Stuff////////////////////////////////////////////////////

        Ruby = new ItemEmeraldChip(RubyID).setItemName("Ruby").setIconIndex(11).setCreativeTab(this.customTab);

        GameRegistry.registerItem(Ruby, "Ruby");

        LanguageRegistry.addName(Ruby, "Ruby");

        RubyPick = new ItemModPickaxeE(RubyPickID, EnumModToolMaterialE.EMERALD2).setItemName("Ruby Pickaxe").setIconIndex(12).setCreativeTab(this.customTab);

        GameRegistry.registerItem(RubyPick, "Ruby Pickaxe");

        LanguageRegistry.addName(RubyPick, "Ruby Pickaxe");

        GameRegistry.addRecipe(new ItemStack(RubyPick, 01), new Object[]

                {

                    "RRR", " S ", " S ",

                    'R', Ruby, 'S', Item.stick

                });

        RubyAxe = new ItemModAxeE(RubyAxeID, EnumModToolMaterialE.RUBY).setItemName("Ruby Axe").setIconIndex(15).setCreativeTab(this.customTab);

        GameRegistry.registerItem(RubyAxe, "Ruby Axe");

        LanguageRegistry.addName(RubyAxe, "Ruby Axe");

        GameRegistry.addRecipe(new ItemStack(RubyAxe, 01), new Object[]

                {

                    "RR ", "RS ", " S ",

                    'R', Ruby, 'S', Item.stick

                });

        RubySword = new ItemModSwordE(RubySwordID, EnumModToolMaterialE.RUBY).setItemName("Ruby Sword").setIconIndex(13).setCreativeTab(this.customTab);

        GameRegistry.registerItem(RubySword, "Ruby Sword");

        LanguageRegistry.addName(RubySword, "Ruby Sword");

        GameRegistry.addRecipe(new ItemStack(RubySword, 01), new Object[]

                {

                    " R ", " R ", " S ",

                    'R', Ruby, 'S', Item.stick

                });

        RubySpade = new ItemModSpadeE(RubySpadeID, EnumModToolMaterialE.RUBY).setItemName("Ruby Shovel").setIconIndex(14).setCreativeTab(this.customTab);

        GameRegistry.registerItem(RubySpade, "Ruby Shovel");

        LanguageRegistry.addName(RubySpade, "Ruby Shovel");

        GameRegistry.addRecipe(new ItemStack(RubySpade, 01), new Object[]

                {

                    " R ", " S ", " S ",

                    'R', Ruby, 'S', Item.stick

                });

        RubyHoe = new ItemModHoeE(RubyHoeID, EnumModToolMaterialE.RUBY).setItemName("Ruby Hoe").setIconIndex(16).setCreativeTab(this.customTab);

        GameRegistry.registerItem(RubyHoe, "Ruby Hoe");

        LanguageRegistry.addName(RubyHoe, "Ruby Hoe");

        GameRegistry.addRecipe(new ItemStack(RubyHoe, 01), new Object[]

                {

                    "RR ", " S ", " S ",

                    'R', Ruby, 'S', Item.stick

                });

        // Flame Stuff///////////////////////////////////////////////////////////////

        FlameGem = new ItemFlameGem(FlameGemID).setItemName("Flame Gem").setIconIndex(20).setCreativeTab(this.customTab);

        GameRegistry.registerItem(FlameGem, "Flame Gem");

        LanguageRegistry.addName(FlameGem, "Flame Gem");

        GameRegistry.addRecipe(new ItemStack(FlameGem, 01), new Object[]

                {

                    "*F*", "FRF", "*F*",

                    'F', Item.blazePowder, 'R', Ruby, '*', Item.blazeRod

                });

        FlameSword = new ItemFlameSword(FlameSwordID, EnumModToolMaterialE.FLAME).setItemName("Flame Sword").setIconIndex(22).setCreativeTab(this.customTab);

        GameRegistry.registerItem(FlameSword, "Flame Sword");

        LanguageRegistry.addName(FlameSword, "Flame Sword");

        GameRegistry.addRecipe(new ItemStack(FlameSword, 01), new Object[]

                {

                    " F ", " F ", " B ",

                    'F', FlameGem, 'B', Item.blazeRod

                });

        FlamePick = new ItemFlamePickaxe(FlamePickID, EnumModToolMaterialE.FLAME).setItemName("Flame Pickaxe").setIconIndex(21).setCreativeTab(this.customTab);

        GameRegistry.registerItem(FlamePick, "Flame Pickaxe");

        LanguageRegistry.addName(FlamePick, "Flame Pickaxe");

        GameRegistry.addRecipe(new ItemStack(FlamePick, 01), new Object[]

                {

                    "FFF", " B ", " B ",

                    'F', FlameGem, 'B', Item.blazeRod

                });

        FlamePickSword = new ItemFlamePickSword(FlamePickSwordID, EnumModToolMaterialE.FLAME2).setItemName("Flame PickSword").setIconIndex(23).setCreativeTab(this.customTab);

        GameRegistry.registerItem(FlamePickSword, "Flame PickSword");

        LanguageRegistry.addName(FlamePickSword, "Flame PickSword");

        GameRegistry.addRecipe(new ItemStack(FlamePickSword, 01), new Object[]

                {

                    " F ", "BPB", " S ",

                    'F', FlameGem, 'B', Item.blazeRod, 'P', FlamePick, 'S', FlameSword

                });

        // Upgraded Iron Stuff//////////////////////////////////////////////////////////////////////////////////////////////

        UpgradedIronPick = new ItemModPickaxeE(UpgradedIronPickID, EnumModToolMaterialE.IRON2).setItemName("Upgraded Iron Pickaxe").setIconIndex(28).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedIronPick, "Upgraded Iron Pickaxe");

        LanguageRegistry.addName(UpgradedIronPick, "Upgraded Iron Pickaxe");

        GameRegistry.addRecipe(new ItemStack(UpgradedIronPick, 01), new Object[]

                {

                    "CPC",

                    'C', EmeraldChip, 'P', Item.pickaxeSteel

                });

        UpgradedIronSword = new ItemModSwordE(UpgradedIronSwordID, EnumModToolMaterialE.IRON2).setItemName("Upgraded Iron Sword").setIconIndex(29).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedIronSword, "Upgraded Iron Sword");

        LanguageRegistry.addName(UpgradedIronSword, "Upgraded Iron Sword");

        GameRegistry.addRecipe(new ItemStack(UpgradedIronSword, 01), new Object[]

                {

                    "C", "S",

                    'C', EmeraldChip, 'S', Item.swordSteel

                });

        UpgradedIronSpade = new ItemModSpadeE(UpgradedIronSpadeID, EnumModToolMaterialE.IRON2).setItemName("Upgraded Iron Shovel").setIconIndex(30).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedIronSpade, "Upgraded Iron Shovel");

        LanguageRegistry.addName(UpgradedIronSpade, "Upgraded Iron Shovel");

        GameRegistry.addRecipe(new ItemStack(UpgradedIronSpade, 01), new Object[]

                {

                    "C", "S",

                    'C', EmeraldChip, 'S', Item.shovelSteel

                });

        UpgradedIronAxe = new ItemModAxeE(UpgradedIronAxeID, EnumModToolMaterialE.IRON2).setItemName("Upgraded Iron Axe").setIconIndex(31).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedIronAxe, "Upgraded Iron Axe");

        LanguageRegistry.addName(UpgradedIronAxe, "Upgraded Iron Axe");

        GameRegistry.addRecipe(new ItemStack(UpgradedIronAxe, 01), new Object[]

                {

                    "CA",

                    'C', EmeraldChip, 'A', Item.axeSteel

                });

        UpgradedIronHoe = new ItemModHoeE(UpgradedIronHoeID, EnumModToolMaterialE.IRON2).setItemName("Upgraded Iron Hoe").setIconIndex(32).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedIronHoe, "Upgraded Iron Hoe");

        LanguageRegistry.addName(UpgradedIronHoe, "Upgraded Iron Hoe");

        GameRegistry.addRecipe(new ItemStack(UpgradedIronHoe, 01), new Object[]

                {

                    "CH",

                    'C', EmeraldChip, 'H', Item.hoeSteel

                });

        // Upgraded Gold Stuff//////////////////////////////////////////////////////////////////////////////////////////////

        UpgradedGoldPick = new ItemModPickaxeE(UpgradedGoldPickID, EnumModToolMaterialE.GOLD2).setItemName("Upgraded Gold Pickaxe").setIconIndex(33).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedGoldPick, "Upgraded Gold Pickaxe");

        LanguageRegistry.addName(UpgradedGoldPick, "Upgraded Gold Pickaxe");

        GameRegistry.addRecipe(new ItemStack(UpgradedGoldPick, 01), new Object[]

                {

                    "CPC",

                    'C', EmeraldChip, 'P', Item.pickaxeGold

                });

        UpgradedGoldSword = new ItemModSwordE(UpgradedGoldSwordID, EnumModToolMaterialE.GOLD2).setItemName("Upgraded Gold Sword").setIconIndex(34).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedGoldSword, "Upgraded Gold Sword");

        LanguageRegistry.addName(UpgradedGoldSword, "Upgraded Gold Sword");

        GameRegistry.addRecipe(new ItemStack(UpgradedGoldSword, 01), new Object[]

                {

                    "C", "S",

                    'C', EmeraldChip, 'S', Item.swordGold

                });

        UpgradedGoldSpade = new ItemModSpadeE(UpgradedGoldSpadeID, EnumModToolMaterialE.GOLD2).setItemName("Upgraded Gold Shovel").setIconIndex(35).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedGoldSpade, "Upgraded Gold Shovel");

        LanguageRegistry.addName(UpgradedGoldSpade, "Upgraded Gold Spade");

        GameRegistry.addRecipe(new ItemStack(UpgradedGoldSpade, 01), new Object[]

                {

                    "C", "S",

                    'C', EmeraldChip, 'S', Item.shovelGold

                });

        UpgradedGoldAxe = new ItemModAxeE(UpgradedGoldAxeID, EnumModToolMaterialE.GOLD2).setItemName("Upgraded Gold Axe").setIconIndex(36).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedGoldAxe, "Upgraded Gold Axe");

        LanguageRegistry.addName(UpgradedGoldAxe, "Upgraded Gold Axe");

        GameRegistry.addRecipe(new ItemStack(UpgradedGoldAxe, 01), new Object[]

                {

                    "CA",

                    'C', EmeraldChip, 'A', Item.axeGold

                });

        UpgradedGoldHoe = new ItemModHoeE(UpgradedGoldHoeID, EnumModToolMaterialE.GOLD2).setItemName("Upgraded Gold Hoe").setIconIndex(37).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedGoldHoe, "Upgraded Gold Hoe");

        LanguageRegistry.addName(UpgradedGoldHoe, "Upgraded Gold Hoe");

        GameRegistry.addRecipe(new ItemStack(UpgradedGoldHoe, 01), new Object[]

                {

                    "CA",

                    'C', EmeraldChip, 'A', Item.hoeGold

                });

        // Upgraded Diamond Stuff///////////////////////////////////////////////////////////////////////////////////////////

        UpgradedDiamondPick = new ItemModPickaxeE(UpgradedDiamondPickID, EnumModToolMaterialE.DIAMOND2).setItemName("Upgraded Diamond Pickaxe").setIconIndex(38).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedDiamondPick, "Upgraded Diamond Pickaxe");

        LanguageRegistry.addName(UpgradedDiamondPick, "Upgraded Diamond Pickaxe");

        GameRegistry.addRecipe(new ItemStack(UpgradedDiamondPick, 01), new Object[]

                {

                    "CPC",

                    'C', EmeraldChip, 'P', Item.pickaxeDiamond

                });

        UpgradedDiamondSword = new ItemModSwordE(UpgradedDiamondSwordID, EnumModToolMaterialE.DIAMOND2).setItemName("Upgraded Diamond Sword").setIconIndex(39).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedDiamondSword, "Upgraded Diamond Sword");

        LanguageRegistry.addName(UpgradedDiamondSword, "Upgraded Diamond Sword");

        GameRegistry.addRecipe(new ItemStack(UpgradedDiamondSword, 01), new Object[]

                {

                    "C", "S",

                    'C', EmeraldChip, 'S', Item.swordDiamond

                });

        UpgradedDiamondSpade = new ItemModSpadeE(UpgradedDiamondSpadeID, EnumModToolMaterialE.DIAMOND2).setItemName("Upgraded Diamond Spade").setIconIndex(40).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedDiamondSpade, "Upgraded Diamond Spade");

        LanguageRegistry.addName(UpgradedDiamondSpade, "Upgraded Diamond Spade");

        GameRegistry.addRecipe(new ItemStack(UpgradedDiamondSpade, 01), new Object[]

                {

                    "C", "S",

                    'C', EmeraldChip, 'S', Item.shovelDiamond

                });

        UpgradedDiamondAxe = new ItemModAxeE(UpgradedDiamondAxeID, EnumModToolMaterialE.DIAMOND2).setItemName("Upgraded Diamond Axe").setIconIndex(41).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedDiamondAxe, "Upgraded Diamond Axe");

        LanguageRegistry.addName(UpgradedDiamondAxe, "Upgraded Diamond Axe");

        GameRegistry.addRecipe(new ItemStack(UpgradedDiamondAxe, 01), new Object[]

                {

                    "CA",

                    'C', EmeraldChip, 'A', Item.axeDiamond

                });

        UpgradedDiamondHoe = new ItemModHoeE(UpgradedDiamondHoeID, EnumModToolMaterialE.DIAMOND2).setItemName("Upgraded Diamond Hoe").setIconIndex(42).setCreativeTab(this.customTab);

        GameRegistry.registerItem(UpgradedDiamondHoe, "Upgraded Diamond Hoe");

        LanguageRegistry.addName(UpgradedDiamondHoe, "Upgraded Diamond Hoe");

        GameRegistry.addRecipe(new ItemStack(UpgradedDiamondHoe, 01), new Object[]

                {

                    "CH",

                    'C', EmeraldChip, 'H', Item.hoeDiamond

                });

        // Carrot Stuff/////////////////////////////////////////////////////////////////////////////////////////////////////

        CarrotCake = new BlockCarrotCake(CarrotCakeID, 6).setBlockName("CarrotCake").setCreativeTab(this.customTab).setStepSound(Block.soundClothFootstep);

        GameRegistry.registerBlock(CarrotCake, "Carrot Cake");

        LanguageRegistry.addName(CarrotCake, "Carrot Cake");

        GameRegistry.addRecipe(new ItemStack(CarrotCake, 01), new Object[]

                {

                    "CCC", "CSC", "CCC",

                    'C', Item.carrot, 'S', Item.cake

                });

        CarrotPlacer = new ItemCarrotPlacer(CarrotPlacerID).setItemName("CarrotCake Summoner").setIconIndex(27).setCreativeTab(this.customTab);

        GameRegistry.registerItem(CarrotPlacer, "CarrotCake Summoner");

        LanguageRegistry.addName(CarrotPlacer, "CarrotCake Summoner");

        GameRegistry.addRecipe(new ItemStack(CarrotPlacer, 01), new Object[]

                {

                    "CCC", "CDC", "CCC",

                    'C', CarrotCake, 'D', Item.bucketMilk

                });

        //Chain Stuff///////////////////////////////////////////////////////////////////////////////////////////////////////

        ironShard = new ItemChainItems(ironShardID).setItemName("Iron Shard").setIconIndex(17).setCreativeTab(this.customTab);

        GameRegistry.registerItem(ironShard, "Iron Shard");

        LanguageRegistry.addName(ironShard, "Iron Shard");

        GameRegistry.addShapelessRecipe(new ItemStack(ironShard, 01), new Object[]

                {

                    Chisel, Item.ingotIron

                });

        Chain = new ItemChainItems(ChainID).setItemName("Chain").setIconIndex(18).setCreativeTab(this.customTab);

        GameRegistry.registerItem(Chain, "Chain");

        LanguageRegistry.addName(Chain, "Chain");

        GameRegistry.addRecipe(new ItemStack(Chain, 02), new Object[]

                {

                    "SS",

                    'S', ironShard

                });

        GameRegistry.addRecipe(new ItemStack(Item.helmetChain, 01), new Object[]

                {

                    "CCC", "C C",

                    'C', Chain

                });

        GameRegistry.addRecipe(new ItemStack(Item.plateChain, 01), new Object[]

                {

                    "C C", "CCC", "CCC",

                    'C', Chain

                });

        GameRegistry.addRecipe(new ItemStack(Item.legsChain, 01), new Object[]

                {

                    "CCC", "C C", "C C",

                    'C', Chain

                });

        GameRegistry.addRecipe(new ItemStack(Item.bootsChain, 01), new Object[]

                {

                    "C C", "C C",

                    'C', Chain

                });

        GameRegistry.addRecipe(new ItemStack(WeakIronBlock, 01), new Object[]

                {

                    "EEE", "EEE", "EEE",

                    'E', ironShard

                });

        GameRegistry.addShapelessRecipe(new ItemStack(ironShard, 9), new Object[]

                {

                    WeakIronBlock

                });

        // Block Crafting Recipes////////////////////////////////////////////////////////////////////////////////

        GameRegistry.addRecipe(new ItemStack(RubyBlock, 01), new Object[]

                {

                    "RRR", "RRR", "RRR",

                    'R', Ruby

                });

        GameRegistry.addShapelessRecipe(new ItemStack(Ruby, 9), new Object[]

                {

                    RubyBlock

                });

        GameRegistry.addRecipe(new ItemStack(FlameBlock, 01), new Object[]

                {

                    "FFF", "FFF", "FFF",

                    'F', FlameGem

                });

        GameRegistry.addShapelessRecipe(new ItemStack(FlameGem, 9), new Object[]

                {

                    FlameBlock

                });

        // God Stuff////////////////////////////////////////////////////////////////////////////////////////////////////////

        GameRegistry.addRecipe(new ItemStack(GodSword, 1), new Object[]

                {

                    " G ", " G ", " S ",

                    'G', GodGem, 'S', EmeraldHandle

                });

        GameRegistry.addRecipe(new ItemStack(GodGem, 01), new Object[]

                {

                    " D ", "DFD", " D ",

                    'D', GodGemPiece, 'F', mod_EmeraldsPlus.FlameGem

                });

        GameRegistry.addRecipe(new ItemStack(GodGemPiece, 01), new Object[]

                {

                    "TDT", "DFD", "TDT",

                    'D', Item.diamond, 'F', mod_EmeraldsPlus.FlameGem, 'T', Item.emerald

                });

        GameRegistry.addShapelessRecipe(new ItemStack(MagicDust, 04), new Object[]

                {

                    MagicPile

                });

        GameRegistry.addRecipe(new ItemStack(MagicPile, 01), new Object[]

                {

                    "DD", "DD",

                    'D', MagicDust

                });

        GameRegistry.addShapelessRecipe(new ItemStack(MagicPile, 01), new Object[]

                {

                    Hammer, GodGem

                });

        GameRegistry.addRecipe(new ItemStack(WaterSummoner, 01), new Object[]

                {

                    "DWD", "WIW", "DWD",

                    'D', MagicDust, 'W', Item.bucketWater, 'I', Item.emerald

                });

        GameRegistry.addRecipe(new ItemStack(LavaSummoner, 01), new Object[]

                {

                    "DLD", "LFL", "DLD",

                    'D', MagicDust, 'L', Item.bucketLava, 'F', FlameGem

                });

        GCRecord = new ItemEPRecord(GCRecordID, "Departure", "Guilty Crown").setItemName("GCDisc").setIconIndex(50).setCreativeTab(this.customTab);

        LanguageRegistry.addName(GCRecord, "Guilty Crown Disc 1");

        GameRegistry.registerWorldGenerator(new WorldGeneratorEmeraldsPlus());

    }

    public void craftingRecipes()

    {

    }

    public void gameRegisters()

    {

    }

    public void languageRegisters()

    {

    }

    public String getVersion()

    {

        return null;

    }

    public void load()

    {

    }

}

 

 

Posted

When you paste anything longer than 5-6 lines of code, please don't do it like that!

It's impossible to read clearly without copy pasting it to somewhere else :P

 

Use paste.minecraftforge.com and creat something like this:

 

http://paste.minecraftforge.net/view/ea67dfa5

 

A lot easier for diesieben07 and others to help you with your code when they can easily read it :)

 

If you guys dont get it.. then well ya.. try harder...

Posted

I've made a new class to hold all my sounds:

 

http://pastebin.com/P7ugCZD6

 

It's not giving me an error in the console (it wasn't before either) and "EmeraldsPlusF" is a package that will be exported in the .zip file.

 

Also I added this to my PreInit method:

MinecraftForge.EVENT_BUS.register(new EPSoundEvents());

 

The sounds still don't work though.... Also I don't understand what you mean in your third suggestion.

Posted

So did I register the EventHandler? Also this is my PreInit method:

 

 

@SideOnly(Side.CLIENT)

    @PreInit

    public void preInit(FMLPreInitializationEvent event)

    {

    MinecraftForge.EVENT_BUS.register(new EPSoundEvents());

        // you will be able to find the config file in .minecraft/config/ and it will be named Dummy.cfg

        // here our Configuration has been instantiated, and saved under the name "config"

        Configuration config = new Configuration(event.getSuggestedConfigurationFile());

        // loading the configuration from its file

        config.load();

        // saving the configuration to its file

        config.save();

    }

 

 

Posted

I play one sound here:

 

 

GCRecord = new ItemEPRecord(GCRecordID, "Departure", "Guilty Crown").setItemName("GCDisc").setIconIndex(50).setCreativeTab(this.customTab);

 

 

 

and the other one (onItemUse):

http://pastebin.com/nX7JBkaE

 

Also I separated all my Blocks and Items into different class files but they don't work now (the items and blocks).

Here are the files; @Mod:

http://pastebin.com/YeJZX0Wk

 

Block Class:

http://pastebin.com/C79ApyCw

 

Item Class:

http://pastebin.com/c3JxYnm9

Posted

You forgot to set syntax highlighting to Java, so it's all black and white :P

 

Heres the @mod file fixed:

http://pastebin.com/QaXvYWfU

 

the other one(onItemUse):

http://pastebin.com/hvfPrJkH

 

 

 

Okay I stopped there after looking at your Block file, I have no idea what's going on, it seems like a new mod file again?

Also the line you said is playing the sound, ain't playing sound it is just instantiating a new ItemEPRecord to the variable GCRecord?

 

If you guys dont get it.. then well ya.. try harder...

Posted

Well for the item and block classes I just transferred over the stuff that was in my @Mod file to two new classes. Was that not what I was supposed to do? Also the ItemEPRecord is a edited version of ItemRecord. I made this so I could put in a different artist name--so it would be ItemEPRecord(id, "Name", "Artist"). That worked perfectly fine until yesterday. So the GCRecord is a record that you put in a jukebox, not a item that you're supposed to right click with and it make sound.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.