Fixed Bugs in DungeonHelper #31

Merged
SenseiKiwi merged 10 commits from master into master 2013-06-24 00:56:05 +00:00
Showing only changes of commit 1ca11f4df3 - Show all commits

View File

@@ -73,13 +73,13 @@ public class PocketGenerator extends ChunkProviderGenerate implements IChunkProv
long factorB = random.nextLong() / 2L * 2L + 1L; long factorB = random.nextLong() / 2L * 2L + 1L;
random.setSeed((long)chunkX * factorA + (long)chunkZ * factorB ^ worldObj.getSeed()); random.setSeed((long)chunkX * factorA + (long)chunkZ * factorB ^ worldObj.getSeed());
int y = 0; int x, y, z;
int x = chunkX * 16 + random.nextInt(16);
int z = chunkZ * 16 + random.nextInt(16);
do do
{ {
x = chunkX * 16 + random.nextInt(32) - 8; x = chunkX * 16 + random.nextInt(32) - 8;
z = chunkZ * 16 + random.nextInt(32) - 8; z = chunkZ * 16 + random.nextInt(32) - 8;
y = 0;
while (worldObj.getBlockId(x, y, z) == 0 && y < 255) while (worldObj.getBlockId(x, y, z) == 0 && y < 255)
{ {
y++; y++;
@@ -98,12 +98,7 @@ public class PocketGenerator extends ChunkProviderGenerate implements IChunkProv
mob.setLocationAndAngles(x, y, z, 1, 1); mob.setLocationAndAngles(x, y, z, 1, 1);
worldObj.spawnEntityInWorld(mob); worldObj.spawnEntityInWorld(mob);
} }
while (yCoordHelper.getFirstUncovered(worldObj,x , y, z) > y); while (yCoordHelper.getFirstUncovered(worldObj, x , y, z) > y || random.nextBoolean());
if (random.nextBoolean())
{
populate(chunkProvider, chunkX, chunkZ);
}
} }
@Override @Override
@@ -128,9 +123,4 @@ public class PocketGenerator extends ChunkProviderGenerate implements IChunkProv
{ {
return null; return null;
} }
} }