Hi,
I have a feeling that this is an easy error, and that my proofreading just skipped over it, but here is the error:
== MCP v4.3 ==
> Recompiling client...
"C:\Program Files\Java\jdk1.7.0\bin\javac.exe" -g -verbose -classpath "lib/;lib/
*;jars/bin/minecraft.jar;jars/bin/jinput.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_u
til.jar" -sourcepath src/minecraft -d bin/minecraft src/minecraft\net\minecraft\
client\*.java src/minecraft\net\minecraft\isom\*.java src/minecraft\net\minecraf
t\src\*.java conf/patches/*.java failed.
Return code : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Flower.java:16: error: incompatible types
blue = new BlockFlower(145, ModLoader.addOverride("/terrain.png", "/MoreFlowersM
od/BlueFlower.png")).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).se
tBlockName("blue");
^
required: BlockFlower
found: Block
1 error
==================
> Done in 5.62 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .
and the code:
package net.minecraft.src;
import java.util.Random;
public class mod_Flower extends BaseMod
{
public static BlockFlower blue;
public mod_Flower()
{
blue = new BlockFlower(145, ModLoader.addOverride("/terrain.png", "/MoreFlowersMod/BlueFlower.png")).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setBlockName("blue");
ModLoader.RegisterBlock(blue);
ModLoader.AddName(blue, "Blue Flower");
ModLoader.AddRecipe(new ItemStack(Item.dyePowder,2, 4), new Object[] {
"x", Character.valueOf('x'), blue
});
}
public void GenerateSurface(World var1, Random var2, int var3, int var4)
{
int var5;
int var6;
int var7;
int var8;
for(var5 = 0; var5 < 2; ++var5)
{
var6 = var3 + var2.nextInt(16) + 8;
var7 = var2.nextInt(128);
var8 = var4 + var2.nextInt(16) + 8;
(new WorldGenFlowers(mod_Flower.blue.blockID)).generate(var1, var2, var6, var7, var8);
}
}
public String Version()
{
return "1.7.3";
}
}
On a happier note, i was able to fix the item displaying issue! :biggrin.gif:
Why do you declare variables and then assign them later? Instead of that you could just assign them on the same line as they are declared. I think that might be your problem, if you assign the block to the instance variable blue it might fix your problem. Then, instead of a public static final BlockFlower it should just be a public static final Block.
new BlockFlower(145, ModLoader.addOverride("/terrain.png", "/MoreFlowersMod/BlueFlower.png"))
and then on a different line set all the other parts, new BlockFlower would return a BlockFlower object then setting the rest would return a block, but as seeing you're not assigning that to a variable it would act like just a void. A simpler solution would be to cast the block to type BlockFlower:
blue =(BlockFlower)new BlockFlower(145, ModLoader.addOverride("/terrain.png", "/MoreFlowersMod/BlueFlower.png")).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setBlockName("blue");
I am getting a problem, I compile my code and I get an MPC error saying that the package wljgl.opengl does not exist, I fixed this by just putting a copy of the wljgl.jar into the jar folder of mcp and it compiles. When I run the startclient it says the mod loaded correctly, however the game crashes and then says
ModLoader: blockCyplice missing nametag
Can anyone tell me what this means? this happened on the ModLoader.AddName(Block, String).
The thing is I have 1 other block that gets a name added before the one that throws an error, and there is no difference in the two object except one has a light value and one does not, otherwise same class, same declaration, same everything yet that's the only one that throws an error.
new BlockFlower(145, ModLoader.addOverride("/terrain.png", "/MoreFlowersMod/BlueFlower.png"))
and then on a different line set all the other parts, new BlockFlower would return a BlockFlower object then setting the rest would return a block, but as seeing you're not assigning that to a variable it would act like just a void. A simpler solution would be to cast the block to type BlockFlower:
blue =(BlockFlower)new BlockFlower(145, ModLoader.addOverride("/terrain.png", "/MoreFlowersMod/BlueFlower.png")).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setBlockName("blue");
I am getting a problem, I compile my code and I get an MPC error saying that the package wljgl.opengl does not exist, I fixed this by just putting a copy of the wljgl.jar into the jar folder of mcp and it compiles. When I run the startclient it says the mod loaded correctly, however the game crashes and then says
ModLoader: blockCyplice missing nametag
Can anyone tell me what this means? this happened on the ModLoader.AddName(Block, String).
The thing is I have 1 other block that gets a name added before the one that throws an error, and there is no difference in the two object except one has a light value and one does not, otherwise same class, same declaration, same everything yet that's the only one that throws an error.
Did you try updating Mcp? Also, did you try redownloading mcp? Could I see the full error and teh full code?
Did you try updating Mcp? Also, did you try redownloading mcp? Could I see the full error and teh full code?
I'm not getting an error from MCP, and it is the most recent update. The error is in ModLoader.txt. What I'm confused about is why it says success and then crashes because of that error.
well it's not really epic, I only have one main block but I plan on adding a lot to it. I plan on making 50 blocks each coming with tools armor etc. each with their own special purpose, which I already have all 50 planned.
um, strange, I looked at the code for several other modloader mods and they did not have that, plus why would it ONLY be giving an error for the last one and not the ones before it? It obviously did not cause a problem on the previous two blocks.
Also I thought that might have been it and so I put all the setNames and it still gave me same exact error.
make a new generator, for example this code, the WorldGenMinable basically has an if material at pint xyz is rock, if so set it to the mineral, you can change this to if it's grass and go from 128 and down.
Copy this into a new java file called WorldGenSurfacePatch.java:
To use it Go add this line to your GenerateSurface() or GenerateNether()
for(int i3 = 0; i3 < 20; i3++)
{
int j6 = k + rand.nextInt(16);
int k9 = rand.nextInt(128);
int j12 = l + rand.nextInt(16);
(new WorldGenSurfacePatch(Block.grass.blockID, your_mod.your_block.blockID, max_vein_size)).generate(worldObj, rand, j6, k9, j12);
}
and depending what you call the variables, you may change k and l to chunkX and chunkZ
new WorldGenSurfacePatch(Block.grass.blockID, your_mod.your_block.blockID, max_vein_size)
The first argument is what type of block the surface is, it can be grass, sand, gravel, clay, etc, depends what environment you want it to be in, it should only spawn on the top block.
has anyone ever figured out how to solve this error?
== MCP v4.3 ==
> Recompiling client...
"C:\Program Files\Java\jdk1.7.0\bin\javac.exe" -g -verbose -classpath "lib/;lib/
*;jars/bin/minecraft.jar;jars/bin/jinput.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_u
til.jar" -sourcepath src/minecraft -d bin/minecraft src/minecraft\net\minecraft\
client\*.java src/minecraft\net\minecraft\isom\*.java src/minecraft\net\minecraf
t\src\*.java conf/patches/*.java failed.
Return code : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_redCoral.java:5: error: no suitable construc
tor found for Block(int,int)
public static final Block redCoral = new Block(245, 0).setHardness(1.5F).setResi
stance(1.0F).setBlockName("redCoral");
^
constructor Block.Block(int,int,Material) is not applicable
(actual and formal argument lists differ in length)
constructor Block.Block(int,Material) is not applicable
(actual argument int cannot be converted to Material by method invocation conver
sion)
1 error
==================
> Done in 5.20 seconds
> Recompiling server...
> Done in 3.78 seconds
Press any key to continue . . .
with the code:
package net.minecraft.src;
public class mod_redCoral extends BaseMod {
public static final Block redCoral = new Block(245, 0).setHardness(1.5F).setResistance(1.0F).setBlockName("redCoral");
public static final Item redCoralItem = new Item(3443).setItemName("redCoralItem");
public mod_redCoral()
{
ModLoader.RegisterBlock(redCoral);
redCoral.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/OceanMod/redCoral.png");
redCoralItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/OceanMod/redCoral.png");
ModLoader.AddName(redCoral, "Red Coral");
ModLoader.AddName(redCoralItem, "Red Coral");
}
public String Version() {
return "1.7.3";
}
}
You forgot to put in a Material, for a list of materials look in Material.java
For a fix:
public static final Block redCoral = new Block(245, 0, Material.ANYTHINGINMATERIALFILE).setHardness(1.5F).setResistance(1.0F).setBlockName("redCoral");
That's actually not the problem. The problem is that he is trying to use the superclass "Block" as his Constructor. You need to make a new subclass; i.e. BlockRedCoral and create a new .java file with the basic block code in it. (Look at BlockDirt for help.) Another problem that you will run into that is that you need to register your new block with ModLoader. Try this:
public static final Block redCoral = new BlockRedCoral(245, 0).setHardness(1.5F).setResistance(1.0F).setBlockName("redCoral");
The material should be set inside of the BlockRedCoral.java. Be sure you name your new file after what you put as your new block when you declare it.
To register it, put this in your main function of your mod:
ModLoader.RegisterBlock(redCoral);
Should work like a charm once you've done all that =D
EDIT: After thinking about it, your fix would probably work as well, but only if the block is pre-registered in Block.Java.
Changed but still not working :sad.gif:
My ItemMeat.java:
package net.minecraft.src;
public class ItemMeat extends Item
{
private int healAmount;
public ItemMeat (int i)
{
super (i);
maxStackSize = 1;
healAmount=8;
}
public int gethealAmount()
{
return healAmount;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world,EntityPlayer entityplayer)
{
itemstack.stackSize--;
entityplayer.heal(healAmount);
return itemstack;
}
}
Changed but still not working :sad.gif:
My ItemMeat.java:
package net.minecraft.src;
public class ItemMeat extends Item
{
private int healAmount;
public ItemMeat (int i)
{
super (i);
maxStackSize = 1;
healAmount=8;
}
public int gethealAmount()
{
return healAmount;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world,EntityPlayer entityplayer)
{
itemstack.stackSize--;
entityplayer.heal(healAmount);
return itemstack;
}
}
Please help, reward will be
Try making it extend ItemFood. And I think healing items need 2 ints and a boolean? Maybe. Try it.
package net.minecraft.src;
public class Item*** extends ItemFood {
public Item***(int i, int j) {
super(i, j, true);
maxStackSize = (1);
}
}
mod_*** File
package net.minecraft.src;
public class mod_*** extends BaseMod
{
public static final Item *** = new ItemFood(20001, 20, false).setItemName("***");
public mod_***()
{
***.iconIndex = ModLoader.addOverride("/gui/items.png", "/***image/***.png");
ModLoader.AddName(***, "***");
ModLoader.AddRecipe(new ItemStack(***, 1), new Object[]
{
"XXX", "XRX", "XXX", Character.valueOf('X'), new ItemStack(Block.cloth, 1, 14), Character.valueOf('R'), Block.cloth});
}
public String Version()
{
return "1.7.3";
}
}
In the mod_*** file, this line:
public static final Item *** = new ItemFood(20001, 20, false).setItemName("***");
The first number after "new ItemFood(" represents what item ID I want it to have. The second is how much it heals. Third is the boolean, stating whether the wolf will eat it or not.
I have a feeling that this is an easy error, and that my proofreading just skipped over it, but here is the error:
and the code:
On a happier note, i was able to fix the item displaying issue! :biggrin.gif:
Why do you declare variables and then assign them later? Instead of that you could just assign them on the same line as they are declared. I think that might be your problem, if you assign the block to the instance variable blue it might fix your problem. Then, instead of a public static final BlockFlower it should just be a public static final Block.
and then on a different line set all the other parts, new BlockFlower would return a BlockFlower object then setting the rest would return a block, but as seeing you're not assigning that to a variable it would act like just a void. A simpler solution would be to cast the block to type BlockFlower:
I am getting a problem, I compile my code and I get an MPC error saying that the package wljgl.opengl does not exist, I fixed this by just putting a copy of the wljgl.jar into the jar folder of mcp and it compiles. When I run the startclient it says the mod loaded correctly, however the game crashes and then says
Can anyone tell me what this means? this happened on the ModLoader.AddName(Block, String).
The thing is I have 1 other block that gets a name added before the one that throws an error, and there is no difference in the two object except one has a light value and one does not, otherwise same class, same declaration, same everything yet that's the only one that throws an error.
Did you try updating Mcp? Also, did you try redownloading mcp? Could I see the full error and teh full code?
I'm not getting an error from MCP, and it is the most recent update. The error is in ModLoader.txt. What I'm confused about is why it says success and then crashes because of that error.
I'll post code later, I'm short on time.
I know and I said I fixed that. I'll PM you the code so that people don't "steal" it.
I hope it's an epic mod if you are afraid of people stealing it.
RSMC - A massive RPG mod which adds skills and tons of content to Minecraft, one block at a time!
Also I thought that might have been it and so I put all the setNames and it still gave me same exact error.
Copy this into a new java file called WorldGenSurfacePatch.java:
To use it Go add this line to your GenerateSurface() or GenerateNether()
and depending what you call the variables, you may change k and l to chunkX and chunkZ
The first argument is what type of block the surface is, it can be grass, sand, gravel, clay, etc, depends what environment you want it to be in, it should only spawn on the top block.
with the code:
That's actually not the problem. The problem is that he is trying to use the superclass "Block" as his Constructor. You need to make a new subclass; i.e. BlockRedCoral and create a new .java file with the basic block code in it. (Look at BlockDirt for help.) Another problem that you will run into that is that you need to register your new block with ModLoader. Try this:
The material should be set inside of the BlockRedCoral.java. Be sure you name your new file after what you put as your new block when you declare it.
To register it, put this in your main function of your mod:
Should work like a charm once you've done all that =D
EDIT: After thinking about it, your fix would probably work as well, but only if the block is pre-registered in Block.Java.
my mod_food.java:
One thing, I think it should be: instead of:
Also, do you have an "ItemMeat.java" file?
Changed but still not working :sad.gif:
My ItemMeat.java:
Please help, reward will be
Try making it extend ItemFood. And I think healing items need 2 ints and a boolean? Maybe. Try it.
The first number after "new ItemFood(" represents what item ID I want it to have. The second is how much it heals. Third is the boolean, stating whether the wolf will eat it or not.
That's what I did anyways.