Reduces visibility of internal fields/methods
Reduces the visibility of all fields to private and create setters/getters when necessary. Exceptions are fields with GuiSync as these need to be public. Reduces the visibility of internal methods to private/protected/default when possible.
This commit is contained in:
@@ -56,8 +56,8 @@ import appeng.worldgen.meteorite.MeteoriteBlockPutter;
|
||||
|
||||
public final class MeteoritePlacer
|
||||
{
|
||||
public static final double PRESSES_SPAWN_CHANCE = 0.7;
|
||||
public static final int SKYSTONE_SPAWN_LIMIT = 12;
|
||||
private static final double PRESSES_SPAWN_CHANCE = 0.7;
|
||||
private static final int SKYSTONE_SPAWN_LIMIT = 12;
|
||||
private final Collection<Block> validSpawn = new HashSet<Block>();
|
||||
private final Collection<Block> invalidSpawn = new HashSet<Block>();
|
||||
private final IBlockDefinition skyChestDefinition;
|
||||
@@ -116,7 +116,7 @@ public final class MeteoritePlacer
|
||||
this.type = new Fallout( this.putter, this.skyStoneDefinition );
|
||||
}
|
||||
|
||||
public boolean spawnMeteorite( final IMeteoriteWorld w, final NBTTagCompound meteoriteBlob )
|
||||
boolean spawnMeteorite( final IMeteoriteWorld w, final NBTTagCompound meteoriteBlob )
|
||||
{
|
||||
this.settings = meteoriteBlob;
|
||||
|
||||
@@ -442,7 +442,7 @@ public final class MeteoritePlacer
|
||||
}
|
||||
}
|
||||
|
||||
public double getSqDistance( final int x, final int z )
|
||||
double getSqDistance( final int x, final int z )
|
||||
{
|
||||
final int chunkX = this.settings.getInteger( "x" ) - x;
|
||||
final int chunkZ = this.settings.getInteger( "z" ) - z;
|
||||
@@ -585,7 +585,7 @@ public final class MeteoritePlacer
|
||||
return false;
|
||||
}
|
||||
|
||||
public NBTTagCompound getSettings()
|
||||
NBTTagCompound getSettings()
|
||||
{
|
||||
return this.settings;
|
||||
}
|
||||
|
||||
@@ -111,12 +111,12 @@ public final class MeteoriteWorldGen implements IWorldGenerator
|
||||
return WorldData.instance().spawnData().getNearByMeteorites( w.provider.getDimensionId(), chunkX, chunkZ );
|
||||
}
|
||||
|
||||
class MeteoriteSpawn implements IWorldCallable<Object>
|
||||
private class MeteoriteSpawn implements IWorldCallable<Object>
|
||||
{
|
||||
|
||||
final int x;
|
||||
final int z;
|
||||
final int depth;
|
||||
private final int x;
|
||||
private final int z;
|
||||
private final int depth;
|
||||
|
||||
public MeteoriteSpawn( final int x, final int depth, final int z )
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.worldgen.meteorite;
|
||||
|
||||
|
||||
@@ -12,10 +13,10 @@ import appeng.util.Platform;
|
||||
public class ChunkOnly extends StandardWorld
|
||||
{
|
||||
|
||||
final Chunk target;
|
||||
final int cx;
|
||||
final int cz;
|
||||
int verticalBits = 0;
|
||||
private final Chunk target;
|
||||
private final int cx;
|
||||
private final int cz;
|
||||
private int verticalBits = 0;
|
||||
|
||||
public ChunkOnly( final World w, final int cx, final int cz )
|
||||
{
|
||||
@@ -65,7 +66,7 @@ public class ChunkOnly extends StandardWorld
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
this.verticalBits |= 1 << ( y >> 4 );
|
||||
this.w.setBlockState( new BlockPos( x, y, z), blk.getDefaultState() );
|
||||
this.getWorld().setBlockState( new BlockPos( x, y, z ), blk.getDefaultState() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +76,7 @@ public class ChunkOnly extends StandardWorld
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
this.verticalBits |= 1 << ( y >> 4 );
|
||||
this.w.setBlockState( new BlockPos( x, y, z ), state, flags & ( ~2 ) );
|
||||
this.getWorld().setBlockState( new BlockPos( x, y, z ), state, flags & ( ~2 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import appeng.util.Platform;
|
||||
|
||||
public class FalloutCopy extends Fallout
|
||||
{
|
||||
public static final double SPECIFIED_BLOCK_THRESHOLD = 0.9;
|
||||
public static final double AIR_BLOCK_THRESHOLD = 0.8;
|
||||
public static final double BLOCK_THRESHOLD_STEP = 0.1;
|
||||
private static final double SPECIFIED_BLOCK_THRESHOLD = 0.9;
|
||||
private static final double AIR_BLOCK_THRESHOLD = 0.8;
|
||||
private static final double BLOCK_THRESHOLD_STEP = 0.1;
|
||||
|
||||
private final IBlockState block;
|
||||
private final MeteoriteBlockPutter putter;
|
||||
|
||||
@@ -7,7 +7,7 @@ import appeng.api.definitions.IBlockDefinition;
|
||||
|
||||
public class FalloutSand extends FalloutCopy
|
||||
{
|
||||
public static final double GLASS_THRESHOLD = 0.66;
|
||||
private static final double GLASS_THRESHOLD = 0.66;
|
||||
private final MeteoriteBlockPutter putter;
|
||||
|
||||
public FalloutSand( final IMeteoriteWorld w, final int x, final int y, final int z, final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition )
|
||||
|
||||
@@ -7,8 +7,8 @@ import appeng.api.definitions.IBlockDefinition;
|
||||
|
||||
public class FalloutSnow extends FalloutCopy
|
||||
{
|
||||
public static final double SNOW_THRESHOLD = 0.7;
|
||||
public static final double ICE_THRESHOLD = 0.5;
|
||||
private static final double SNOW_THRESHOLD = 0.7;
|
||||
private static final double ICE_THRESHOLD = 0.5;
|
||||
private final MeteoriteBlockPutter putter;
|
||||
|
||||
public FalloutSnow( final IMeteoriteWorld w, final int x, final int y, final int z, final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition )
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.worldgen.meteorite;
|
||||
|
||||
|
||||
@@ -21,7 +22,7 @@ public class MeteoriteBlockPutter
|
||||
return true;
|
||||
}
|
||||
|
||||
public void put( final IMeteoriteWorld w, final int i, final int j, final int k, final IBlockState state, final int meta )
|
||||
void put( final IMeteoriteWorld w, final int i, final int j, final int k, final IBlockState state, final int meta )
|
||||
{
|
||||
if( w.getBlock( i, j, k ) == Blocks.bedrock )
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.worldgen.meteorite;
|
||||
|
||||
|
||||
@@ -13,7 +14,7 @@ import appeng.util.Platform;
|
||||
public class StandardWorld implements IMeteoriteWorld
|
||||
{
|
||||
|
||||
protected final World w;
|
||||
private final World w;
|
||||
|
||||
public StandardWorld( final World w )
|
||||
{
|
||||
@@ -47,7 +48,7 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
@Override
|
||||
public boolean hasNoSky()
|
||||
{
|
||||
return !this.w.provider.getHasNoSky();
|
||||
return !this.getWorld().provider.getHasNoSky();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,7 +56,7 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
return this.w.getBlockState( new BlockPos( x, y, z ) ).getBlock();
|
||||
return this.getWorld().getBlockState( new BlockPos( x, y, z ) ).getBlock();
|
||||
}
|
||||
return Platform.AIR_BLOCK;
|
||||
}
|
||||
@@ -65,7 +66,7 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
return this.w.canBlockSeeSky( new BlockPos(x,y,z) );
|
||||
return this.getWorld().canBlockSeeSky( new BlockPos( x, y, z ) );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -75,7 +76,7 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
return this.w.getTileEntity( new BlockPos( x, y, z) );
|
||||
return this.getWorld().getTileEntity( new BlockPos( x, y, z ) );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -91,7 +92,7 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
this.w.setBlockState( new BlockPos( x, y, z ), blk.getDefaultState() );
|
||||
this.getWorld().setBlockState( new BlockPos( x, y, z ), blk.getDefaultState() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +129,7 @@ public class StandardWorld implements IMeteoriteWorld
|
||||
{
|
||||
if( this.range( x, y, z ) )
|
||||
{
|
||||
return this.w.getBlockState( new BlockPos(x,y,z) );
|
||||
return this.w.getBlockState( new BlockPos( x, y, z ) );
|
||||
}
|
||||
return Blocks.air.getDefaultState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user