Ok... but what is my problem? If I remove all ItemStack recipes the same error but different, saying what it said about ItemStack, but about my block variables!
Ok... but what is my problem? If I remove all ItemStack recipes the same error but different, saying what it said about ItemStack, but about my block variables!
According to the error you posted (which helped alot, thanks) there is an error on line 108 in mod_Candy.java
at net.minecraft.src.mod_Candy.<init>(mod_Candy.java:108)
Line 108 is:
ModLoader.AddRecipe(new ItemStack(lolliTopRed, 3), new Object[]{new ItemStack(candyBlockRed,1)});
I think you meant for it to be
ModLoader.AddShapelessRecipe(new ItemStack(lolliTopRed, 3), new Object[]{new ItemStack(candyBlockRed,1)});
net.minecraft.src.ItemStack cannot be cast to java.lang.Character
Because you are using the format for AddShapelessRecipe in a call to AddRecipe, it is trying to 'cast' it as type Character(ie. "XXX","XXX","XXX"), not Itemstack
Thanks SO much! I've had this error for days and I had no idea what it was. Its so obvious when I think about it now, lol
Have some
Your quite welcome. I've only been playing on minecraft for a few weeks and modding for even less. I used to know java so I am trying to help people where I can =]
static paluegostone = (new Block(1492, 0, Material.rock)).setHardness(1.3F).setS
tepSound(Block.soundStoneFootstep).setBlockName("paluegostone");
^
src\minecraft\net\minecraft\src\paluego_mod.java:22: error: <identifier> expecte
d
ModLoader.AddRecipe(new ItemStack(paluegostone, 1), new Object[] {
^
src\minecraft\net\minecraft\src\paluego_mod.java:22: error: illegal start of typ
e
ModLoader.AddRecipe(new ItemStack(paluegostone, 1), new Object[] {
^
src\minecraft\net\minecraft\src\paluego_mod.java:22: error: <identifier> expecte
d
ModLoader.AddRecipe(new ItemStack(paluegostone, 1), new Object[] {
^
src\minecraft\net\minecraft\src\paluego_mod.java:22: error: <identifier> expecte
d
ModLoader.AddRecipe(new ItemStack(paluegostone, 1), new Object[] {
^
src\minecraft\net\minecraft\src\paluego_mod.java:22: error: illegal start of typ
e
ModLoader.AddRecipe(new ItemStack(paluegostone, 1), new Object[] {
^
src\minecraft\net\minecraft\src\paluego_mod.java:22: error: <identifier> expecte
d
ModLoader.AddRecipe(new ItemStack(paluegostone, 1), new Object[] {
^
package net.minecraft.src;
import java.util.Random;
public class mod_darkstone extends BaseMod
{
public static final Block darkstone = new BlockDarkstone(150, 1).setBlockName("darkstone").setHardness(11F).setResistance(12F);
public static final Block infernalore = new BlockInfernalOre(153, 3).setBlockName("infernalore").setHardness(20F).setResistance(150F);
public static final Item darkingot = new Item(4000).setItemName("Darkingot");
public static Item potion = (new ItemFood(15400, 8, false).setItemName("Potion"));
public static final Item blood = new Item(15600).setItemName("Blood");
public static final BlockFlower healthPlant = (BlockFlower)(new BlockFlower(111, 0)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setBlockName("healthPlant");
public static final BlockFlower poisonedEagle = (BlockFlower)(new BlockFlower(115, 0)).setHardness(1.0F).setStepSound(Block.soundGrassFootstep).setBlockName("PoisonedEagle");
public static final Item bottle = new Item(15608).setItemName("Bottle");
public static Item poison = (new ItemFood(15409, -5, false).setItemName("Poison"));
public mod_darkstone ()
{
// Icons
darkstone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/terrain/box.png");
infernalore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/terrain/Infernalore.png");
darkingot.iconIndex = ModLoader.addOverride("/gui/items.png", "/Alex/Symbole/darkingot.png");
potion.iconIndex = ModLoader.addOverride("/gui/items.png", "/Alex/Symbole/trunk.png");
blood.iconIndex = ModLoader.addOverride("/gui/items.png", "/Alex/Symbole/Blood.png");
healthPlant.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Alex/Symbole/healthPlant.png");
bottle.iconIndex = ModLoader.addOverride("/gui/items.png", "/Alex/Symbole/bottle.png");
poison.iconIndex = ModLoader.addOverride("/gui/items.png", "/Alex/Symbole/poison.png");
poisonedEagle.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Alex/Symbole/PoisonedEagle.png");
// Register
ModLoader.RegisterBlock(darkstone);
ModLoader.RegisterBlock(infernalore);
ModLoader.RegisterBlock(healthPlant);
ModLoader.RegisterBlock(poisonedEagle);
// Names
ModLoader.AddName(darkstone, "Darkstone");
ModLoader.AddName(infernalore, "Infernal Ore");
ModLoader.AddName(darkingot, "Darkingot");
ModLoader.AddName(potion, "Potion");
ModLoader.AddName(blood, "Blood");
ModLoader.AddName(healthPlant, "Health Plant");
ModLoader.AddName(bottle, "Bottle");
ModLoader.AddName(poison, "Poison");
ModLoader.AddName(poisonedEagle, "Poisoned Eagle");
// Recipes
ModLoader.AddRecipe(new ItemStack(mod_darkstone.infernalore, 1), new Object[] {"XX", Character.valueOf('X'), Block.cobblestone,});
ModLoader.AddRecipe(new ItemStack(mod_darkstone.darkstone, 1), new Object[] {"XX", Character.valueOf('X'), Block.dirt,});
ModLoader.AddRecipe(new ItemStack(Item.diamond, 3), new Object[] {"XX", Character.valueOf('X'), Block.sand,});
ModLoader.AddRecipe(new ItemStack(mod_darkstone.potion, 3), new Object[] {"X", "Y", "C", Character.valueOf('X'), mod_darkstone.blood, Character.valueOf('Y'), mod_darkstone.healthPlant, Character.valueOf('C'), mod_darkstone.bottle,});
ModLoader.AddRecipe(new ItemStack(mod_darkstone.blood, 3), new Object[] {"XXX", Character.valueOf('X'), mod_darkstone.darkingot,});
ModLoader.AddRecipe(new ItemStack(mod_darkstone.bottle, 1), new Object[] {"X", Character.valueOf('X'), Block.glass,});
ModLoader.AddRecipe(new ItemStack(mod_darkstone.poison, 1), new Object[] {"X", "³", Character.valueOf('X'), mod_darkstone.poisonedEagle, Character.valueOf('³'), mod_darkstone.potion,});
// Smelting
ModLoader.AddSmelting(mod_darkstone.infernalore.blockID, new ItemStack(mod_darkstone.darkingot, 1));
//worldgen flowers
}
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_darkstone.healthPlant.blockID)).generate(var1, var2, var6, var7, var8);
(new WorldGenFlowers(mod_darkstone.poisonedEagle.blockID)).generate(var1, var2, var6, var7, var8);
}
}
//world gen ores
public void GenerateSurface(World world, Random random, int i, int j)
{
for ( int a = 0; a < 20; a++ )
{
int posX = i + random.nextInt(16);
int posY = random.nextInt(128);
int posZ = j + random.nextInt(16);
(new WorldGenMinable(infernalore.blockID, 16)).generate(world, random, posX, posY, posZ);
}
}
public String Version()
{
return "1.7.3";
}
}
the thing that makes trouble is the last part, the ore generation.
when i try to recompile it gives me this massage: " *;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_darkstone.java:79: error: GenerateSurface(Wo
rld,Random,int,int) is already defined in mod_darkstone
public void GenerateSurface(World world, Random random, int i, int j)
^
1 error
==================
> Done in 4.09 seconds
> Recompiling server...
!! Can not find server sources !!
Drücken Sie eine beliebige Taste . . ."
i tried to figure it out by myself, but i couldnt.. can anyone help?
and another question, how can i make my block spawn as common as coal? or even less percentage than diamond?
public void GenerateSurface(World world, Random random, int i, int j)
{
for(a = 0; a < 2; ++a)
{
int posX = i + var2.nextInt(16) + 8;
int posY = random.nextInt(128);
int posZ = j + var2.nextInt(16) + 8;
(new WorldGenFlowers(mod_darkstone.healthPlant.blockID)).generate(var1, var2, var6, var7, var8);
(new WorldGenFlowers(mod_darkstone.poisonedEagle.blockID)).generate(var1, var2, var6, var7, var8);
}
}
//world gen ores
public void GenerateSurface(World world, Random random, int i, int j)
{
for ( int a = 0; a < 20; a++ )
{
int posX = i + random.nextInt(16);
int posY = random.nextInt(128);
int posZ = j + random.nextInt(16);
(new WorldGenMinable(infernalore.blockID, 16)).generate(world, random, posX, posY, posZ);
}
}
public String Version()
{
return "1.7.3";
}
}
the thing that makes trouble is the last part, the ore generation.
when i try to recompile it gives me this massage: " *;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_darkstone.java:79: error: GenerateSurface(Wo
rld,Random,int,int) is already defined in mod_darkstone
public void GenerateSurface(World world, Random random, int i, int j)
^
1 error
==================
> Done in 4.09 seconds
> Recompiling server...
!! Can not find server sources !!
Drücken Sie eine beliebige Taste . . ."
i tried to figure it out by myself, but i couldnt.. can anyone help?
and another question, how can i make my block spawn as common as coal? or even less percentage than diamond?
well i changed some of the var's to ints so you do the rest
I have three things to say, one is that I figured out how to make armour:
Put this part on its own
public static Item helmetNameHere = (new ItemArmor(109, 3, 5, 0)).setItemName("Yourname here");
Put this part in the public mod_MODNAMEHERE block
helmetNameHere.setIconIndex(ModLoader.addOverride("/gui/items.png", "/YourFolder/helmetNamehere.png")).setItemName("helmetNameHere");
I also have a problem with my stuff spawning, I did everything, included .png, but the block(s) wont show up in TMI or the newly generated map.
Here's my class:
package net.minecraft.src;
import java.util.Random;// this is used later in the code
public class mod_SpecialOres extends BaseMod
{
public mod_SpecialOres()
{
ModLoader.RegisterBlock(emeraldOre);
ModLoader.AddName ( emeraldOre, "Emerald Ore" );
emeraldOre.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/SpecialOres/Blocks/EmeraldOre.png");
ModLoader.AddSmelting(emeraldOre.blockID, new ItemStack(emerald, 2));
ModLoader.AddName ( emerald, "Emerald Jewel" );
emerald.iconIndex = ModLoader.addOverride ("/gui/items.png", "/SpecialOres/Items/emerald.png");
ModLoader.RegisterBlock( emeraldBlock );
ModLoader.AddName ( emeraldBlock, "Emerald Block" );
emeraldBlock.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/SpecialOres/Emeraldblock.png");
}
public String Version()
{
return "1.0 for 1.7.3.";
}
public void GenerateSurface(World world, Random random, int i, int j)
{
for ( int a = 0; a < 80; a++ );
{
int posX = i + random.nextInt(16);
int posY = random.nextInt(128);
int posZ = j + random.nextInt(16);
(new WorldGenMinable(emeraldOre.blockID, 18)).generate(world, random, posX, posY, posZ);
}
}
public static final Block emeraldOre;
public static final Block emeraldBlock;
public static final Item emerald = new Item(3111).setItemName("emerald");
static
{emeraldOre = (new Block(801, 798, Material.rock)).setHardness(3.0F).setStepSound(Block.soundStoneFootstep).setBlockName("Emerald Ore");
emeraldBlock = (new Block(802, 799, Material.iron)).setHardness(1.0F).setStepSound(Block.soundMetalFootstep).setBlockName("Emerald Block");}
}
--Edited from initial post--
And last but not least, YOU GUY'S ARE AWESOME!
HERE ARE SOME DIAMONDS
According to the error you posted (which helped alot, thanks) there is an error on line 108 in mod_Candy.java
Line 108 is:
I think you meant for it to be
Because you are using the format for AddShapelessRecipe in a call to AddRecipe, it is trying to 'cast' it as type Character(ie. "XXX","XXX","XXX"), not Itemstack
Have some
Your quite welcome. I've only been playing on minecraft for a few weeks and modding for even less. I used to know java so I am trying to help people where I can =]
Edit: Fixed it, I forgot to add modloader to the .jar file
http://raptr.com/UrbanNinja6?src=em_gamesm" target=""
simple answer:
you forgot to make the second word a capital at the start
sadly another simple mistake but it is something I get caught up with:
in Java letter cases are very important
thanks but I reckon videos are harder to follow
the thing that makes trouble is the last part, the ore generation.
when i try to recompile it gives me this massage: " *;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_darkstone.java:79: error: GenerateSurface(Wo
rld,Random,int,int) is already defined in mod_darkstone
public void GenerateSurface(World world, Random random, int i, int j)
^
1 error
==================
> Done in 4.09 seconds
> Recompiling server...
!! Can not find server sources !!
Drücken Sie eine beliebige Taste . . ."
i tried to figure it out by myself, but i couldnt.. can anyone help?
and another question, how can i make my block spawn as common as coal? or even less percentage than diamond?
well i changed some of the var's to ints so you do the rest
one is that I figured out how to make armour:
Put this part on its own
public static Item helmetNameHere = (new ItemArmor(109, 3, 5, 0)).setItemName("Yourname here");
Put this part in the public mod_MODNAMEHERE block
helmetNameHere.setIconIndex(ModLoader.addOverride("/gui/items.png", "/YourFolder/helmetNamehere.png")).setItemName("helmetNameHere");
ModLoader.AddName(helmetNameHere, "Name Helmet");
ModLoader.AddRecipe(new ItemStack(helmetNameHere), new Object[] {
"###", "# #", Character.valueOf('#'), itemNameHere
});
I also have a problem with my stuff spawning, I did everything, included .png, but the block(s) wont show up in TMI or the newly generated map.
Here's my class:
--Edited from initial post--
And last but not least,
YOU GUY'S ARE AWESOME!
HERE ARE SOME DIAMONDS