Meteorites can no generate much taller craters and expand their view of the world as blocks are destroyed so they can keep enlarging up to the max height limit.
This commit is contained in:
parent
14aba981b2
commit
50541cebe6
1 changed files with 31 additions and 7 deletions
|
@ -274,9 +274,18 @@ public class MeteoritePlacer
|
||||||
{
|
{
|
||||||
boolean lava = Math.random() > 0.9;
|
boolean lava = Math.random() > 0.9;
|
||||||
|
|
||||||
for (int i = x - 30; i < x + 30; i++)
|
int maxY = Math.min( y + 20, 255 );
|
||||||
for (int j = y - 5; j < y + 40; j++)
|
int minX = x - 40;
|
||||||
for (int k = z - 30; k < z + 30; k++)
|
int maxX = x + 40;
|
||||||
|
int minZ = z - 40;
|
||||||
|
int maxZ = z + 40;
|
||||||
|
|
||||||
|
for (int j = y - 5; j < maxY; j++)
|
||||||
|
{
|
||||||
|
boolean changed = false;
|
||||||
|
|
||||||
|
for (int i = minX; i < maxX; i++)
|
||||||
|
for (int k = minZ; k < maxZ; k++)
|
||||||
{
|
{
|
||||||
double dx = i - x;
|
double dx = i - x;
|
||||||
double dz = k - z;
|
double dz = k - z;
|
||||||
|
@ -292,10 +301,22 @@ public class MeteoritePlacer
|
||||||
put( w, i, j, k, Blocks.lava );
|
put( w, i, j, k, Blocks.lava );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
put( w, i, j, k, Platform.air );
|
changed = put( w, i, j, k, Platform.air ) || changed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( changed && j > maxY - 5 )
|
||||||
|
{
|
||||||
|
maxY = Math.min( maxY + 5, 255 );
|
||||||
|
|
||||||
|
minX -= 7;
|
||||||
|
maxX += 7;
|
||||||
|
|
||||||
|
minZ -= 7;
|
||||||
|
maxZ += 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Object o : w.getEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.getBoundingBox( x - 30, y - 5, z - 30, x + 30, y + 30, z + 30 ) ))
|
for (Object o : w.getEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.getBoundingBox( x - 30, y - 5, z - 30, x + 30, y + 30, z + 30 ) ))
|
||||||
{
|
{
|
||||||
Entity e = (Entity) o;
|
Entity e = (Entity) o;
|
||||||
|
@ -476,12 +497,15 @@ public class MeteoritePlacer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void put(World w, int i, int j, int k, Block blk)
|
private boolean put(World w, int i, int j, int k, Block blk)
|
||||||
{
|
{
|
||||||
if ( w.getBlock( i, j, k ) == Blocks.bedrock )
|
Block original = w.getBlock( i, j, k );
|
||||||
return;
|
|
||||||
|
if ( original == Blocks.bedrock || original == blk )
|
||||||
|
return false;
|
||||||
|
|
||||||
w.setBlock( i, j, k, blk );
|
w.setBlock( i, j, k, blk );
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void put(World w, int i, int j, int k, Block blk, int meta)
|
private void put(World w, int i, int j, int k, Block blk, int meta)
|
||||||
|
|
Loading…
Reference in a new issue