Hello fellow Modders, I have recently transferred my mod to Minecraft Forge but I have ONE SMALL error...
I know what the error is but I can't find where it is...
this is the error:
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 net.minecraft.src.ModLoader.addMod(ModLoader.java:234)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1217)
at net.minecraft.src.ModLoader.init(ModLoader.java:708)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:150)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:78)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:9)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:316)
at net.minecraft.client.Minecraft.run(Minecraft.java:620)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: unknown character '
at net.minecraft.src.forge.Configuration.load(Configuration.java:235)
at net.minecraft.src.mod_Sink.configurationProperties(mod_Sink.java:54)
at net.minecraft.src.mod_Sink.<clinit>(mod_Sink.java:11)
Again, I know what the problem is it says "Caused by: java.lang.RuntimeException: unknown character '"
I just don't know where it is in the code...
mod_Quicksand.java:
package net.minecraft.src;
import java.io.File;
import java.util.*;
import net.minecraft.client.Minecraft;
import net.minecraft.src.forge.*;
public class mod_Sink extends BaseMod
{
static Configuration configuration = new Configuration(new File(Minecraft.getMinecraftDir(), "config/Sink.cfg"));
static int blockQuickBlockID = configurationProperties();
static int blockMudBlockID;
static int soakedSandShiftedIndex;
static int MudShiftedIndex;
public static final Block blockMud = new MudBlock(blockMudBlockID, 1).setHardness(3F).setResistance(5F).setStepSound(Block.soundSandFootstep).setLightValue(.6F).setBlockName("blockMud");
public static final Block blockQuick = new QuicksandBlock(blockQuickBlockID, 0).setHardness(3F).setResistance(5F).setStepSound(Block.soundSandFootstep).setLightValue(.6F).setBlockName("blockQuicksand");
public static final Item soakedSand = (new QuicksandItem(soakedSandShiftedIndex)).setIconIndex(0).setItemName("wetSand");
public static final Item Mud = (new MudItem(MudShiftedIndex)).setIconIndex(0).setItemName("Mud");
static EnumArmorMaterial armorMUD = EnumHelper.addArmorMaterial("MUD", 29, new int[] {2, 7, 5, 3}, 9);
public static final Item helmetMud = (new SinkItemArmor(127, armorMUD, 5, 0)).setIconCoord(0, 6).setItemName("helmetMud");
public static final Item plateMud = (new SinkItemArmor(128, armorMUD, 5, 1)).setIconCoord(0, 7).setItemName("chestplateMud");
public static final Item legsMud = (new SinkItemArmor(129, armorMUD, 5, 2)).setIconCoord(0, 8).setItemName("leggingsMud");
public static final Item bootsMud = (new SinkItemArmor(130, armorMUD, 5, 3)).setIconCoord(0, 9).setItemName("bootsMud");
public mod_Sink()
{
}
public void load()
{
MinecraftForgeClient.preloadTexture("/Sink/Textures/terrain.png");
MinecraftForgeClient.preloadTexture("/Sink/Textures/item.png");
ModLoader.RegisterBlock(blockQuick);
ModLoader.RegisterBlock(blockMud);
ModLoader.AddName(blockMud, "Block'o'Mud");
ModLoader.AddName(blockQuick, "Quicksand");
ModLoader.AddName(soakedSand, "Wet Sand");
ModLoader.AddName(Mud, "Mud");
ModLoader.AddRecipe(new ItemStack(helmetMud, 1), new Object[] {"XXX", "X X", Character.valueOf('X'), Mud});
ModLoader.AddRecipe(new ItemStack(plateMud, 1), new Object[] {"X X", "XXX", "XXX", Character.valueOf('X'), Mud});
ModLoader.AddRecipe(new ItemStack(legsMud, 1), new Object[] {"XXX", "X X", "X X", Character.valueOf('X'), Mud});
ModLoader.AddRecipe(new ItemStack(bootsMud, 1), new Object[] {"X X", "X X", Character.valueOf('X'), Mud});
ModLoader.AddRecipe(new ItemStack(blockMud, 2), new Object[] {"XX", "XX", Character.valueOf('X'), Mud});
ModLoader.AddRecipe(new ItemStack(blockQuick, 2), new Object[] {"XX", "XX", Character.valueOf('X'), soakedSand});
ModLoader.AddShapelessRecipe(new ItemStack(soakedSand, 2), new Object[] {Item.bucketWater, Block.sand});
ModLoader.AddShapelessRecipe(new ItemStack(Mud, 2), new Object[] {Item.bucketWater, Block.dirt});
ModLoader.AddShapelessRecipe(new ItemStack(soakedSand, 4), new Object[] {blockQuick});
ModLoader.AddShapelessRecipe(new ItemStack(Mud, 4), new Object[] {blockMud});
}
public static int configurationProperties()
{
configuration.load();
blockQuickBlockID = Integer.parseInt(configuration.getOrCreateBlockIdProperty("Quicksand Block", 123).value);
blockMudBlockID = Integer.parseInt(configuration.getOrCreateBlockIdProperty("Block'o'Mud", 124).value);
soakedSandShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Wet Sand", Configuration.ITEM_PROPERTY, 3140).value);
MudShiftedIndex = Integer.parseInt(configuration.getOrCreateIntProperty("Mud", Configuration.ITEM_PROPERTY, 3141).value);
configuration.save();
return blockQuickBlockID;
}
@Override
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for (int i=0; i<3; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(74);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinDesert(blockQuick.blockID, 25)).generate(world, rand, randPosX, randPosY, randPosZ);
(new WorldGenMinForest(blockMud.blockID, 25)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.1.0";
}
}
I know what the error is but I can't find where it is...
this is the error:
Again, I know what the problem is it says "Caused by: java.lang.RuntimeException: unknown character '"
I just don't know where it is in the code...
mod_Quicksand.java:
Thanks to anyone that helps :smile.gif:
Currently working on random projects. Have any coding problems? Feel free to PM!
Okay, I got rid of that and made it Mud Block instead but I still get the error...
Curious, I just looked at line 54 (the one referenced in the error) and it's
Look for any ' in your configuration file and change them accordingly.
Currently working on random projects. Have any coding problems? Feel free to PM!
I found it! Thanks a lot! :smile.gif: +1