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:
yueh
2015-10-08 15:42:42 +02:00
parent f054bd699b
commit e94a0cfccf
497 changed files with 7865 additions and 6908 deletions
@@ -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();
}