You should not update de tutorial to new version.
Just leave the old and copy it to create the new version.
Could use the Hide button to hide the old one.
I want to finish the tutorial (1.1 or 1.2.5) and understand all before study the new code.
in this case you should delete the existing recipe in crafting mananger, because minecraft always prioritizes those original recipes.
Or, make a different-looking recipe
Thanks! (again )
Now for the last thing for this 1 block ( ), anyone knows how to add a block to a secondary ID? Like wool (and dye in terms of items) being 35(1), 35(2) and 351(1) etc. etc.
But when i test it with my recipe it makes a normal bookshelf instead of my Jungle BookShelf I've looked in the CraftingManager file and the BlockBookShelf file but i can't find out what to do
Are you putting Block.bookshelf in the new ItemStack or are you putting mod_YourMod.JungleBookShelf?
Unless intentionally set up to be able to do so, they are obfuscated and a lot of the code will be messed up on decompile. You're not supposed to be able to do this anyway, as it's the modder's work, not yours...
Unless it is yours and you're trying to recover it, then you could decompile it and fix the damaged code yourself because you'd know what was missing.
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
I tried to make a fuel with my stackedcoal but it didnt work. Can anyone help me?
[Spoiler]
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\mcp\jars\.\crash-reports\crash-2012-08-26_08.32.54-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT cf81d84c --------
Generated 26.08.12 08:32
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_04, Oracle Corporation
- Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 957790016 bytes (913 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_fuel 1.3.2
java.lang.NullPointerException
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:189)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:507)
at net.minecraft.src.mod_fuel.load(mod_fuel.java:12)
at net.minecraft.src.ModLoader.init(ModLoader.java:947)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
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 7c69a239 ----------
[Spoiler/]
This is my code
[Spoiler]
package net.minecraft.src;
public class mod_fuel extends BaseMod
{
public static final Item StackedCoal = new Item(5005).setItemName("StackedCoal");
public static final Item SuperStackedCoal = new Item(5006).setItemName("SuperStackedCoal");
public void load()
{
Do you mean they are seperate Class filles or in the same Class file.
2) When I write:
public class Glass_Stairs extends BaseMod
It creates a confliction because Glass_Stairs is the name of my Class file, but I thought it had to be the same as the name of the Class file. If you could help it would mean a lot
You should not update de tutorial to new version.
Just leave the old and copy it to create the new version.
Could use the Hide button to hide the old one.
I want to finish the tutorial (1.1 or 1.2.5) and understand all before study the new code.
Sorry my english
I have already run out of room on the first post of this topic. I can't keep the old tutorials on there because it simply takes up too much space.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
If this is too hard to explain or you don't know, go ahead and skip over this, but I was wondering if you knew how to use your own items.png for custom textures instead of ModLoader.addOverride, because I add more items than can fit in the empty slots. If you know how to use the Forge feature for this that would be great, but I've heard there are ways to do it without it if you don't know.
For some odd reason my recipes won't work... here's the crash report
---- Minecraft Crash Report ----
// On the bright side, I bought you a teddy bear!
Time: 8/26/12 4:07 PM
Description: ModLoader has failed to initialize.
java.lang.NullPointerException
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:189)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:507)
at net.minecraft.src.mod_salt.load(mod_salt.java:30)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
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)
Relevant Details:
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_02, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 964094648 bytes (919 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_salt 1.3.2
and here's the code
package net.minecraft.src;
import java.util.Random;
public class mod_salt extends BaseMod
{
public static final Block saltOre = new BlockSaltOre(137, 0).setBlockName("saltOre").setHardness(1F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock);
public static final Item salt = new ItemFood(940, 1, 1F, false).setItemName("Salt");
public static final Item saltyPorkchop = new ItemFood(941, 10, 2F, false).setItemName("Salty Porkchop");
public static final Item saltySteak = new ItemFood(942, 10, 2F, true).setItemName("Salty Steak");
public void load()
{
//salt ore
saltOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod/SaltOre.png");
ModLoader.registerBlock(saltOre);
ModLoader.addName(saltOre, "Salt Ore");
//salt
salt.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/salt.png");
ModLoader.addName(salt, "Salt");
//salty porkchop
saltyPorkchop.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/salty porkchop.png");
ModLoader.addName(saltyPorkchop, "Salty Porkchop");
//salty Steak
saltySteak.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/salty steak.png");
ModLoader.addName(saltySteak, "Salty Steak");
//recipes
ModLoader.addSmelting(mod_salt.saltOre.blockID, new ItemStack(salt, 5), .2F);
ModLoader.addRecipe(new ItemStack(saltySteak, 1), new Object []
{" 1 ", " 2 ", '1', salt, '2', Item.beefCooked.iconIndex});
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 20; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(200);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(saltOre.blockID, 15)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.3.2";
}
}
I made a set of tools, with your tutorial, and it worked perfectly, so i quess you can mark it as 1.3.2 compatible. But then i added some recipes, and i used your crafting recipes tutorial for that, it crashes everytime I start my minecraft? Any ideas? Here is my crash report:
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\Mikko\Desktop\Mod\jars\.\crash-reports\crash-2012-08-26_22.59.04-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT a9be3739 --------
Generated 26.8.2012 22:59
- Minecraft Version: 1.3.2
- 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: 973751032 bytes (928 MB) / 1047592960 bytes (999 MB) up to 1047592960 bytes (999 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_WTO 1.3.2
java.lang.StringIndexOutOfBoundsException: String index out of range: 5
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:507)
at net.minecraft.src.mod_WTO.load(mod_WTO.java:74)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
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 f982bf83 ----------
The only help I can give you is, with my recipes if I don't add the spacing for a blank section when crafting, I get errors crafting, sometimes a crash. So for example :
For some odd reason my recipes won't work... here's the crash report
---- Minecraft Crash Report ----
// On the bright side, I bought you a teddy bear!
Time: 8/26/12 4:07 PM
Description: ModLoader has failed to initialize.
java.lang.NullPointerException
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:189)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:507)
at net.minecraft.src.mod_salt.load(mod_salt.java:30)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
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)
Relevant Details:
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_02, Oracle Corporation
- Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 964094648 bytes (919 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_salt 1.3.2
and here's the code
package net.minecraft.src;
import java.util.Random;
public class mod_salt extends BaseMod
{
public static final Block saltOre = new BlockSaltOre(137, 0).setBlockName("saltOre").setHardness(1F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock);
public static final Item salt = new ItemFood(940, 1, 1F, false).setItemName("Salt");
public static final Item saltyPorkchop = new ItemFood(941, 10, 2F, false).setItemName("Salty Porkchop");
public static final Item saltySteak = new ItemFood(942, 10, 2F, true).setItemName("Salty Steak");
public void load()
{
//salt ore
saltOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod/SaltOre.png");
ModLoader.registerBlock(saltOre);
ModLoader.addName(saltOre, "Salt Ore");
//salt
salt.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/salt.png");
ModLoader.addName(salt, "Salt");
//salty porkchop
saltyPorkchop.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/salty porkchop.png");
ModLoader.addName(saltyPorkchop, "Salty Porkchop");
//salty Steak
saltySteak.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/salty steak.png");
ModLoader.addName(saltySteak, "Salty Steak");
//recipes
ModLoader.addSmelting(mod_salt.saltOre.blockID, new ItemStack(salt, 5), .2F);
ModLoader.addRecipe(new ItemStack(saltySteak, 1), new Object []
{" 1 ", " 2 ", '1', salt, '2', Item.beefCooked.iconIndex});
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 20; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(200);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(saltOre.blockID, 15)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.3.2";
}
}
Look at you recipes again. I'll give you an example of one of my smelting and one of my crafting:
Smelting:
ModLoader.addSmelting(Item.egg.shiftedIndex, new ItemStack(HardBoiled, 1), 0.5F);
And a recipe with the need for only the middle and bottom row:
ModLoader.addRecipe(new ItemStack(SunnyEgg, 2), new Object[]{
" ", " E ", " B ", Character.valueOf('E'), Item.egg, Character.valueOf('B'), Item.bowlEmpty});
Ahhh i forgot to change it back to the normal code. I was just messing around with different codes to see if anything else would work but now i've managed to narrow the problem down to the cooked beef... for example this should work but it doesn't seem to
Ahhh i forgot to change it back to the normal code. I was just messing around with different codes to see if anything else would work but now i've managed to narrow the problem down to the cooked beef... for example this should work but it doesn't seem to
If this is too hard to explain or you don't know, go ahead and skip over this, but I was wondering if you knew how to use your own items.png for custom textures instead of ModLoader.addOverride, because I add more items than can fit in the empty slots. If you know how to use the Forge feature for this that would be great, but I've heard there are ways to do it without it if you don't know.
You can't do this in ModLoader, you need to use Forge to do so. Forge has a nice API for this kind of thing.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
Just leave the old and copy it to create the new version.
Could use the Hide button to hide the old one.
I want to finish the tutorial (1.1 or 1.2.5) and understand all before study the new code.
Sorry my english
Thanks! (again
Now for the last thing for this 1 block (
-
View User Profile
-
View Posts
-
Send Message
Retired StaffAre you putting Block.bookshelf in the new ItemStack or are you putting mod_YourMod.JungleBookShelf?
Unless intentionally set up to be able to do so, they are obfuscated and a lot of the code will be messed up on decompile. You're not supposed to be able to do this anyway, as it's the modder's work, not yours...
Unless it is yours and you're trying to recover it, then you could decompile it and fix the damaged code yourself because you'd know what was missing.
[Spoiler]
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\mcp\jars\.\crash-reports\crash-2012-08-26_08.32.54-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT cf81d84c --------
Generated 26.08.12 08:32
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_04, Oracle Corporation
- Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 957790016 bytes (913 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_fuel 1.3.2
java.lang.NullPointerException
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:189)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:507)
at net.minecraft.src.mod_fuel.load(mod_fuel.java:12)
at net.minecraft.src.ModLoader.init(ModLoader.java:947)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
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 7c69a239 ----------
[Spoiler/]
This is my code
[Spoiler]
package net.minecraft.src;
public class mod_fuel extends BaseMod
{
public static final Item StackedCoal = new Item(5005).setItemName("StackedCoal");
public static final Item SuperStackedCoal = new Item(5006).setItemName("SuperStackedCoal");
public void load()
{
//StackedCoal\\
StackedCoal.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/stackedcoal.png");
ModLoader.addName(StackedCoal, "Stacked Coal");
ModLoader.addRecipe(new ItemStack(StackedCoal, 1), new Object [] {"###", "###", "###", '#', Item.coal.iconIndex});
ModLoader.addRecipe(new ItemStack(SuperStackedCoal, 1), new Object [] {"###", "###", "###", '#', StackedCoal.iconIndex});
//SuperStackedCoal\\
SuperStackedCoal.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/superstackedcoal.png");
ModLoader.addName(SuperStackedCoal, "SuperStacked Coal");
ModLoader.addSmelting(mod_fuel.SuperStackedCoal.iconIndex, new ItemStack(Item.diamond, 1), 5);
}
//Fuel for both\\
public int addFuel(int i, int j)
{
if(i == StackedCoal.shiftedIndex)
{
return 14400;
}
return 0;
}
public String getVersion()
{
return "1.3.2";
}
}
[Spoiler/]
Ps: and i dont know how to make spoilers-.-
1) When you write:
Do you mean they are seperate Class filles or in the same Class file.
2) When I write:
It creates a confliction because Glass_Stairs is the name of my Class file, but I thought it had to be the same as the name of the Class file.
If you could help it would mean a lot
I have already run out of room on the first post of this topic. I can't keep the old tutorials on there because it simply takes up too much space.
together they are powerful beyond imagination."
The tool tutorial is outdated
// On the bright side, I bought you a teddy bear!
Time: 8/26/12 4:07 PM
Description: ModLoader has failed to initialize.
java.lang.NullPointerException
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:189)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:507)
at net.minecraft.src.mod_salt.load(mod_salt.java:30)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
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)
Relevant Details:
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_02, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 964094648 bytes (919 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_salt 1.3.2
import java.util.Random;
public class mod_salt extends BaseMod
{
public static final Block saltOre = new BlockSaltOre(137, 0).setBlockName("saltOre").setHardness(1F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock);
public static final Item salt = new ItemFood(940, 1, 1F, false).setItemName("Salt");
public static final Item saltyPorkchop = new ItemFood(941, 10, 2F, false).setItemName("Salty Porkchop");
public static final Item saltySteak = new ItemFood(942, 10, 2F, true).setItemName("Salty Steak");
public void load()
{
//salt ore
saltOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod/SaltOre.png");
ModLoader.registerBlock(saltOre);
ModLoader.addName(saltOre, "Salt Ore");
//salt
salt.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/salt.png");
ModLoader.addName(salt, "Salt");
//salty porkchop
saltyPorkchop.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/salty porkchop.png");
ModLoader.addName(saltyPorkchop, "Salty Porkchop");
//salty Steak
saltySteak.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/salty steak.png");
ModLoader.addName(saltySteak, "Salty Steak");
//recipes
ModLoader.addSmelting(mod_salt.saltOre.blockID, new ItemStack(salt, 5), .2F);
ModLoader.addRecipe(new ItemStack(saltySteak, 1), new Object []
{" 1 ", " 2 ", '1', salt, '2', Item.beefCooked.iconIndex});
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 20; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(200);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(saltOre.blockID, 15)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.3.2";
}
}
The only help I can give you is, with my recipes if I don't add the spacing for a blank section when crafting, I get errors crafting, sometimes a crash. So for example :
{"XXX", "DSD", "S", Character.valueOf('X'), GreenCrystal, Character.valueOf('S'), Item.stick, Character.valueOf('D'), Item.goldNugget});Change to:
"XXX", "DSD", " S ", Character.valueOf('X'), GreenCrystal, Character.valueOf('S'), Item.stick, Character.valueOf('D'), Item.goldNugget});Look at you recipes again. I'll give you an example of one of my smelting and one of my crafting:
Smelting:
And a recipe with the need for only the middle and bottom row:
ModLoader.addRecipe(new ItemStack(SunnyEgg, 2), new Object[]{ " ", " E ", " B ", Character.valueOf('E'), Item.egg, Character.valueOf('B'), Item.bowlEmpty});}
}
Where you able to get it going now?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffYou can't do this in ModLoader, you need to use Forge to do so. Forge has a nice API for this kind of thing.
EDIT:
Never mind, found it in the dyes section
Code and error log? saying "Does not work, I have 11 errors" does nothing for us at all.