I copied the bin and the resources into the jars like it said then I decompiled it.
Thats weird then... Because it says it cant find the .java files that should be decompiled! In this case they are but they still cant find them, so idk :C
I've got my code... Just needs to be compiled to a .class file but DJ says:
C:\Users\---\Desktop\mod_breadmaker.java:1: cannot find symbol
symbol: class BaseMod
public class mod_breadmaker extends BaseMod
^
C:\Users\---\Desktop\mod_breadmaker.java:8: cannot find symbol
symbol : class CraftManager
location: class mod_breadmaker
public void AddRecipes(CraftManager recipes)
^
C:\Users\---\Desktop\mod_breadmaker.java:10: cannot find symbol
symbol : class ItemStack
location: class mod_breadmaker
recipes.addRecipe(new ItemStack(Item.bread, 1), new Object[] {
^
C:\Users\---\Desktop\mod_breadmaker.java:10: cannot find symbol
symbol : variable Item
location: class mod_breadmaker
recipes.addRecipe(new ItemStack(Item.bread, 1), new Object[] {
^
C:\Users\---\Desktop\mod_breadmaker.java:11: cannot find symbol
symbol : variable Block
location: class mod_breadmaker
"S S", " S ", "S S", Character.valueOf('S'), Block.sand
^
5 errors
And my code is:
public class mod_breadmaker extends BaseMod
{
public String Version()
{
return "1.4_01";
}
public void AddRecipes(CraftManager recipes)
{
recipes.addRecipe(new ItemStack(Item.bread, 1), new Object[] {
"S S", " S ", "S S", Character.valueOf('S'), Block.sand
});
}
}
I need help real bad... I'm happy I even got this far, BUT IT MAKES ME SO ANGRY!
I copied the bin and the resources into the jars like it said then I decompiled it.
Thats weird then... Because it says it cant find the .java files that should be decompiled! In this case they are but they still cant find them, so idk :C
Thats odd. because I made a dirt stairs block from MCP and it worked fine, even got it to work in normal minecraft. ModLoader dose something to it i think :/
package net.minecraft.src;
public class mod_PortalStone extends BaseMod
{
public mod_PortalStone()
{
ModLoader.RegisterBlock(portalStone);
//portalStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/emerald.png");
ModLoader.AddName(portalStone, "Emerald");
}
public String Version()
{
return "1.4_01";
}
public static final Block portalStone;
public void AddRecipes(CraftingManager recipes)
{
recipes.addRecipe(new ItemStack(Block.glass, 4), new Object[] {
"# #", " # ", "# #", Character.valueOf('#'), Block.sand
});
}
static
{
portalStone = (new BlockPortalStone(96, 14)).setHardness(0.5F).setBlockName("portalStone");
}
}
and
BlockPortalStone.java
package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
public class BlockPortalStone extends Block
{
protected BlockPortalStone(int i, int j)
{
super(i, j, Material.ground);
}
}
I'm having a few problems here. Using this code exactly, I can get it to recompile and test run with no errors, but the recipe never gets loaded. Also when I remove the comments and try to use a custom image for the block, it crashes because it cannot find the file. Maybe Im saving it in the wrong place? Ive tried the source folder, and inside the bins in the jar folder (yeah, im using the latest version of MCP, and eclipse java ide).
package net.minecraft.src;
public class mod_PortalStone extends BaseMod
{
public mod_PortalStone()
{
ModLoader.RegisterBlock(portalStone);
//portalStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/emerald.png");
ModLoader.AddName(portalStone, "Emerald");
}
public String Version()
{
return "1.4_01";
}
public static final Block portalStone;
public void AddRecipes(CraftingManager recipes)
{
recipes.addRecipe(new ItemStack(Block.glass, 4), new Object[] {
"# #", " # ", "# #", Character.valueOf('#'), Block.sand
});
}
static
{
portalStone = (new BlockPortalStone(96, 14)).setHardness(0.5F).setBlockName("portalStone");
}
}
and
BlockPortalStone.java
package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
public class BlockPortalStone extends Block
{
protected BlockPortalStone(int i, int j)
{
super(i, j, Material.ground);
}
}
I'm having a few problems here. Using this code exactly, I can get it to recompile and test run with no errors, but the recipe never gets loaded. Also when I remove the comments and try to use a custom image for the block, it crashes because it cannot find the file. Maybe Im saving it in the wrong place? Ive tried the source folder, and inside the bins in the jar folder (yeah, im using the latest version of MCP, and eclipse java ide).
Anyone have an idea of what I'm doing wrong?
Put the "public static final Block portalStone;" AFTER the recipes
package net.minecraft.src;
public class mod_TonCraft extends BaseMod
{
public mod_TonCraft()
{
//EmeraldBlock
ModLoader.func_26509_RegisterBlock(emerald);
emerald.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/emerald.png");
ModLoader.AddName(emerald, "Emerald Ore");
//FiredEmerald
firedEmerald.setIconIndex(ModLoader.addOverride("/terrain.png", "/emeraldFired.png"));
ModLoader.AddName(firedEmerald, "Fired Emerald");
//
//Recipes
ModLoader.func_26511_AddRecipe(new ItemStack(emerald, 4), new Object[] {
" ", " # ", " ", Character.valueOf('#'), Block.sand
});
ModLoader.func_26511_AddRecipe(new ItemStack(Item.coal, 4), new Object[] {
" ", " # ", " ", Character.valueOf('#'), Block.dirt
});
ModLoader.func_26503_AddSmelting(emerald.blockID, new ItemStack(firedEmerald, 4));
}
public String Version()
{
return "1.4_01";
}
public static final Block emerald;
public static Item firedEmerald;
static
{
emerald = (new BlockEmerald(97, 14)).setHardness(0.5F).setBlockName("emerald");
firedEmerald = (new ItemFiredEmerald(ModLoader.getUniqueEntityId()).setItemName("firedEmerald"));
}
}
Everything is working good, only problem is that the fired emerald uses a quiver texture and im not sure why? Is defining textures for items with modloader differant from defining textures from blocks?
public class mod_test extends BaseMod
{
public String Version()
{
return "1.4_01";
}
public void AddRecipes(CraftingManager recipes)
{
recipes.addRecipe(new ItemStack(Block.glass, 4), new Object[] {
"# #", " # ", "# #", Character.valueOf('#'), Block.sand
});
}
I get this when I do recomplie
Compiling Minecraft
Sources\minecraft\net\minecraft\src\mod_test.java:12: reached end of file while parasing
>
So, what do I do? Im assuming theres somthing I need to add to the very end but Im not sure what that is :l. So, anyone care to help me? :smile.gif: Thanks in advance!
EDIT:
I was looking at it and assumed that I needed to add } to the end so I did that. Then I tried recompile agen... Errors :l
*** Minecraft Coder Pack Version 2.11 ***
MCP 2.11 running in C:\Users\Kelly\Documents\Minecraft\Modding\MCP (1.4_01)
Compiling Minecraft
sources\minecraft\net\minecraft\src\mod_test.java:7: cannot find symbol
symbol : class CraftingManager
location: class mod_test
public void AddRecipes(CraftingManager recipes)
^
sources\minecraft\net\minecraft\src\mod_test.java:9: cannot find symbol
symbol : class ItemStack
location: class mod_test
recipes.addRecipe(new ItemStack(Block.glass, 4), new Object[] {
^
sources\minecraft\net\minecraft\src\mod_test.java:9: cannot find symbol
symbol : variable Block
location: class mod_test
recipes.addRecipe(new ItemStack(Block.glass, 4), new Object[] {
^
sources\minecraft\net\minecraft\src\mod_test.java:10: cannot find symbol
symbol : variable Block
location: class mod_test
"# #", " # ", "# #", Character.valueOf('#'), Block.sand
^
4 errors
*** minecraft_server.jar was not found, skipping
=== MCP 2.11 recompile script finished ===
Press any key to continue . . .
Help please :biggrin.gif:
Hey man, obviously this guy has no idea about what he is talking about, the error is caused because you put them in the wrong order. first put the code back to
public class mod_test extends BaseMod
{
public String Version()
{
return "1.4_01";
}
public void AddRecipes(CraftingManager recipes)
{
recipes.addRecipe(new ItemStack(Block.glass, 4), new Object[] {
"# #", " # ", "# #", Character.valueOf('#'), Block.sand
});
}
I have made a few major moddifications to your file, it should work now :biggrin.gif: just paste this:
package net.minecraft.src;
public class mod_test extends BaseMod
{
public void Recipes()
{
ModLoader.AddRecipe(new ItemStack(block.glass, 2), new Object[] {
"#", Character.valueOf('#'), block.sand
});
}
public String Version()
{
return "1.7.3";
}
}
And if you get any more errors just say :smile.gif: oh BTW i changed the crafting recipe so just put 1 block of sand anywhere in crafting square :wink.gif:
Come visit this YouTube channel for just Minecraft
Thats weird then... Because it says it cant find the .java files that should be decompiled! In this case they are but they still cant find them, so idk :C
I've got my code... Just needs to be compiled to a .class file but DJ says:
And my code is:
I need help real bad... I'm happy I even got this far, BUT IT MAKES ME SO ANGRY!
~LonelyFoxx
Thats odd. because I made a dirt stairs block from MCP and it worked fine, even got it to work in normal minecraft. ModLoader dose something to it i think :/
Come visit this YouTube channel for just Minecraft
mod_PortalStone.java
and
BlockPortalStone.java
I'm having a few problems here. Using this code exactly, I can get it to recompile and test run with no errors, but the recipe never gets loaded. Also when I remove the comments and try to use a custom image for the block, it crashes because it cannot find the file. Maybe Im saving it in the wrong place? Ive tried the source folder, and inside the bins in the jar folder (yeah, im using the latest version of MCP, and eclipse java ide).
Anyone have an idea of what I'm doing wrong?
Put the "public static final Block portalStone;" AFTER the recipes
Everything is working good, only problem is that the fired emerald uses a quiver texture and im not sure why? Is defining textures for items with modloader differant from defining textures from blocks?
Please help, I get lots of errors like item package doesnt exist! And it says int id is already defined to AddFuel! Please help me...
Hey man, obviously this guy has no idea about what he is talking about, the error is caused because you put them in the wrong order. first put the code back to
I have made a few major moddifications to your file, it should work now :biggrin.gif: just paste this:
And if you get any more errors just say :smile.gif: oh BTW i changed the crafting recipe so just put 1 block of sand anywhere in crafting square :wink.gif: