I can't get my WorldGen to work correctly in SMP, but in single player it does.
Both SSP and SMP use the same code
this is inside my mod_ .class
public void GenerateSurface(World world, Random random, int chunkX, int chunkZ)
{
byte minY = 122;
byte addY = 4;
int randPosX = chunkX + 64 + random.nextInt(64);
int randPosY = minY + random.nextInt(addY);
int randPosZ = chunkZ + 64 + random.nextInt(64);
int randSize = 32 + random.nextInt(32);
int stormSize = randSize + 16 + random.nextInt(16);
int randCloud = random.nextInt(300);
if (randCloud >= 0 && randCloud <= 20) {(new WorldGenSky(blockCloud.blockID, 0, randSize, minY, addY)).generate(world, random, randPosX, randPosY, randPosZ);}
else if (randCloud >= 100 && randCloud <= 105) {(new WorldGenSky(blockCloud.blockID, 1, randSize, minY, addY)).generate(world, random, randPosX, randPosY, randPosZ);}
else if (randCloud == 300) {(new WorldGenSky(blockCloud.blockID, 2, stormSize, minY, addY)).generate(world, random, randPosX, randPosY, randPosZ);}
}
Here is my WorldGenSky.class
package net.minecraft.src;
import java.util.Random;
public class WorldGenSky extends WorldGenerator
{
private int skyBlockId;
private int subBlock;
private int numberOfBlocks;
private boolean generate;
private int minY;
private int maxY;
public WorldGenSky(int i, int j, int k, int l, int m)
{
skyBlockId = i;
subBlock = j;
numberOfBlocks = k;
minY = l;
maxY = l+m;
}
public boolean generate(World world, Random random, int i, int j, int k)
{
float f = random.nextFloat() * 3.141593F;
double d = (float)(i + 8) + (MathHelper.sin(f) * (float)numberOfBlocks) / 8F;
double d1 = (float)(i + 8) - (MathHelper.sin(f) * (float)numberOfBlocks) / 8F;
double d2 = (float)(k + 8) + (MathHelper.cos(f) * (float)numberOfBlocks) / 8F;
double d3 = (float)(k + 8) - (MathHelper.cos(f) * (float)numberOfBlocks) / 8F;
double d4 = (j + random.nextInt(3)) - 2;
double d5 = (j + random.nextInt(3)) - 2;
for (int l = 0; l <= numberOfBlocks; l++)
{
double d6 = d + ((d1 - d) * (double)l) / (double)numberOfBlocks;
double d7 = d4 + ((d5 - d4) * (double)l) / (double)numberOfBlocks;
double d8 = d2 + ((d3 - d2) * (double)l) / (double)numberOfBlocks;
double d9 = (random.nextDouble() * (double)numberOfBlocks) / 16D;
double d10 = (double)(MathHelper.sin(((float)l * 3.141593F) / (float)numberOfBlocks) + 1.0F) * d9 + 1.0D;
double d11 = (double)(MathHelper.sin(((float)l * 3.141593F) / (float)numberOfBlocks) + 1.0F) * d9 + 1.0D;
int i1 = MathHelper.floor_double(d6 - d10 / 2D);
int j1 = MathHelper.floor_double(d7 - d11 / 2D);
int k1 = MathHelper.floor_double(d8 - d10 / 2D);
int l1 = MathHelper.floor_double(d6 + d10 / 2D);
int i2 = MathHelper.floor_double(d7 + d11 / 2D);
int j2 = MathHelper.floor_double(d8 + d10 / 2D);
for (int k2 = i1; k2 <= l1; k2++)
{
double d12 = (((double)k2 + 0.5D) - d6) / (d10 / 2D);
if (d12 * d12 >= 1.0D)
{
continue;
}
for (int l2 = j1; l2 <= i2; l2++)
{
double d13 = (((double)l2 + 0.5D) - d7) / (d11 / 2D);
if (d12 * d12 + d13 * d13 >= 1.0D)
{
continue;
}
for (int i3 = k1; i3 <= j2; i3++)
{
double d14 = (((double)i3 + 0.5D) - d8) / (d10 / 2D);
if (d12 * d12 + d13 * d13 + d14 * d14 >= 1.0D && world.getBlockId(k2, l2, i3) == 0)
{
continue;
}
while (!generate) {generate = true;}
if (l2 > maxY) {generate = false;}
scan:
for (int x = -2; x < 3; x++)
{
for (int y = -2; y < 3; y++)
{
for (int z = -2; z < 3; z++)
{
int placeId = world.getBlockId(k2 + x, l2 + y, i3 + z);
if (placeId != 0 && placeId != skyBlockId)
{
generate = false;
break scan;
}
}
}
}
if (generate)
{
world.setBlockAndMetadata(k2, l2, i3, skyBlockId, subBlock);
System.out.println("Placing Cloud Block: " + k2 + " : " + l2 + " : " + i3 + " : " + skyBlockId + " : " + subBlock);
}
}
}
}
}
return true;
}
}
For the most part it is just a copy of WorldGenMinable but instead of replacing stone it replaces air and the blocks can't be places near ground blocks.
In single player its perfect, I get scattered minable clouds that are random in shape and size.
But on the server I get mostly large open areas with nothing and rarely patchs of this:
every cloud looks the same and are tightly packed together.
Sometimes it almost works correctly, the clouds look right but are extreemly rare.
I added that system.out.println so I'd know when and where a block was placed, but even though it claims a block is placed if I go to the spot there isn't one.
Both SSP and SMP use the same code
this is inside my mod_ .class
Here is my WorldGenSky.class
For the most part it is just a copy of WorldGenMinable but instead of replacing stone it replaces air and the blocks can't be places near ground blocks.
In single player its perfect, I get scattered minable clouds that are random in shape and size.
But on the server I get mostly large open areas with nothing and rarely patchs of this:
every cloud looks the same and are tightly packed together.
Sometimes it almost works correctly, the clouds look right but are extreemly rare.
I added that system.out.println so I'd know when and where a block was placed, but even though it claims a block is placed if I go to the spot there isn't one.