I was working with adding stuff to one of my mods.
I recompiled successfully.
When I ran the game I got an error I can't fully make sense of:
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at ModLoader.addMod(ModLoader.java:269)
at ModLoader.readFromModFolder(ModLoader.java:1305)
at ModLoader.init(ModLoader.java:820)
at ModLoader.AddAllRenderers(ModLoader.java:189)
at afq.<init>(afq.java:80)
at afq.<clinit>(afq.java:9)
at net.minecraft.client.Minecraft.a(SourceFile:265)
at net.minecraft.client.Minecraft.run(SourceFile:648)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 6277
at tw.<init>(SourceFile:13)
at ItemCacaoSapling.<init>(ItemCacaoSapling.java:9)
at mod_Treats.<clinit>(mod_Treats.java:33)
... 15 more
I was working with adding stuff to one of my mods.
I recompiled successfully.
When I ran the game I got an error I can't fully make sense of:
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at ModLoader.addMod(ModLoader.java:269)
at ModLoader.readFromModFolder(ModLoader.java:1305)
at ModLoader.init(ModLoader.java:820)
at ModLoader.AddAllRenderers(ModLoader.java:189)
at afq.<init>(afq.java:80)
at afq.<clinit>(afq.java:9)
at net.minecraft.client.Minecraft.a(SourceFile:265)
at net.minecraft.client.Minecraft.run(SourceFile:648)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 6277
at tw.<init>(SourceFile:13)
at ItemCacaoSapling.<init>(ItemCacaoSapling.java:9)
at mod_Treats.<clinit>(mod_Treats.java:33)
... 15 more
Does anyone know how to deal with this?
Always try, if you can, to make sense of the "Caused by" part of the error report. The ArrayIndexOutOfBoundsException:6277 means that that id is out of bounds. Too high. Try changing it to under 2k and see if that helps any!
It doesny mean that rhe id is out pf range, what is your code from mod_treats
To be honest, what else could give an out of bounds error? You should THINK before you post something that will make you look "stupid". Too late though.
At line 33 in the mod_ file, most likely an itemID going out of bounds. If it's not then post your mod_ code.
Now something really strange is happenning.
After messing around with the IDs, Minecraft crashed again.
Modloader apparently says one of vanilla minecraft files is incompatible with Minecraft.
This is not making any sense.
Edit: The file Modloader is having a problem with doesn't exist...
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at ModLoader.addMod(ModLoader.java:269)
at ModLoader.readFromModFolder(ModLoader.java:1305)
at ModLoader.init(ModLoader.java:820)
at ModLoader.AddAllRenderers(ModLoader.java:189)
at afq.<init>(afq.java:80)
at afq.<clinit>(afq.java:9)
at net.minecraft.client.Minecraft.a(SourceFile:265)
at net.minecraft.client.Minecraft.run(SourceFile:648)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 2177
at tw.<init>(SourceFile:13)
at ItemCacaoSapling.<init>(ItemCacaoSapling.java:9)
at mod_Treats.<clinit>(mod_Treats.java:33)
... 15 more
There seem to be this tw.(SourceFile) thing that is messing stuff up.
Edit: I found the tw class, but I can't understand it.
I can't find it's decompiled version either.
tw is obfuscated to ItemBlockUnfortunately, there is no line 13. Its blankWhat is ItemCacaoSapling?I think your ItemCacaoSapling is doing something weird.
package net.minecraft.src;
import java.util.Random;
public class BlockCacaoSapling extends BlockFlower
{
protected BlockCacaoSapling(int i, int j)
{
super(i, j);
float f = 0.4F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if (world.multiplayerWorld)
{
return;
}
super.updateTick(world, i, j, k, random);
if (world.getBlockLightValue(i, j + 1, k) >= 9 && random.nextInt(7) == 0)
{
int l = world.getBlockMetadata(i, j, k);
if ((l & 8) == 0)
{
world.setBlockMetadataWithNotify(i, j, k, l | 8);
}
else
{
growTree(world, i, j, k, random);
}
}
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return super.getBlockTextureFromSideAndMetadata(i, j);
}
public void growTree(World world, int i, int j, int k, Random random)
{
int l = world.getBlockMetadata(i, j, k) & 3;
world.setBlock(i, j, k, 0);
Object obj = null;
if (l == 1)
{
obj = new WorldGenTaiga2(true);
}
else if (l == 2)
{
obj = new WorldGenForest(true);
}
else
{
obj = new WorldGenCacaoTrees(true);
}
if (!((WorldGenerator) (obj)).generate(world, random, i, j, k))
{
world.setBlockAndMetadata(i, j, k, blockID, l);
}
}
}
mod_Treats:
package net.minecraft.src;
import java.util.*;
import java.util.Random;
public class mod_Treats extends BaseMod
{
public static final Block SaltOre = new BlockSaltOre(195, 0).setHardness(2.0F).setResistance(5.0F).setBlockName("SaltOre");
public static final Block CacaoLeaves = new BlockCacaoLeaves(196, 0).setHardness(0.2F).setLightOpacity(1).setBlockName("CacaoLeaves").disableStats();
public static final Block BlockCacaoSapling = new BlockCacaoSapling(197, 0).setHardness(0F).setBlockName("BlockCacaoSapling");
public static final Item Pietin = new Item(1900).setItemName("Pietin");
public static final Item Chocolate = new ItemFood(1901, 3, 0.3F, false).setItemName("Chocolate");
public static final Item Dough = new Item(1902).setItemName("Dough");
public static final Item ApplePie = new ItemApplePie(1903, 12).setItemName("ApplePie");
public static final Item PumpkinPie = new ItemPumpkinPie(1904, 12).setItemName("PumpkinPie");
public static final Item Salad = new ItemSalad(1905, 8).setItemName("Salad");
public static final Item ChocolateMilk = new ItemFood(1906, 4, 0.2F, false).setItemName("ChocolateMilk");
public static final Item ApplePieRaw = new ItemApplePieRaw(1907, 6).setItemName("ApplePieRaw");
public static final Item PumpkinPieRaw = new ItemPumpkinPieRaw(1908, 6).setItemName("PumpkinPieRaw");
public static final Item HotChocolate = new ItemFood(1909, 6, 0.3F, false).setItemName("HotChocolate");
public static final Item Marshmallow = new ItemFood(1910, 3, 0.3F, false).setItemName("Marshmallow");
public static final Item Cracker = new ItemFood(1911, 4, 0.4F, false).setItemName("Cracker");
public static final Item RoastedMarshmallow = (new ItemFood(1912, 4, 0.3F, false)).setItemName("RoastedMarshmallow");
public static final Item CocoaWM = new ItemFood(1913, 8, 0.4F, false).setItemName("CocoaWM");
public static final Item Smore = new ItemFood(1914, 18, 0.4F, false).setItemName("Smore");
public static final Item AppleJuice = new ItemFood(1915, 4, 0.2F, false).setItemName("AppleJuice");
public static final Item FishChips = new ItemFishChips(1916, 10).setItemName("FishChips");
public static final Item Salt = new Item(1917).setItemName("Salt");
public static final Item BoomPie = new ItemBoomPie(1918).setItemName("BoomPie");
public static final Item Burger = new ItemFood(1919, 18, 0.5F, false).setItemName("Burger");
public static final Item Hotdog = new ItemFood(1920, 14, 0.5F, false).setItemName("Hotdog");
public static final Item CacaoSapling = new ItemCacaoSapling(1921).setItemName("CacaoSapling");
public void load()
{
ModLoader.RegisterBlock(SaltOre);
SaltOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/food/SaltOre.png");
ModLoader.AddName(SaltOre, "Salt Ore");
ModLoader.RegisterBlock(CacaoLeaves);
CacaoLeaves.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/food/CacaoLeaves.png");
ModLoader.AddName(CacaoLeaves, "Cacao Leaves");
BlockCacaoSapling.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/food/CacaoSapling.png");
ModLoader.AddName(BlockCacaoSapling, "Cacao Sapling");
Pietin.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/Pietin.png");
ModLoader.AddName(Pietin, "Pie Tin");
ModLoader.AddRecipe(new ItemStack(Pietin, 1), new Object[] {
"XX", Character.valueOf('X'), Item.ingotIron
});
Chocolate.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/Chocolate.png");
ModLoader.AddName(Chocolate, "Chocolate");
ModLoader.AddShapelessRecipe(new ItemStack(Chocolate, 2), new Object[]{
new ItemStack(Item.dyePowder, 1, 3), new ItemStack(Item.bucketMilk, 1), new ItemStack(Item.sugar, 1)
});
Dough.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/Dough.png");
ModLoader.AddName(Dough, "Dough");
ModLoader.AddShapelessRecipe(new ItemStack(Dough, 1), new Object[] {
new ItemStack(Item.wheat, 1), new ItemStack(Item.bucketWater, 1)
});
ApplePie.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/ApplePie.png");
ModLoader.AddName(ApplePie, "Apple Pie");
ModLoader.AddSmelting(mod_Treats.ApplePieRaw.shiftedIndex, new ItemStack(mod_Treats.ApplePie));
ApplePieRaw.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/ApplePieRaw.png");
ModLoader.AddName(ApplePieRaw, "Uncooked Apple Pie");
ModLoader.AddRecipe(new ItemStack(ApplePieRaw, 1), new Object[] {
"X", "#", "*", Character.valueOf('X'), mod_Treats.Dough, Character.valueOf('#'), Item.appleRed, Character.valueOf('*'), mod_Treats.Pietin
});
PumpkinPie.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/PumpkinPie.png");
ModLoader.AddName(PumpkinPie, "Pumpkin Pie");
ModLoader.AddSmelting(mod_Treats.PumpkinPieRaw.shiftedIndex, new ItemStack(mod_Treats.PumpkinPie));
PumpkinPieRaw.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/PumpkinPieRaw.png");
ModLoader.AddName(PumpkinPieRaw, "Uncooked Pumpkin Pie");
ModLoader.AddRecipe(new ItemStack(PumpkinPieRaw, 1), new Object[] {
"X", "#", "*", Character.valueOf('X'), mod_Treats.Dough, Character.valueOf('#'), Block.pumpkin, Character.valueOf('*'), mod_Treats.Pietin
});
Salad.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/Salad.png");
ModLoader.AddName(Salad, "Salad");
ModLoader.AddShapelessRecipe(new ItemStack(Salad, 1), new Object[] {
new ItemStack(Item.bowlEmpty, 1), new ItemStack(Block.plantRed, 1), new ItemStack(Block.plantYellow, 1)
});
ChocolateMilk.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/ChocolateMilk.png");
ModLoader.AddName(ChocolateMilk, "Chocolate Milk");
ModLoader.AddShapelessRecipe(new ItemStack(ChocolateMilk, 1), new Object[] {
new ItemStack(Item.dyePowder, 1, 3), new ItemStack(Item.bucketMilk, 1)
});
HotChocolate.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/HotChocolate.png");
ModLoader.AddName(HotChocolate, "Hot Chocolate");
ModLoader.AddSmelting(mod_Treats.ChocolateMilk.shiftedIndex, new ItemStack(mod_Treats.HotChocolate));
Marshmallow.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/Marshmallow.png");
ModLoader.AddName(Marshmallow, "Marshmallow");
ModLoader.AddRecipe(new ItemStack(Marshmallow, 2), new Object[] {
"XX", "XX", Character.valueOf('X'), Item.sugar
});
Cracker.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/Cracker.png");
ModLoader.AddName(Cracker, "Graham Cracker");
ModLoader.AddShapelessRecipe(new ItemStack(Cracker, 2), new Object[] {
new ItemStack(Item.wheat, 1), new ItemStack(Item.sugar, 1)
});
RoastedMarshmallow.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/RoastedMarshmallow.png");
ModLoader.AddName(RoastedMarshmallow, "Roasted Marshmallow");
ModLoader.AddSmelting(mod_Treats.Marshmallow.shiftedIndex, new ItemStack(mod_Treats.RoastedMarshmallow));
CocoaWM.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/CocoaWM.png");
ModLoader.AddName(CocoaWM, "Hot Chocolate With Marshmallows");
ModLoader.AddShapelessRecipe(new ItemStack(CocoaWM, 1), new Object[] {
new ItemStack(mod_Treats.Marshmallow, 1), new ItemStack(mod_Treats.HotChocolate, 1)
});
Smore.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/Smore.png");
ModLoader.AddName(Smore, "Smore");
ModLoader.AddShapelessRecipe(new ItemStack(Smore, 1), new Object[] {
new ItemStack(mod_Treats.Cracker, 1), new ItemStack(mod_Treats.Cracker, 1), new ItemStack(mod_Treats.RoastedMarshmallow, 1), new ItemStack(mod_Treats.Chocolate, 1)
});
AppleJuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/AppleJuice.png");
ModLoader.AddName(AppleJuice, "Apple Juice");
ModLoader.AddShapelessRecipe(new ItemStack(AppleJuice, 1), new Object[] {
new ItemStack(Item.appleRed, 1), new ItemStack(Item.sugar, 1), new ItemStack(Item.bucketWater, 1)
});
FishChips.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/FishChips.png");
ModLoader.AddName(FishChips, "Fish and Chips");
ModLoader.AddShapelessRecipe(new ItemStack(FishChips, 1), new Object[] {
new ItemStack(Item.bowlEmpty, 1), new ItemStack(Item.fishCooked, 1), new ItemStack(Item.bread, 1)
});
Salt.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/Salt.png");
ModLoader.AddName(Salt, "Salt");
BoomPie.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/BoomPie.png");
ModLoader.AddName(BoomPie, "Creeper Pie");
ModLoader.AddRecipe(new ItemStack(BoomPie, 1), new Object[] {
"X", "#", "*", Character.valueOf('X'), mod_Treats.Dough, Character.valueOf('#'), Item.gunpowder, Character.valueOf('*'), mod_Treats.Pietin
});
Burger.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/Burger.png");
ModLoader.AddName(Burger, "Hamburger");
ModLoader.AddRecipe(new ItemStack(Burger, 1), new Object[] {
"X", "#", "X", Character.valueOf('X'), Item.bread, Character.valueOf('#'), Item.beefCooked
});
Hotdog.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/Hotdog.png");
ModLoader.AddName(Hotdog, "Hot Dog");
ModLoader.AddRecipe(new ItemStack(Hotdog, 1), new Object[] {
"X", "#", Character.valueOf('X'), Item.porkCooked, Character.valueOf('#'), Item.bread
});
CacaoSapling.iconIndex = ModLoader.addOverride("/terrain.png", "/food/CacaoSapling.png");
ModLoader.AddName(CacaoSapling, "Cacao Sapling");
}
public String getVersion()
{
return "1.1.0_2.0";
}
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(64);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Treats.SaltOre.blockID, 8)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public void GenerateSurface1(World world, Random random, int i, int j)
{
BiomeGenBase biomegenbase = world.getWorldChunkManager().getBiomeGenAt(i, j);
WorldGenCacaoTrees worldgencacaotrees = new WorldGenCacaoTrees(false);
if((biomegenbase instanceof BiomeGenForest) || (biomegenbase instanceof BiomeGenForest))
{
int k = i + random.nextInt(16) + 8;
int l = j + random.nextInt(16) + 8;
int i1 = world.getHeightValue(k, l);
worldgencacaotrees.func_517_a(1.0D, 1.0D, 1.0D);
worldgencacaotrees.generate(world, random, k, i1, l);
}
}
}
I recompiled successfully.
When I ran the game I got an error I can't fully make sense of:
Always try, if you can, to make sense of the "Caused by" part of the error report. The ArrayIndexOutOfBoundsException:6277 means that that id is out of bounds. Too high. Try changing it to under 2k and see if that helps any!
but i think its in ¨ItemCacaoSapling¨ line 9 and in ¨Mod_threats¨ line 33 - try look at them..
To be honest, what else could give an out of bounds error? You should THINK before you post something that will make you look "stupid". Too late though.
At line 33 in the mod_ file, most likely an itemID going out of bounds. If it's not then post your mod_ code.
I have an ID in the 6000s :blink.gif: somewhere.
That's what I though, I just said under 2k to be safe :tongue.gif:
I think item IDs go up to 16,000 actually but I'm not sure. There are vanilla items that have IDs of 6,000+
Thank you my good sir. You just prevented a war.
After messing around with the IDs, Minecraft crashed again.
Modloader apparently says one of vanilla minecraft files is incompatible with Minecraft.
This is not making any sense.
Edit: The file Modloader is having a problem with doesn't exist...
This:
Edit: I found the tw class, but I can't understand it.
I can't find it's decompiled version either.
BlockCacaoSapling: