Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I keep getting this error... what to do plz advise .

 

I installed Modloader 1.3.2, Eclipse 1.7.0 with JDK and JRE, MCP 7.2 and Minecraft Forge jenkins 200 build.

I first tried making a mod with modloader and had to many items and blocks... so i needed to use a mod like Forge in order to get more, i made myself 2 nice 256x256.png files 1 including blocks located in my minecraft.jar/mod_Ores

and 1 including items located at my minecraft.jar/mod_Ores/Gui

 

This is one of my block files : (they all look basically the same, except for names)

 

 

package net.minecraft.src;

 

import java.util.Random;

import net.minecraftforge.client.*;

public class BlockAmazoniteBlock extends Block

{

    protected BlockAmazoniteBlock(int par1, int par2)

    {

        super(par1, par2, Material.rock);

        this.setCreativeTab(CreativeTabs.tabBlock);

    }

   

    public int quanitityDropped(int par1, int par2)

    {

    return 1;

    }

    public String getTextureFile()

    {

            return "/mod_Ores/Blocks.png";

    }

    public int idDropped(int par1, Random random, int par2)

    {

    return mod_Ores.AmazoniteBlock.blockID;

    }

 

}

 

 

And this is one of my item files:

 

 

package net.minecraft.src;

 

import net.minecraftforge.client.*;

public class ItemAmazoniteGem extends Item

{

protected ItemAmazoniteGem(int i)

{

super(i);

}

    public String getTextureFile()

    {

        return "/mod_Ores/gui/ItemsMe.png";

    }

}

 

 

 

 

in my mod_Ores file i have big lists of the following (i wont include 2 lines that are the exact same (except for names and numbers))

So heres my mod_Ores file:

 

 

package net.minecraft.src;

 

import java.util.Random;

 

import net.minecraftforge.client.*;

 

public class mod_Ores extends BaseMod

{

//Blocks

//Ores

public static final Block Amazoniteore =  (new BlockAmazoniteore (150,30)).setHardness(4.0F).setResistance(1F).setLightValue(0.5F).setStepSound(Block.soundStoneFootstep).setBlockName("Amazoniteore"); 

 

//Items

//Gems

public static final Item AmazoniteGem = (new ItemAmazoniteGem(1000)).setIconIndex(0).setItemName("AmazoniteGem");

//Tools

public static final Item BronzePickaxe = (new ItemPickaxe(1048,EnumToolMaterial.BRONZE).setIconIndex(87).setItemName("BronzePickaxe"));

 

 

//Armour

public static final Item BronzeHelmet = (new ItemArmorBronze(1108,EnumArmorMaterial.BRONZE,ModLoader.addArmor("Bronze"),0).setIconIndex(48).setItemName("BronzeHelmet"));

 

 

NOTE : THESE armour files and things somehow give errors aswell, how to do it in a different way or what to change?

armour file :

 

 

 

package net.minecraft.src;

 

public class ItemArmorBronze extends ItemArmor

{

    /** Holds the 'base' maxDamage that each armorType have. */

    private static final int[] maxDamageArray = new int[] {8, 10, 7, 6};

 

    /**

    * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots

    */

    public final int armorType;

 

    /** Holds the amount of damage that the armor reduces at full durability. */

    public final int damageReduceAmount;

 

    /**

    * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is

    * iron, 3 is diamond and 4 is gold.

    */

    public final int renderIndex;

 

    /** The EnumArmorMaterial used for this ItemArmor */

    private final EnumArmorMaterial material;

 

    public ItemArmorBronze(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4)

    {

        super(par1,par2EnumArmorMaterial,par3,par4);

        this.material = par2EnumArmorMaterial;

        this.armorType = par4;

        this.renderIndex = par3;

        this.damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4);

        this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4));

        this.maxStackSize = 1;

        this.setTabToDisplayOn(CreativeTabs.tabCombat);

    }

 

    /**

    * Return the enchantability factor of the item, most of the time is based on material.

    */

    public int getItemEnchantability()

    {

        return this.material.getEnchantability();

    }

 

    /**

    * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets

    * multiplied by armor material factor)

    */

    static int[] getMaxDamageArray()

    {

        return maxDamageArray;

    }

}

 

 

 

then i also have

the following in the public void

 

 

public void load()

