I am a future developer for Mods.
I have been study how to build mods and i am stuck one error from MCP!
src/minecraft/net/minecraft/src/Block.java:795: cannot find symbol
symbol : constructor uranium(int,int)
location: class net.minecraft.src.uranium
uranium= (new uranium(96, 150)).setHardness(0.3F).setStepSound(soundGlassFootstep).setLightValue(1.0F);
public class Uranium extends Block
{
public Uranium(int blockID)
{
super(blockID, 74, Material.wood);
blockIndexInTexture = 38;
}
public int getBlockTextureFromSide(int side)
{
if(side==1) //Top of block
{
return 43;
}
return blockIndexInTexture;
}
public int quantityDropped(Random random)
{
return 5;
}
public int idDropped(int i, Random random)
{
return Block.wood.blockID;
}
}
This is the Error i get when i recompile!
I am building a mod where you use Uranium for longer lasting source and then build a power plant system which will be used for power Redstone for Unlimited Lengths!
So That About it!
I need Somebody Helps!
Who ever can find the Mistake can you put the coding which i need in your reply!
I am on a mac if that makes a differences!
Check the constructor used in your uranium file. Minecraft is looking for a constructor that accepts two integers, but isn't finding one. If you posted the code for your uranium file I could help further, but for now all I can say is the recompiler isn't able to find a function called uranium that accepts two integers.
Oh, and Minecraft was recently updated, so your mod won't be able to work on the new version.
At first glance, you don't have a constructor for uranium that takes two integers as parameters
More fundamentally, the class name should be capitalized. You should have class net.minecraft.src.Uranium . That way you are creating new variable uranium of type Uranium. Avoids some confusion. If you do have a constructor that takes the right parameters, the caps issue could be causing it. Where did you declare variable uranium? What does that line look like? uranium uranium; ? With the caps it would be Uranium uranium;
Or you could declare it on the same line you define it, Uranium uranium = (new Uranium(blah etc. just make sure you actually have that constructor
Thanks for PMing me about the update. Anyway, the problem is indeed with your constructor. The main Block.java file has two constructors. The first is
protected Block(int i, Material material)
It accepts one integer and a material. The second,
protected Block(int i, int j, Material material)
It accepts two integers and a material. The one you put in your Uranium file is,
public Uranium(int blockID)
It accepts a single integer, yet none of those is what you put in your Block.java file,
uranium= (new uranium(96, 150)).setHardness(0.3F).setStepSound(soundGlassFootstep).setLightValue(1.0F);
You passed it two integers. The first, 96, is of course the block ID. The second, 150, I'm guessing is the location of the texture you want it to use in the terrain.png file, which would be a portion of the bed. However, you later specify the blockIndexInTexture to be 38, which would be... the colorized grass texture. So, you can either keep your code the way it is and choose to pass it only one integer in Block.java, or you can go with the conventions that most of the blocks use and change your constructor to accept two integers, in which case you should probably change your constructor like so,
public Uranium(int blockID, int textureID)
{
super(blockID, textureID, Material.wood);
}
You have lots more options for what constructor to use, and any one of them would be fine. Just make sure the constructor in your file either matches one of the two already laid out in Block.java, or create a new constructor. Just make sure what you pass it when you initialize the block in Block.java matches one of those constructors.
I am a future developer for Mods.
I have been study how to build mods and i am stuck one error from MCP!
src/minecraft/net/minecraft/src/Block.java:795: cannot find symbol
symbol : constructor uranium(int,int)
location: class net.minecraft.src.uranium
uranium= (new uranium(96, 150)).setHardness(0.3F).setStepSound(soundGlassFootstep).setLightValue(1.0F);
This is my Uranium Java File
package net.minecraft.src;
import java.util.Random;
public class Uranium extends Block
{
public Uranium(int blockID)
{
super(blockID, 74, Material.wood);
blockIndexInTexture = 38;
}
public int getBlockTextureFromSide(int side)
{
if(side==1) //Top of block
{
return 43;
}
return blockIndexInTexture;
}
public int quantityDropped(Random random)
{
return 5;
}
public int idDropped(int i, Random random)
{
return Block.wood.blockID;
}
}
This is the Error i get when i recompile!
I am building a mod where you use Uranium for longer lasting source and then build a power plant system which will be used for power Redstone for Unlimited Lengths!
So That About it!
I need Somebody Helps!
Who ever can find the Mistake can you put the coding which i need in your reply!
I am on a mac if that makes a differences!
Thanks!
~Goalrex~
Oh and Have a Diamond
Oh, and Minecraft was recently updated, so your mod won't be able to work on the new version.
More fundamentally, the class name should be capitalized. You should have class net.minecraft.src.Uranium . That way you are creating new variable uranium of type Uranium. Avoids some confusion. If you do have a constructor that takes the right parameters, the caps issue could be causing it. Where did you declare variable uranium? What does that line look like? uranium uranium; ? With the caps it would be Uranium uranium;
Or you could declare it on the same line you define it, Uranium uranium = (new Uranium(blah etc. just make sure you actually have that constructor
It accepts one integer and a material. The second,
It accepts two integers and a material. The one you put in your Uranium file is,
It accepts a single integer, yet none of those is what you put in your Block.java file,
You passed it two integers. The first, 96, is of course the block ID. The second, 150, I'm guessing is the location of the texture you want it to use in the terrain.png file, which would be a portion of the bed. However, you later specify the blockIndexInTexture to be 38, which would be... the colorized grass texture. So, you can either keep your code the way it is and choose to pass it only one integer in Block.java, or you can go with the conventions that most of the blocks use and change your constructor to accept two integers, in which case you should probably change your constructor like so,
You have lots more options for what constructor to use, and any one of them would be fine. Just make sure the constructor in your file either matches one of the two already laid out in Block.java, or create a new constructor. Just make sure what you pass it when you initialize the block in Block.java matches one of those constructors.