Puts everywhere brackets
This commit is contained in:
@@ -124,23 +124,33 @@ public final class MeteoritePlacer
|
||||
Block blk = Block.getBlockById( this.settings.getInteger( "blk" ) );
|
||||
|
||||
if( blk == Blocks.sand )
|
||||
{
|
||||
this.type = new FalloutSand( w, x, y, z, this.putter, this.skyStoneDefinition );
|
||||
}
|
||||
else if( blk == Blocks.hardened_clay )
|
||||
{
|
||||
this.type = new FalloutCopy( w, x, y, z, this.putter, this.skyStoneDefinition );
|
||||
}
|
||||
else if( blk == Blocks.ice || blk == Blocks.snow )
|
||||
{
|
||||
this.type = new FalloutSnow( w, x, y, z, this.putter, this.skyStoneDefinition );
|
||||
}
|
||||
|
||||
int skyMode = this.settings.getInteger( "skyMode" );
|
||||
|
||||
// creator
|
||||
if( skyMode > 10 )
|
||||
{
|
||||
this.placeCrater( w, x, y, z );
|
||||
}
|
||||
|
||||
this.placeMeteorite( w, x, y, z );
|
||||
|
||||
// collapse blocks...
|
||||
if( skyMode > 3 )
|
||||
{
|
||||
this.decay( w, x, y, z );
|
||||
}
|
||||
|
||||
w.done();
|
||||
return true;
|
||||
@@ -161,6 +171,7 @@ public final class MeteoritePlacer
|
||||
boolean changed = false;
|
||||
|
||||
for( int i = minX; i < maxX; i++ )
|
||||
{
|
||||
for( int k = minZ; k < maxZ; k++ )
|
||||
{
|
||||
double dx = i - x;
|
||||
@@ -174,12 +185,17 @@ public final class MeteoritePlacer
|
||||
if( lava && j < y && w.getBlock( x, y - 1, z ).isBlockSolid( w.getWorld(), i, j, k, 0 ) )
|
||||
{
|
||||
if( j > h + distanceFrom * 0.02 )
|
||||
{
|
||||
this.putter.put( w, i, j, k, Blocks.lava );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
changed = this.putter.put( w, i, j, k, Platform.AIR ) || changed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( Object o : w.getWorld().getEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.getBoundingBox( w.minX( x - 30 ), y - 5, w.minZ( z - 30 ), w.maxX( x + 30 ), y + 30, w.maxZ( z + 30 ) ) ) )
|
||||
@@ -198,7 +214,9 @@ public final class MeteoritePlacer
|
||||
|
||||
// spawn meteor
|
||||
for( int i = meteorXLength; i < meteorXHeight; i++ )
|
||||
{
|
||||
for( int j = y - 8; j < y + 8; j++ )
|
||||
{
|
||||
for( int k = meteorZLength; k < meteorZHeight; k++ )
|
||||
{
|
||||
double dx = i - x;
|
||||
@@ -213,6 +231,8 @@ public final class MeteoritePlacer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.SpawnPressesInMeteorites ) )
|
||||
{
|
||||
@@ -229,7 +249,9 @@ public final class MeteoritePlacer
|
||||
int primary = Math.max( 1, (int) ( Math.random() * 4 ) );
|
||||
|
||||
if( primary > 3 ) // in case math breaks...
|
||||
{
|
||||
primary = 3;
|
||||
}
|
||||
|
||||
for( int zz = 0; zz < primary; zz++ )
|
||||
{
|
||||
@@ -241,9 +263,13 @@ public final class MeteoritePlacer
|
||||
duplicate = false;
|
||||
|
||||
if( Math.random() > PRESSES_SPAWN_CHANCE )
|
||||
{
|
||||
r = WorldSettings.getInstance().getNextOrderedValue( "presses" );
|
||||
}
|
||||
else
|
||||
{
|
||||
r = (int) ( Math.random() * 1000 );
|
||||
}
|
||||
|
||||
ItemStack toAdd = null;
|
||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||
@@ -280,9 +306,13 @@ public final class MeteoritePlacer
|
||||
if( toAdd != null )
|
||||
{
|
||||
if( ap.simulateRemove( 1, toAdd, null ) == null )
|
||||
{
|
||||
ap.addItems( toAdd );
|
||||
}
|
||||
else
|
||||
{
|
||||
duplicate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
while( duplicate );
|
||||
@@ -337,12 +367,16 @@ public final class MeteoritePlacer
|
||||
int meteorZHeight = w.maxZ( z + 30 );
|
||||
|
||||
for( int i = meteorXLength; i < meteorXHeight; i++ )
|
||||
{
|
||||
for( int k = meteorZLength; k < meteorZHeight; k++ )
|
||||
{
|
||||
for( int j = y - 9; j < y + 30; j++ )
|
||||
{
|
||||
Block blk = w.getBlock( i, j, k );
|
||||
if( blk == Blocks.lava )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( blk.isReplaceable( w.getWorld(), i, j, k ) )
|
||||
{
|
||||
@@ -397,6 +431,8 @@ public final class MeteoritePlacer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double getSqDistance( int x, int z )
|
||||
@@ -412,11 +448,15 @@ public final class MeteoritePlacer
|
||||
int validBlocks = 0;
|
||||
|
||||
if( !w.hasNoSky() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Block blk = w.getBlock( x, y, z );
|
||||
if( !this.validSpawn.contains( blk ) )
|
||||
{
|
||||
return false; // must spawn on a valid block..
|
||||
}
|
||||
|
||||
this.settings = new NBTTagCompound();
|
||||
this.settings.setInteger( "x", x );
|
||||
@@ -432,33 +472,53 @@ public final class MeteoritePlacer
|
||||
this.settings.setBoolean( "lava", Math.random() > 0.9 );
|
||||
|
||||
if( blk == Blocks.sand )
|
||||
{
|
||||
this.type = new FalloutSand( w, x, y, z, this.putter, this.skyStoneDefinition );
|
||||
}
|
||||
else if( blk == Blocks.hardened_clay )
|
||||
{
|
||||
this.type = new FalloutCopy( w, x, y, z, this.putter, this.skyStoneDefinition );
|
||||
}
|
||||
else if( blk == Blocks.ice || blk == Blocks.snow )
|
||||
{
|
||||
this.type = new FalloutSnow( w, x, y, z, this.putter, this.skyStoneDefinition );
|
||||
}
|
||||
|
||||
int realValidBlocks = 0;
|
||||
|
||||
for( int i = x - 6; i < x + 6; i++ )
|
||||
{
|
||||
for( int j = y - 6; j < y + 6; j++ )
|
||||
{
|
||||
for( int k = z - 6; k < z + 6; k++ )
|
||||
{
|
||||
blk = w.getBlock( i, j, k );
|
||||
if( this.validSpawn.contains( blk ) )
|
||||
{
|
||||
realValidBlocks++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( int i = x - 15; i < x + 15; i++ )
|
||||
{
|
||||
for( int j = y - 15; j < y + 15; j++ )
|
||||
{
|
||||
for( int k = z - 15; k < z + 15; k++ )
|
||||
{
|
||||
blk = w.getBlock( i, j, k );
|
||||
if( this.invalidSpawn.contains( blk ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( this.validSpawn.contains( blk ) )
|
||||
{
|
||||
validBlocks++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int minBLocks = 200;
|
||||
if( validBlocks > minBLocks && realValidBlocks > 80 )
|
||||
@@ -468,32 +528,46 @@ public final class MeteoritePlacer
|
||||
int skyMode = 0;
|
||||
|
||||
for( int i = x - 15; i < x + 15; i++ )
|
||||
{
|
||||
for( int j = y - 15; j < y + 11; j++ )
|
||||
{
|
||||
for( int k = z - 15; k < z + 15; k++ )
|
||||
{
|
||||
if( w.canBlockSeeTheSky( i, j, k ) )
|
||||
{
|
||||
skyMode++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean solid = true;
|
||||
for( int j = y - 15; j < y - 1; j++ )
|
||||
{
|
||||
if( w.getBlock( x, j, z ) == Platform.AIR )
|
||||
{
|
||||
solid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if( !solid )
|
||||
{
|
||||
skyMode = 0;
|
||||
}
|
||||
|
||||
// creator
|
||||
if( skyMode > 10 )
|
||||
{
|
||||
this.placeCrater( w, x, y, z );
|
||||
}
|
||||
|
||||
this.placeMeteorite( w, x, y, z );
|
||||
|
||||
// collapse blocks...
|
||||
if( skyMode > 3 )
|
||||
{
|
||||
this.decay( w, x, y, z );
|
||||
}
|
||||
|
||||
this.settings.setInteger( "skyMode", skyMode );
|
||||
w.done();
|
||||
|
||||
@@ -55,10 +55,14 @@ public final class MeteoriteWorldGen implements IWorldGenerator
|
||||
TickHandler.INSTANCE.addCallable( w, new MeteoriteSpawn( x, depth, z, w ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
TickHandler.INSTANCE.addCallable( w, new MeteoriteSpawn( chunkX << 4, 128, chunkZ << 4, w ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldSettings.getInstance().getCompass().updateArea( w, chunkX, chunkZ );
|
||||
}
|
||||
}
|
||||
|
||||
private boolean tryMeteorite( World w, int depth, int x, int z )
|
||||
@@ -73,12 +77,15 @@ public final class MeteoriteWorldGen implements IWorldGenerator
|
||||
int pz = z >> 4;
|
||||
|
||||
for( int cx = px - 6; cx < px + 6; cx++ )
|
||||
{
|
||||
for( int cz = pz - 6; cz < pz + 6; cz++ )
|
||||
{
|
||||
if( w.getChunkProvider().chunkExists( cx, cz ) )
|
||||
{
|
||||
if( px == cx && pz == cz )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( WorldSettings.getInstance().hasGenerated( w.provider.dimensionId, cx, cz ) )
|
||||
{
|
||||
@@ -87,13 +94,16 @@ public final class MeteoriteWorldGen implements IWorldGenerator
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
depth -= 15;
|
||||
if( depth < 40 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -140,7 +150,9 @@ public final class MeteoriteWorldGen implements IWorldGenerator
|
||||
boolean isCluster = ( minSqDist < 30 * 30 ) && Platform.getRandomFloat() < AEConfig.instance.meteoriteClusterChance;
|
||||
|
||||
if( minSqDist > AEConfig.instance.minMeteoriteDistanceSq || isCluster )
|
||||
{
|
||||
MeteoriteWorldGen.this.tryMeteorite( this.w, this.depth, this.x, this.z );
|
||||
}
|
||||
|
||||
WorldSettings.getInstance().setGenerated( this.w.provider.dimensionId, chunkX, chunkZ );
|
||||
WorldSettings.getInstance().getCompass().updateArea( this.w, chunkX, chunkZ );
|
||||
|
||||
@@ -68,7 +68,9 @@ public final class QuartzWorldGen implements IWorldGenerator
|
||||
}
|
||||
|
||||
if( this.oreNormal == null || this.oreCharged == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double oreDepthMultiplier = AEConfig.instance.quartzOresClusterAmount * seaLevel / 64;
|
||||
int scale = (int) Math.round( r.nextGaussian() * Math.sqrt( oreDepthMultiplier ) + oreDepthMultiplier );
|
||||
|
||||
@@ -52,7 +52,9 @@ public class ChunkOnly extends StandardWorld
|
||||
public int getBlockMetadata( int x, int y, int z )
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
return this.target.getBlockMetadata( x & 0xF, y, z & 0xF );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -60,7 +62,9 @@ public class ChunkOnly extends StandardWorld
|
||||
public Block getBlock( int x, int y, int z )
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
return this.target.getBlock( x & 0xF, y, z & 0xF );
|
||||
}
|
||||
return Platform.AIR;
|
||||
}
|
||||
|
||||
@@ -88,7 +92,9 @@ public class ChunkOnly extends StandardWorld
|
||||
public void done()
|
||||
{
|
||||
if( this.verticalBits != 0 )
|
||||
{
|
||||
Platform.sendChunk( this.target, this.verticalBits );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,24 +28,38 @@ public class Fallout
|
||||
{
|
||||
double a = Math.random();
|
||||
if( a > 0.9 )
|
||||
{
|
||||
this.putter.put( w, x, y, z, Blocks.stone );
|
||||
}
|
||||
else if( a > 0.8 )
|
||||
{
|
||||
this.putter.put( w, x, y, z, Blocks.cobblestone );
|
||||
}
|
||||
else if( a > 0.7 )
|
||||
{
|
||||
this.putter.put( w, x, y, z, Blocks.dirt );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.putter.put( w, x, y, z, Blocks.gravel );
|
||||
}
|
||||
}
|
||||
|
||||
public void getRandomInset( IMeteoriteWorld w, int x, int y, int z )
|
||||
{
|
||||
double a = Math.random();
|
||||
if( a > 0.9 )
|
||||
{
|
||||
this.putter.put( w, x, y, z, Blocks.cobblestone );
|
||||
}
|
||||
else if( a > 0.8 )
|
||||
{
|
||||
this.putter.put( w, x, y, z, Blocks.stone );
|
||||
}
|
||||
else if( a > 0.7 )
|
||||
{
|
||||
this.putter.put( w, x, y, z, Blocks.grass );
|
||||
}
|
||||
else if( a > 0.6 )
|
||||
{
|
||||
for( Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet() )
|
||||
@@ -54,8 +68,12 @@ public class Fallout
|
||||
}
|
||||
}
|
||||
else if( a > 0.5 )
|
||||
{
|
||||
this.putter.put( w, x, y, z, Blocks.gravel );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.putter.put( w, x, y, z, Platform.AIR );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ public class FalloutSand extends FalloutCopy
|
||||
public void getOther( IMeteoriteWorld w, int x, int y, int z, double a )
|
||||
{
|
||||
if( a > GLASS_THRESHOLD )
|
||||
{
|
||||
this.putter.put( w, x, y, z, Blocks.glass );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,9 @@ public class MeteoriteBlockPutter
|
||||
Block original = w.getBlock( i, j, k );
|
||||
|
||||
if( original == Blocks.bedrock || original == blk )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
w.setBlock( i, j, k, blk );
|
||||
return true;
|
||||
|
||||
@@ -52,7 +52,9 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
public int getBlockMetadata( int x, int y, int z )
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
return this.w.getBlockMetadata( x, y, z );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -60,7 +62,9 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
public Block getBlock( int x, int y, int z )
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
return this.w.getBlock( x, y, z );
|
||||
}
|
||||
return Platform.AIR;
|
||||
}
|
||||
|
||||
@@ -68,7 +72,9 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
public boolean canBlockSeeTheSky( int x, int y, int z )
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
return this.w.canBlockSeeTheSky( x, y, z );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -76,7 +82,9 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
public TileEntity getTileEntity( int x, int y, int z )
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
return this.w.getTileEntity( x, y, z );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -90,14 +98,18 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
public void setBlock( int x, int y, int z, Block blk )
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
this.w.setBlock( x, y, z, blk );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlock( int x, int y, int z, Block blk, int metadata, int flags )
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
this.w.setBlock( x, y, z, blk, metadata, flags );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user