{

MinecraftForgeClient.preloadTexture("/mod_Ores/Blocks.png");

        MinecraftForgeClient.preloadTexture("/mod_Ores/gui/ItemsMe.png");

 

 

//Registering

 

ModLoader.registerBlock(Amazoniteore);

 

//Adding Names

//Ores

ModLoader.addName(Amazoniteore,"Amazonite Ore");

 

//Crafting Recipes

 

 

//Blocks

ModLoader.addRecipe(new ItemStack(mod_Ores.AmazoniteBlock, 1), new Object[]

{

"XXX", "XXX", "XXX",  'X', mod_Ores.AmazoniteGem //Crafting Line 

});

ModLoader.addShapelessRecipe(new ItemStack(mod_Ores.AmazoniteGem, 1), new Object[]

{

mod_Ores.AmazoniteUncut, mod_Ores.Polisher , mod_Ores.PolisherTowel //Crafting Line 

});

 

 

//Smelting Recipes

 

ModLoader.addSmelting(mod_Ores.Cobaltore.blockID, new ItemStack(mod_Ores.CobaltIngot));

 

 

 

} <- this closes the public void

 

public void generateSurface(World world, Random random, int chunkX, int chunkZ)

{

for (int i = 0; i < 7; i++)

{

int randPosX = chunkX + random.nextInt(16);

int randPosY = random.nextInt(32); //Rarerity 6 (1-15) 1 is very common 15 is extremely rare

int randPosZ = chunkZ + random.nextInt(16);

(new WorldGenMinable(mod_Ores.Amazoniteore.blockID, 7)).generate(world, random, randPosX, randPosY, randPosZ);

}

 

and at the very bottom of the page i have this

 

 

  public int addFuel(int i, int j)

    {

    if (i == mod_Ores.UraniumLiquid.shiftedIndex)

    {

    return 160000;

    }

        return 0;

    }

 

public String getVersion()

{

return "1.3.2";

}

}

 

 

 

 

 

 

All i did was trying to add items and blocks with Minecraft Forge and giving the recipes, and i wanted to generate the ores ofcourse.

 

Error

 

 

java.lang.ExceptionInInitializerError

2012-08-23 19:08:32 [iNFO] [sTDERR] at java.lang.Class.forName0(Native Method)

2012-08-23 19:08:32 [iNFO] [sTDERR] at java.lang.Class.forName(Unknown Source)

2012-08-23 19:08:32 [iNFO] [sTDERR] at cpw.mods.fml.common.modloader.ModLoaderModContainer.constructMod(ModLoaderModContainer.java:501)

2012-08-23 19:08:32 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2012-08-23 19:08:32 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2012-08-23 19:08:32 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2012-08-23 19:08:32 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source)

2012-08-23 19:08:32 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)

2012-08-23 19:08:32 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

2012-08-23 19:08:32 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)

2012-08-23 19:08:32 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)

2012-08-23 19:08:32 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268)

2012-08-23 19:08:32 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:127)

2012-08-23 19:08:32 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2012-08-23 19:08:32 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2012-08-23 19:08:32 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2012-08-23 19:08:32 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source)

2012-08-23 19:08:32 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)

2012-08-23 19:08:32 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

2012-08-23 19:08:32 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)

2012-08-23 19:08:32 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)

2012-08-23 19:08:32 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268)

2012-08-23 19:08:32 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:85)

2012-08-23 19:08:32 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:420)

2012-08-23 19:08:32 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:192)

2012-08-23 19:08:32 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:402)

2012-08-23 19:08:32 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:734)

2012-08-23 19:08:32 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source)

2012-08-23 19:08:32 [iNFO] [sTDERR] Caused by: java.lang.ArrayIndexOutOfBoundsException: 125

2012-08-23 19:08:32 [iNFO] [sTDERR] at net.minecraft.src.EnumArmorMaterial.getDamageReductionAmount(EnumArmorMaterial.java:56)

2012-08-23 19:08:32 [iNFO] [sTDERR] at net.minecraft.src.ItemArmor.<init>(ItemArmor.java:31)

2012-08-23 19:08:32 [iNFO] [sTDERR] at net.minecraft.src.ItemArmorBronze.<init>(ItemArmorBronze.java:27)

2012-08-23 19:08:32 [iNFO] [sTDERR] at net.minecraft.src.mod_Ores.<clinit>(mod_Ores.java:219)

2012-08-23 19:08:32 [iNFO] [sTDERR] ... 28 more

 

 

Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.