This is my code. It doesn't work. I have a feeling it's a ModLoader issue. Any ideas?
@Override
public void generateSurface(World world, Random random, int i, int j)
{
for (int k = 0; k < 100; k++)
{
int k2 = i + random.nextInt(16);
int k4 = random.nextInt(64);
int k6 = j + random.nextInt(16);
(new WorldGenMinable(nightmarestone.blockID, 4)).generate(world, random, k2, k4, k6);
}
}
Thanks.
EDIT: Throws no errors, my ore just isn't appearing in the world.
EDIT: Solution:
Ok, i hate giving out code, but here is what i have and it works. SO, study and learn your mistake, cause i can't find any
THIS CODE HERE THAT WORKS FOR ME:
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
randomGenerator = random;
for (int i=0; i < 25; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(16);
int randPosY = random.nextInt(60);
int randPosZ = chunkZ + randomGenerator.nextInt(16);
(new WorldGenMinable(PlatinumOre.blockID, 50)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
think i found ur error: why the flip do you have @Override?
Ok, i hate giving out code, but here is what i have and it works. SO, study and learn your mistake, cause i can't find any
THIS CODE HERE THAT WORKS FOR ME:
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
randomGenerator = random;
for (int i=0; i < 25; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(16);
int randPosY = random.nextInt(60);
int randPosZ = chunkZ + randomGenerator.nextInt(16);
(new WorldGenMinable(PlatinumOre.blockID, 50)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
think i found ur error: why the flip do you have @Override?
Ok, i hate giving out code, but here is what i have and it works. SO, study and learn your mistake, cause i can't find any
THIS CODE HERE THAT WORKS FOR ME:
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
randomGenerator = random;
for (int i=0; i < 25; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(16);
int randPosY = random.nextInt(60);
int randPosZ = chunkZ + randomGenerator.nextInt(16);
(new WorldGenMinable(PlatinumOre.blockID, 50)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
think i found ur error: why the flip do you have @Override?
That method Overrides a method in BaseMod, so I like to keep it so if it changes, eclipse will throw an error at me. Either way, I removed it and it didn't change anything. Trying now copy and paste your code.
EDIT: Nope, still not working. Hm. You're on 1.3.1? Maybe it is my ModLoader.
This is my code. It doesn't work. I have a feeling it's a ModLoader issue. Any ideas?
@Override
public void generateSurface(World world, Random random, int i, int j)
{
for (int k = 0; k < 100; k++)
{
int k2 = i + random.nextInt(16);
int k4 = random.nextInt(64);
int k6 = j + random.nextInt(16);
(new WorldGenMinable(nightmarestone.blockID, 4)).generate(world, random, k2, k4, k6);
}
}
Thanks.
EDIT: Throws no errors, my ore just isn't appearing in the world.
I don't think the ore not spawn, I just think that 100 is a too big number and make it really hard to find, cause this number is the rarity of the block, and i think higher the number is more the ore is rare, so make like I said and put it to 5 just for test
That method Overrides a method in BaseMod, so I like to keep it so if it changes, eclipse will throw an error at me. Either way, I removed it and it didn't change anything. Trying now copy and paste your code.
get rid of the @Override also to test it.
just to test... then test it with if it works.
im am 99% sure you need that random = randomGenerator thingy
Got it. ModLoader was the issue. I downloaded the first release of ModLoader for 1.3.1.
You can see the differences between the newest version of ModLoader, and older:
First ModLoader i downloaded (around a week ago)
public static void populateChunk(IChunkProvider var0, int var1, int var2, World var3)
{
if (!hasInit)
{
init();
logger.fine("Initialized");
}
Random var4 = new Random(var3.getSeed());
long var5 = var4.nextLong() / 2L * 2L + 1L;
long var7 = var4.nextLong() / 2L * 2L + 1L;
var4.setSeed((long)var1 * var5 + (long)var2 * var7 ^ var3.getSeed());
Iterator var9 = modList.iterator();
while (var9.hasNext())
{
BaseMod var10 = (BaseMod)var9.next();
if (var0.makeString().equals("RandomLevelSource"))
{
var10.generateSurface(var3, var4, var1 << 4, var2 << 4);
}
else if (var0.makeString().equals("HellRandomLevelSource"))
{
var10.generateNether(var3, var4, var1 << 4, var2 << 4);
}
}
}
The newest one, downloaded today:
public static void populateChunk(IChunkProvider var0, int var1, int var2, World var3)
{
if (!hasInit)
{
init();
logger.fine("Initialized");
}
Random var4 = new Random(var3.getSeed());
long var5 = var4.nextLong() / 2L * 2L + 1L;
long var7 = var4.nextLong() / 2L * 2L + 1L;
var4.setSeed((long)var1 * var5 + (long)var2 * var7 ^ var3.getSeed());
Iterator var9 = modList.iterator();
while (var9.hasNext())
{
BaseMod var10 = (BaseMod)var9.next();
if (var3.provider.isSurfaceWorld())
{
var10.generateSurface(var3, var4, var1 << 4, var2 << 4);
}
else if (var3.provider.isHellWorld)
{
var10.generateNether(var3, var4, var1 << 4, var2 << 4);
}
}
}
Copy and pasted the code to my Eclipse and it works fine now.
Got it. ModLoader was the issue. I downloaded the first release of ModLoader for 1.3.1.
You can see the differences between the newest version of ModLoader, and older:
First ModLoader i downloaded (around a week ago)
public static void populateChunk(IChunkProvider var0, int var1, int var2, World var3)
{
if (!hasInit)
{
init();
logger.fine("Initialized");
}
Random var4 = new Random(var3.getSeed());
long var5 = var4.nextLong() / 2L * 2L + 1L;
long var7 = var4.nextLong() / 2L * 2L + 1L;
var4.setSeed((long)var1 * var5 + (long)var2 * var7 ^ var3.getSeed());
Iterator var9 = modList.iterator();
while (var9.hasNext())
{
BaseMod var10 = (BaseMod)var9.next();
if (var0.makeString().equals("RandomLevelSource"))
{
var10.generateSurface(var3, var4, var1 << 4, var2 << 4);
}
else if (var0.makeString().equals("HellRandomLevelSource"))
{
var10.generateNether(var3, var4, var1 << 4, var2 << 4);
}
}
}
The newest one, downloaded today:
public static void populateChunk(IChunkProvider var0, int var1, int var2, World var3)
{
if (!hasInit)
{
init();
logger.fine("Initialized");
}
Random var4 = new Random(var3.getSeed());
long var5 = var4.nextLong() / 2L * 2L + 1L;
long var7 = var4.nextLong() / 2L * 2L + 1L;
var4.setSeed((long)var1 * var5 + (long)var2 * var7 ^ var3.getSeed());
Iterator var9 = modList.iterator();
while (var9.hasNext())
{
BaseMod var10 = (BaseMod)var9.next();
if (var3.provider.isSurfaceWorld())
{
var10.generateSurface(var3, var4, var1 << 4, var2 << 4);
}
else if (var3.provider.isHellWorld)
{
var10.generateNether(var3, var4, var1 << 4, var2 << 4);
}
}
}
Copy and pasted the code to my Eclipse and it works fine now.
Sorry i mislead you, i am using forge with/for 1.2.5
Thanks.
EDIT: Throws no errors, my ore just isn't appearing in the world.
EDIT:
Solution:
Nope, throws no errors. Just won't generate at all.
by exampke put the 100 to 5
THIS CODE HERE THAT WORKS FOR ME:
think i found ur error: why the flip do you have @Override?
why that line
its a waste of time no ?
That method Overrides a method in BaseMod, so I like to keep it so if it changes, eclipse will throw an error at me. Either way, I removed it and it didn't change anything. Trying now copy and paste your code.
EDIT: Nope, still not working. Hm. You're on 1.3.1? Maybe it is my ModLoader.
I don't think the ore not spawn, I just think that 100 is a too big number and make it really hard to find, cause this number is the rarity of the block, and i think higher the number is more the ore is rare, so make like I said and put it to 5 just for test
I don't think so... but that question IS coming from the one who couldn't ge tit working no?
no offence
but this works for me... if added that waste 3 secs of your life... better then not working at all =P
edit: and no its not a waste of time, its setting all uses of RANDOM to = randomGenerator.
so it randomly generate =P
get rid of the @Override also to test it.
just to test... then test it with if it works.
im am 99% sure you need that random = randomGenerator thingy
You can see the differences between the newest version of ModLoader, and older:
First ModLoader i downloaded (around a week ago)
The newest one, downloaded today:
Copy and pasted the code to my Eclipse and it works fine now.
Sorry i mislead you, i am using forge with/for 1.2.5
No problem, all good
Alright, glad you got it fixed. ANOTHER FORUM PROBLEM SOLVED