Currently, i can recompile it and the client doesn't crash but i can not access the block ingame. It does say that it was initialized and loaded. Does anyone know what i should do and if you can, explain what needs to be changed?
My Code:
package net.minecraft.src;
public class mod_Desks extends BaseMod
{
public void load()
{
ModLoader.RegisterBlock(desk);
ModLoader.AddName(desk, "Desk");
}
public static final Block desk = new BlockDesk(255, 0).setHardness(2.0F).setResistance(5.0F).setBlockName("desk");
public String getVersion()
{
return "1.0.0";
}
public void AddRecipes(CraftingManager craftingmanager)
{
ModLoader.AddRecipe(new ItemStack(desk, 1), new Object[]{
"*", Character.valueOf('*'), Block.dirt
});
}
}
Currently, i can recompile it and the client doesn't crash but the recipe isn't appearing where it says "174 recipes" and i can not access it in game. Does anyone know what i should do and if you can, explain what is being changed?
EDIT: But it does say that it was initialized and loaded.
so does your desk do anything? [ I would like to try it out sometime] Good Luck with it!
I am definitely trying to make it do something. :tongue.gif: Currently i'm having issues accessing it in game though. When i complete the mod i will upload it. :smile.gif:
I got a new error when trying to make a recipe. >.<
Error:
can't find symbol
Symbol: variable block
My Code:
package net.minecraft.src;
public class mod_Desks extends BaseMod
{
public void load()
{
}
public static final Block desk = new BlockDesk(200, 0).setHardness(2.0F).setResistance(5.0F).setBlockName("desk");
public String getVersion()
{
return "1.0.0";
}
public void AddRecipes(CraftingManager craftingmanager)
{
craftingmanager.addRecipe(new ItemStack(desk, 1), new Object[]{
"***", "***", "***", Character.valueOf('*'), block.planks
});
}
}
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\mod_Desks.java:3: mod_Desk is not abstract and does not override abstract method load() in BaseMod
public class mod_Desks extends BaseMod
^
My Code:
package net.minecraft.src;
public class mod_Desks extends BaseMod
{
public static final Block desk = new BlockDesk(97, 0).setHardness(2.0F).setResistance(5.0F).setBlockName("desk");
public String Version()
{
return "1.0.0";
}
}
0
My code:
package net.minecraft.src;
import java.util.Random;
public class BlockDesk extends Block
{
public BlockDesk(int i, int j, int k, material)
{
super(i, j, k, Material.wood);
}
}
What am i doing wrong?
EDIT: added "k," to code.
0
0
0
My Code:
public class mod_Desks extends BaseMod
{
public void load()
{
ModLoader.RegisterBlock(desk);
ModLoader.AddName(desk, "Desk");
}
public static final Block desk = new BlockDesk(255, 0).setHardness(2.0F).setResistance(5.0F).setBlockName("desk");
public String getVersion()
{
return "1.0.0";
}
public void AddRecipes(CraftingManager craftingmanager)
{
ModLoader.AddRecipe(new ItemStack(desk, 1), new Object[]{
"*", Character.valueOf('*'), Block.dirt
});
}
}
0
EDIT: But it does say that it was initialized and loaded.
0
I am definitely trying to make it do something. :tongue.gif: Currently i'm having issues accessing it in game though. When i complete the mod i will upload it. :smile.gif:
0
0
Wow, Thank you. Turns out i just forgot to capitalize something. :smile.gif:
0
Error:
Symbol: variable block
My Code:
public class mod_Desks extends BaseMod
{
public void load()
{
}
public static final Block desk = new BlockDesk(200, 0).setHardness(2.0F).setResistance(5.0F).setBlockName("desk");
public String getVersion()
{
return "1.0.0";
}
public void AddRecipes(CraftingManager craftingmanager)
{
craftingmanager.addRecipe(new ItemStack(desk, 1), new Object[]{
"***", "***", "***", Character.valueOf('*'), block.planks
});
}
}
0
Thank you, it can recompile now but i get a client crash when i test it.
EDIT: The crash was an ID confliction. Thank you for your help, whiteluigi.
0
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\mod_Desks.java:3: mod_Desk is not abstract and does not override abstract method load() in BaseMod
public class mod_Desks extends BaseMod
^
My Code:
public class mod_Desks extends BaseMod
{
public static final Block desk = new BlockDesk(97, 0).setHardness(2.0F).setResistance(5.0F).setBlockName("desk");
public String Version()
{
return "1.0.0";
}
}
0
Error Code