Like the post above, you should check for EnumToolMaterial, and if you dont want people complaining about how your mod isnt compatible with other mods, make a new file called "Enum(name of material)ToolMaterial" Then copy the files from EnumToolMaterial, rename everything there from "EnumToolMaterial" to "Enum(name of material)ToolMaterial". After this, delete the other tool materials and enter the credentials for your tools materials. Your material should be the only one in there. I also noticed you are also not even including the materials in the files above. Take a look at mrsal's tutorials on items. They should be helpful.
Also, in the modloader function of adding recipe's, did you write
There are a lot of functions in making a tool, let alone a toolset. I dont know if you are not including some major parts or just making a mock up but just be sure you watch tutorials if all else fails. Aside of that note, that mod seems like a great mod! I'll look out for it.
Like the post above, you should check for EnumToolMaterial, and if you dont want people complaining about how your mod isnt compatible with other mods, make a new file called "Enum(name of material)ToolMaterial" Then copy the files from EnumToolMaterial, rename everything there from "EnumToolMaterial" to "Enum(name of material)ToolMaterial". After this, delete the other tool materials and enter the credentials for your tools materials. Your material should be the only one in there. I also noticed you are also not even including the materials in the files above. Take a look at mrsal's tutorials on items. They should be helpful.
Also, in the modloader function of adding recipe's, did you write
There are a lot of functions in making a tool, let alone a toolset. I dont know if you are not including some major parts or just making a mock up but just be sure you watch tutorials if all else fails. Aside of that note, that mod seems like a great mod! I'll look out for it.
Well, I do have sponge in EnumToolMaterial, and if it does become a problem I can make another Enum Material thing later But it still doesn't work
Well, I do have sponge in EnumToolMaterial, and if it does become a problem I can make another Enum Material thing later But it still doesn't work
hmm. try saving all your files in notepad then JUST making one tool e.g. pickaxe. If i'm making a toolset I usually try to limit to one before I make a bunch of tools. And yes, on that note, remove sponge from the EnumToolMaterial and make another called EnumSpongeToolMaterial(or anything you want) and edit it to be sort of like this
package net.minecraft.src;
public enum EnumSpongeToolMaterial
{
//You can edit those numbers with the pars listed below if you didnt already know. You can also edit enchantability wich is pretty cool
SPONGE(3, 1561, 8.0F, 3, 10);
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
}
I usually have problems with putting the images in, but it has come right. Just check twice your Sponge Items folder is in the right place. Apologies if this didn't help at all.
hmm. try saving all your files in notepad then JUST making one tool e.g. pickaxe. If i'm making a toolset I usually try to limit to one before I make a bunch of tools. And yes, on that note, remove sponge from the EnumToolMaterial and make another called EnumSpongeToolMaterial(or anything you want) and edit it to be sort of like this
package net.minecraft.src;
public enum EnumSpongeToolMaterial
{
//You can edit those numbers with the pars listed below if you didnt already know. You can also edit enchantability wich is pretty cool
SPONGE(3, 1561, 8.0F, 3, 10);
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
}
Hope that solved something If not post again
Yeah, the thing is though, it wasn't the items that were giving me errors, it was the craftsponge and stickDiamonds. Is there something I was doing wrong with those? And no, it didn't fix it :S
ModLoader.addRecipe(new ItemStack(craftSponge, 12), new Object[] {"GGG", "GGG", "GGG" 'G', Block.glowStone});
By the looks of things you are missing some commas in your code between "GGG" and 'G'
Some of the other recipes are the same.
Thanks! That has so close to fixed it! Now, it compiles, but when I start the client I get this error:
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Alex\Desktop\mcp\jars\.\crash-reports\crash-2012-08-15_13.25.55-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT bb5e7c37 --------
Generated 8/15/12 1:25 PM
- Minecraft Version: 1.3.1
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 955176552 bytes (910 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.1
mod_spongeTools 1.1
java.lang.StringIndexOutOfBoundsException: String index out of range: 9
at java.lang.String.charAt(String.java:695)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:185)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:482)
at net.minecraft.src.mod_spongeTools.load(mod_spongeTools.java:36)
at net.minecraft.src.ModLoader.init(ModLoader.java:927)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:161)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT d53ba9c0 ----------
This is my new code:
package net.minecraft.src;
public class mod_spongeTools extends BaseMod
{
public static final Item pickaxeSponge = (new ItemPickaxe(3020, EnumToolMaterial.SPONGE)).setItemName("pickaxeSponge");
public static final Item axeSponge = (new ItemAxe(3021, EnumToolMaterial.SPONGE)).setItemName("axeSponge");
public static final Item shovelSponge = (new ItemSpade(3022, EnumToolMaterial.SPONGE)).setItemName("shovelSponge");
public static final Item swordSponge = (new ItemSword(3023, EnumToolMaterial.SPONGE)).setItemName("swordSponge");
public static final Item hoeSponge = (new ItemHoe(3024, EnumToolMaterial.SPONGE)).setItemName("hoeSponge");
public static Item sticksDiamond = (new Item(3435).setItemName("sticksDiamond"));
public static Item craftSponge = (new Item(3073).setItemName("craftSponge"));
public void load()
{
ModLoader.addName(pickaxeSponge, "Sponge Pickaxe");
ModLoader.addName(axeSponge, "Sponge Axe");
ModLoader.addName(shovelSponge, "Sponge Shovel");
ModLoader.addName(swordSponge, "Sponge Sword");
ModLoader.addName(hoeSponge, "Sponge Hoe");
ModLoader.addName(sticksDiamond, "Diamond Sticks");
ModLoader.addName(craftSponge, "Crafted Sponge");
pickaxeSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/pickaxesponge.png");
axeSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/axesponge.png");
shovelSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/shovelsponge.png");
swordSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/swordsponge.png");
hoeSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/hoesponge.png");
sticksDiamond.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/sticksDiamond.png");
craftSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/sponge.png");
ModLoader.addRecipe(new ItemStack(sticksDiamond, 4), new Object[] {" ", " D ", " D ", 'D', Item.diamond});
ModLoader.addRecipe(new ItemStack(craftSponge, 12), new Object[] {"GGG", "GGG", "GGG", 'G', Block.glowStone});
ModLoader.addRecipe(new ItemStack(pickaxeSponge, 1), new Object[] {"SSS", " D ", " D ", 'D', sticksDiamond, 'S', craftSponge});
ModLoader.addRecipe(new ItemStack(axeSponge, 1), new Object[] {"SS ", " SD ", " D ", 'D', sticksDiamond, 'S', craftSponge});
ModLoader.addRecipe(new ItemStack(shovelSponge, 1), new Object[]{" S ", " D ", " D ", 'D', sticksDiamond, 'S', craftSponge});
ModLoader.addRecipe(new ItemStack(swordSponge, 1), new Object[] {" S ", " S ", " D ", 'D', sticksDiamond, 'S', craftSponge });
ModLoader.addRecipe(new ItemStack(hoeSponge, 1), new Object[] {"SS ", " D ", " D ", 'D', sticksDiamond, 'S', craftSponge });
}
public String getVersion()
{
return "1.1";
}
}
Check the recipe for sticksDiamond. The third row has 4 spaces and should only have 3
I think a couple of the others may also have too many spaces.
I checked the other recipes, I can't see any more spaces, but I'm getting this error:
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Alex\Desktop\mcp\jars\.\crash-reports\crash-2012-08-15_13.50.11-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 96fa05f --------
Generated 8/15/12 1:50 PM
- Minecraft Version: 1.3.1
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 955167424 bytes (910 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.1
mod_spongeTools 1.1
java.lang.StringIndexOutOfBoundsException: String index out of range: 8
at java.lang.String.charAt(String.java:695)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:185)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:482)
at net.minecraft.src.mod_spongeTools.load(mod_spongeTools.java:36)
at net.minecraft.src.ModLoader.init(ModLoader.java:927)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:161)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT eda85886 ----------
Here's my code:
package net.minecraft.src;
public class mod_spongeTools extends BaseMod
{
public static final Item pickaxeSponge = (new ItemPickaxe(3020, EnumToolMaterial.SPONGE)).setItemName("pickaxeSponge");
public static final Item axeSponge = (new ItemAxe(3021, EnumToolMaterial.SPONGE)).setItemName("axeSponge");
public static final Item shovelSponge = (new ItemSpade(3022, EnumToolMaterial.SPONGE)).setItemName("shovelSponge");
public static final Item swordSponge = (new ItemSword(3023, EnumToolMaterial.SPONGE)).setItemName("swordSponge");
public static final Item hoeSponge = (new ItemHoe(3024, EnumToolMaterial.SPONGE)).setItemName("hoeSponge");
public static Item sticksDiamond = (new Item(3435).setItemName("sticksDiamond"));
public static Item craftSponge = (new Item(3073).setItemName("craftSponge"));
public void load()
{
ModLoader.addName(pickaxeSponge, "Sponge Pickaxe");
ModLoader.addName(axeSponge, "Sponge Axe");
ModLoader.addName(shovelSponge, "Sponge Shovel");
ModLoader.addName(swordSponge, "Sponge Sword");
ModLoader.addName(hoeSponge, "Sponge Hoe");
ModLoader.addName(sticksDiamond, "Diamond Sticks");
ModLoader.addName(craftSponge, "Crafted Sponge");
pickaxeSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/pickaxesponge.png");
axeSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/axesponge.png");
shovelSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/shovelsponge.png");
swordSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/swordsponge.png");
hoeSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/hoesponge.png");
sticksDiamond.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/sticksDiamond.png");
craftSponge.iconIndex = ModLoader.addOverride("/gui/items.png", "/spongeTools/sponge.png");
ModLoader.addRecipe(new ItemStack(sticksDiamond, 4), new Object[] {" ", " D ", " D ", 'D', Item.diamond});
ModLoader.addRecipe(new ItemStack(craftSponge, 12), new Object[] {"GGG", "GGG", "GGG", 'G', Block.glowStone});
ModLoader.addRecipe(new ItemStack(pickaxeSponge, 1), new Object[] {"SSS", " D ", " D ", 'D', sticksDiamond, 'S', craftSponge});
ModLoader.addRecipe(new ItemStack(axeSponge, 1), new Object[] {"SS ", " SD ", " D ", 'D', sticksDiamond, 'S', craftSponge});
ModLoader.addRecipe(new ItemStack(shovelSponge, 1), new Object[]{" S ", " D ", " D ", 'D', sticksDiamond, 'S', craftSponge});
ModLoader.addRecipe(new ItemStack(swordSponge, 1), new Object[] {" S ", " S ", " D ", 'D', sticksDiamond, 'S', craftSponge });
ModLoader.addRecipe(new ItemStack(hoeSponge, 1), new Object[] {"SS ", " D ", " D ", 'D', sticksDiamond, 'S', craftSponge });
}
public String getVersion()
{
return "1.1";
}
}
Thanks everyone for the help! I was just so blind :DDD Also, I needed to change the
ModLoader.addRecipe(new ItemStack(sticksDiamond, 4), new Object[] {" ", " D ", " D ", 'D', Item.diamond});
To
ModLoader.addRecipe(new ItemStack(sticksDiamond, 4), new Object[] {" D ", " D ", 'D', Item.diamond});
But it's working now I can't post anymore after this, so if you guys wanna check it out, look on PMC. It's not up yet because I need to be level 2 to upload mods... My name is alefolgi123 so keep updated if you want!
Also, in the modloader function of adding recipe's, did you write
There are a lot of functions in making a tool, let alone a toolset. I dont know if you are not including some major parts or just making a mock up but just be sure you watch tutorials if all else fails. Aside of that note, that mod seems like a great mod! I'll look out for it.
Proud partner of the +Craft Mod Team.
Well, I do have sponge in EnumToolMaterial, and if it does become a problem I can make another Enum Material thing later But it still doesn't work
hmm. try saving all your files in notepad then JUST making one tool e.g. pickaxe. If i'm making a toolset I usually try to limit to one before I make a bunch of tools. And yes, on that note, remove sponge from the EnumToolMaterial and make another called EnumSpongeToolMaterial(or anything you want) and edit it to be sort of like this
Hope that solved something If not post again
Proud partner of the +Craft Mod Team.
Yeah, the thing is though, it wasn't the items that were giving me errors, it was the craftsponge and stickDiamonds. Is there something I was doing wrong with those? And no, it didn't fix it :S
Proud partner of the +Craft Mod Team.
to
At the beginning of your code you have
which is fine but you also have it again after your item declarations. This one should be
I fixed that, but now I'm getting errors like this
I modified my code like this:
Any more ideas?
Change your recipes so they only use one character per crafting space.
eg,
should be
But I'm still getting those errors.
By the looks of things you are missing some commas in your code between "GGG" and 'G'
Some of the other recipes are the same.
Thanks! That has so close to fixed it! Now, it compiles, but when I start the client I get this error:
This is my new code:
I think a couple of the others may also have too many spaces.
I checked the other recipes, I can't see any more spaces, but I'm getting this error:
Here's my code:
yeah that right,
change that
for that:
To
But it's working now I can't post anymore after this, so if you guys wanna check it out, look on PMC. It's not up yet because I need to be level 2 to upload mods... My name is alefolgi123 so keep updated if you want!