hey, if your willing to help me i have some errors in this code. i could do this fine post 1.3.2, but after that it looks like i stuck relearning everything. i havn't worked with smp before.
this is what i currently got. the main issue i am having is setting up the creative tab, that and giving it a texture. here is what i got currently, i am not asking for free code handouts just some help where you think i need it, thanks.
(Another one of those begining "More Block" mods.)
I AM USING FORGE
Copy and paste these into browser as it sometimes goes to wrong link
i don't know, i am using forge. like i said, last time i modded it was 1.2.5.
why am i extending basemod? don't know, that you had to.
why am i using modloader? cause i have forge... thought that is what i am supposed to do...
what do i switch it to?
LanguageRegistry contains the forge equivalent methods to ModLoader.addName, String Localizations, etc. The Mod annotation at the top of your file designates it to be loaded by CPW's custom class loader in Forge, which then will invoke optional methods which are annotated with things such as @Init, @PreInit, @PostInit and have the corresponding parameters as well.
The BaseMod and ModLoader classes are only present in Forge as an abstract layer of compatibility between ModLoader mods and Forge Mods. Forge Mods are NOT supposed to use these files.
LanguageRegistry contains the forge equivalent methods to ModLoader.addName, String Localizations, etc. The Mod annotation at the top of your file designates it to be loaded by CPW's custom class loader in Forge, which then will invoke optional methods which are annotated with things such as @Init, @PreInit, @PostInit and have the corresponding parameters as well.
The BaseMod and ModLoader classes are only present in Forge as an abstract layer of compatibility between ModLoader mods and Forge Mods. Forge Mods are NOT supposed to use these files.
OH, so the language registry is the equivalent of modloader.addName... didn't know that thanks.
i get this error: Return type for the method is missing
Constructor call must be the first statement in a constructor
at these places:
protected PlankGreen(int par1, int par2) //Return type for the method is missing
{
super(par1, par2, Material.rock); //Constructor call must be the first statement in a constructor
this.setCreativeTab(CreativeTabs.tabBlock);
}
Constructors are always named after the class file.
ok fixed that, but how does it know how to set my PlankGreen to the creative tab, or to set its art. i don't mention it in the class once. i am missing something.
Are you saying it doesn't and you want to know how to fix that? Or are you saying it does and you don't get why?
protected PlankGreen(int par1, int par2)
{
super(par1, par2, Material.rock); // The second parameter is the texture index, which tells the game what part of your image to use.
this.setCreativeTab(CreativeTabs.tabBlock); //This tells the game to list it under the correct creative tab
}
Also, you might want to change the material to wood if you're trying to make a plank. And the step sound. It wouldn't make much sense to have a plank sound like stone.
Are you saying it doesn't and you want to know how to fix that? Or are you saying it does and you don't get why?
protected PlankGreen(int par1, int par2)
{
super(par1, par2, Material.rock); // The second parameter is the texture index, which tells the game what part of your image to use.
this.setCreativeTab(CreativeTabs.tabBlock); //This tells the game to list it under the correct creative tab
}
Also, you might want to change the material to wood if you're trying to make a plank. And the step sound. It wouldn't make much sense to have a plank sound like stone.
Yea, sorry about that .rock thing, i am more worried about the bugs and getting it working, i didn't even notice that. fixed it
my question is how it knows im talking about PlankGreen when i don't mention it once.
PlankGreen = new BlockPG(123, 0).setHardness(3F).setStepSound(Block.soundStoneFootstep).setBlockName("blockTutorial");
The above code tells java to use the BlockPG constructor when it creates your object. "This" refers not to the class, but to the object the constructor is creating.
Also, if this
public BlockPG(int i, int j) {
super(i, j, Material.rock);
}
is your constructor, what's this
protected PlankGreen(int par1, int par2)
//ERROR HERE: Multiple markers at this line
//- Return type for the method is missing
//- Duplicate method BlockPG(int, int) in type
//BlockPG
{
super(par1, par2, Material.rock);
//ERROR HERE: Constructor call must be the first statement in a constructor
this.setCreativeTab(CreativeTabs.tabBlock);
}
for? If you want this to be your constructor, you have to make it have the same name as the class file, minus the .class extension.
PlankGreen = new BlockPG(123, 0).setHardness(3F).setStepSound(Block.soundStoneFootstep).setBlockName("blockTutorial");
The above code tells java to use the BlockPG constructor when it creates your object. "This" refers not to the class, but to the object the constructor is creating.
Also, if this
public BlockPG(int i, int j) {
super(i, j, Material.rock);
}
is your constructor, what's this
protected PlankGreen(int par1, int par2)
//ERROR HERE: Multiple markers at this line
//- Return type for the method is missing
//- Duplicate method BlockPG(int, int) in type
//BlockPG
{
super(par1, par2, Material.rock);
//ERROR HERE: Constructor call must be the first statement in a constructor
this.setCreativeTab(CreativeTabs.tabBlock);
}
for? If you want this to be your constructor, you have to make it have the same name as the class file, minus the .class extension.
set block name to same as class.
check out my code now, it kept going to orignal paste no matter what link i posted.
this is what i currently got. the main issue i am having is setting up the creative tab, that and giving it a texture. here is what i got currently, i am not asking for free code handouts just some help where you think i need it, thanks.
(Another one of those begining "More Block" mods.)
I AM USING FORGE
Copy and paste these into browser as it sometimes goes to wrong link
main: http://pastebin.com/wbipAh2M
block: http://pastebin.com/PNnQMvND
sorry for not posting on this site... but it kinda sucks for long post :S
THANKS (read in-code comments for where errors appear)
don't need a link to google.com thank you, used that enough, need to see my history cache?
2. Why in the world are you using ModLoader methods
i don't know, i am using forge. like i said, last time i modded it was 1.2.5.
why am i extending basemod? don't know, that you had to.
why am i using modloader? cause i have forge... thought that is what i am supposed to do...
what do i switch it to?
LanguageRegistry contains the forge equivalent methods to ModLoader.addName, String Localizations, etc. The Mod annotation at the top of your file designates it to be loaded by CPW's custom class loader in Forge, which then will invoke optional methods which are annotated with things such as @Init, @PreInit, @PostInit and have the corresponding parameters as well.
The BaseMod and ModLoader classes are only present in Forge as an abstract layer of compatibility between ModLoader mods and Forge Mods. Forge Mods are NOT supposed to use these files.
OH, so the language registry is the equivalent of modloader.addName... didn't know that thanks.
i get this error: Return type for the method is missing
Constructor call must be the first statement in a constructor
at these places:
Edit: this is in the block class.
ok fixed that, but how does it know how to set my PlankGreen to the creative tab, or to set its art. i don't mention it in the class once. i am missing something.
Also, you might want to change the material to wood if you're trying to make a plank. And the step sound. It wouldn't make much sense to have a plank sound like stone.
Yea, sorry about that .rock thing, i am more worried about the bugs and getting it working, i didn't even notice that. fixed it
my question is how it knows im talking about PlankGreen when i don't mention it once.
I want to set PlankGreen to CreativeTabs.tabBlock not the class made for PlankGreen.
updated link for BlockPG above.
The above code tells java to use the BlockPG constructor when it creates your object. "This" refers not to the class, but to the object the constructor is creating.
Also, if this
is your constructor, what's this
for? If you want this to be your constructor, you have to make it have the same name as the class file, minus the .class extension.
set block name to same as class.
check out my code now, it kept going to orignal paste no matter what link i posted.
updated MainClass
updated BlockPG