I'm having a bit of trouble with making a new block here.
here is my error report
--- BEGIN ERROR REPORT cf05992 --------
Generated 11/5/12 5:49 PM
- Minecraft Version: 1.4.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_07, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 960848680 bytes (916 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
- ModLoader: Mods loaded: 1
ModLoader 1.4.2
java.lang.Error: Unresolved compilation problem:
The method setHardness(float) is undefined for the type BlockNetherIronOre
at net.minecraft.src.mod_sixtychan.<init>(mod_sixtychan.java:11)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:395)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1406)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:190)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:91)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:417)
at net.minecraft.client.Minecraft.run(Minecraft.java:737)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT f369f2f3 ----------
my mod_*** code
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class mod_sixtychan extends BaseMod
{
public static final Block oreNetherIron = new BlockNetherIronOre(160,0).setHardness(2F).setResistance(3F).setLightValue(0F).setBlockName("oreNetherIron").setStepSound(Block.soundStoneFootstep);
public void load()
{
oreNetherIron.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/ironOreNether.png");
ModLoader.registerBlock(oreNetherIron);
ModLoader.addName(oreNetherIron, "Iron Ore");
}
public String getVersion()
{
return "SixtyChan Mod V0.1 Minecraft 1.4.2";
}
}
and my Block code
package net.minecraft.src;
import java.util.Random;
public class BlockNetherIronOre extends BaseMod
{
public BlockNetherIronOre(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1)
{
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_sixtychan.oreNetherIron.shiftedIndex;
}
}
For your block code, you put "shiftedIndex," switch it to blockID.
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
Random randomGenerator = random;
for (int i = 0; i < 7; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(5);
int randPosY = random.nextInt(60);
int randPosZ = chunkZ + randomGenerator.nextInt(5);
new WorldGenMinable(SilverlightOre.blockID, 10).generate(world, random, randPosX, randPosY, randPosZ);
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
Random randomGenerator = random;
for (int i = 0; i < 10; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(5);
int randPosY = random.nextInt(60);
int randPosZ = chunkZ + randomGenerator.nextInt(5);
new WorldGenMinable(SilverlightOre.blockID, 10).generate(world, random, randPosX, randPosY, randPosZ);
}
for (int i = 0; i < 10; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(5);
int randPosY = random.nextInt(60);
int randPosZ = chunkZ + randomGenerator.nextInt(5);
new WorldGenMinable(DarkLightOre.blockID, 10).generate(world, random, randPosX, randPosY, randPosZ);
Doesnt generate that I could fine and no errors on startup or while playing
Yeah I tried that code and it did the same thing :/
So im making a mod which requires ores to be generated. I have the code all written out, but when I try to make a new world to test it, the game freezes on the building world screen. Any help?
public void generateSurface(World world, Random random, int chunkX, int chunkZ){
for(int i = 0; i < 7; i++){
int randPosX = chunkX + random.nextInt(64);
int randPosY = random.nextInt(16);
int randPosZ = chunkZ + random.nextInt(64);
(new WorldGenMinable(OreJeremejevite.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
Help build this new server! PvP,griefing,raiding, if you like all those things come join! First 10 People to join get
3 Diamonds! Amazing players. Please do not ask for OP.
server rules:
No TnT.
PvP allowed.
Greifing allowed.
Raiding allowed.Next 10 people get 3 diamonds!
IGN: Nick354
Age: 10
Do you play any other Oni Clan Games? No i do not
Why you want to join: i want to join because this seems like an amazing server to me :).
How did you hear about this server: i went on the forums and saw this thread.
0
0
For your block code, you put "shiftedIndex," switch it to blockID.
0
0
0
0
0
0
0
0
0
Help build this new server! PvP,griefing,raiding, if you like all those things come join! First 10 People to join get
3 Diamonds! Amazing players. Please do not ask for OP.
server rules:
No TnT.
PvP allowed.
Greifing allowed.
Raiding allowed.Next 10 people get 3 diamonds!
0
Age:10
Do you play any other Oni Clan Games?No.
I want to apply for Guide because i think i would be good at it.
0
Age: 10
Do you play any other Oni Clan Games? No i do not
Why you want to join: i want to join because this seems like an amazing server to me :).
How did you hear about this server: i went on the forums and saw this thread.
0
TheNick354
Hope you enjoy and leave some feedback
0