Re-worked monolith spawning code
Looks from the top of the world down now, should be more consistent.
|
@ -61,6 +61,9 @@ public class PocketGenerator extends ChunkProviderGenerate implements IChunkProv
|
||||||
{
|
{
|
||||||
//Check whether we want to populate this chunk with Monoliths.
|
//Check whether we want to populate this chunk with Monoliths.
|
||||||
DimData dimData = dimHelper.dimList.get(worldObj.provider.dimensionId);
|
DimData dimData = dimHelper.dimList.get(worldObj.provider.dimensionId);
|
||||||
|
int sanity = 0;
|
||||||
|
int blockID = 0;
|
||||||
|
boolean didSpawn=false;
|
||||||
|
|
||||||
if (dimData == null ||
|
if (dimData == null ||
|
||||||
dimData.dungeonGenerator == null ||
|
dimData.dungeonGenerator == null ||
|
||||||
|
@ -82,26 +85,39 @@ public class PocketGenerator extends ChunkProviderGenerate implements IChunkProv
|
||||||
//Select a random column within the chunk
|
//Select a random column within the chunk
|
||||||
x = chunkX * CHUNK_SIZE + random.nextInt(CHUNK_SIZE);
|
x = chunkX * CHUNK_SIZE + random.nextInt(CHUNK_SIZE);
|
||||||
z = chunkZ * CHUNK_SIZE + random.nextInt(CHUNK_SIZE);
|
z = chunkZ * CHUNK_SIZE + random.nextInt(CHUNK_SIZE);
|
||||||
y = 0;
|
y = MAX_MONOLITH_SPAWN_Y;
|
||||||
|
blockID = worldObj.getBlockId(x, y, z);
|
||||||
|
|
||||||
while (worldObj.getBlockId(x, y, z) == 0 && y < 255)
|
while (blockID == 0 &&y>0)
|
||||||
{
|
{
|
||||||
y++;
|
y--;
|
||||||
|
blockID = worldObj.getBlockId(x, y, z);
|
||||||
|
|
||||||
}
|
}
|
||||||
y = yCoordHelper.getFirstUncovered(worldObj,x , y + 2, z);
|
while(blockID == mod_pocketDim.blockDimWall.blockID&&y>0)
|
||||||
|
{
|
||||||
|
y--;
|
||||||
|
blockID = worldObj.getBlockId(x, y, z);
|
||||||
|
}
|
||||||
|
while (blockID == 0 &&y>0)
|
||||||
|
{
|
||||||
|
y--;
|
||||||
|
blockID = worldObj.getBlockId(x, y, z);
|
||||||
|
|
||||||
|
}
|
||||||
|
if(y > 0)
|
||||||
|
{
|
||||||
|
|
||||||
if (worldObj.getBlockId(x, y - 1, z) != mod_pocketDim.blockDimWall.blockID)
|
|
||||||
{
|
|
||||||
y += random.nextInt(4) + 2;
|
|
||||||
}
|
|
||||||
if (y <= MAX_MONOLITH_SPAWN_Y)
|
|
||||||
{
|
|
||||||
Entity mob = new MobObelisk(worldObj);
|
Entity mob = new MobObelisk(worldObj);
|
||||||
mob.setLocationAndAngles(x, y, z, 1, 1);
|
mob.setLocationAndAngles(x, y+2+random.nextInt(5), z, 1, 1);
|
||||||
worldObj.spawnEntityInWorld(mob);
|
worldObj.spawnEntityInWorld(mob);
|
||||||
|
didSpawn=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sanity++;
|
||||||
|
|
||||||
}
|
}
|
||||||
while (yCoordHelper.getFirstUncovered(worldObj, x , y, z) > y || random.nextBoolean());
|
while (sanity<15&&!didSpawn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 4.9 KiB |
BIN
resources/mods/DimDoors/textures/mobs/testMonolith/Monolith2.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
resources/mods/DimDoors/textures/mobs/testMonolith/Monolith3.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
resources/mods/DimDoors/textures/mobs/testMonolith/Monolith4.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
resources/mods/DimDoors/textures/mobs/testMonolith/Monolith5.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
resources/mods/DimDoors/textures/mobs/testMonolith/Monolith6.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
resources/mods/DimDoors/textures/mobs/testMonolith/Monolith7.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
resources/mods/DimDoors/textures/mobs/testMonolith/Monolith8.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
resources/mods/DimDoors/textures/mobs/testMonolith/Monolith9.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
resources/mods/DimDoors/textures/mobs/testMonolith/monolith0.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
resources/mods/DimDoors/textures/mobs/testMonolith/monolith1.png
Normal file
After Width: | Height: | Size: 3.5 KiB |