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:
@@ -45,23 +45,23 @@ import appeng.util.Platform;
|
||||
|
||||
public class CachedPlane
|
||||
{
|
||||
final int x_size;
|
||||
final int z_size;
|
||||
final int cx_size;
|
||||
final int cz_size;
|
||||
final int x_offset;
|
||||
final int y_offset;
|
||||
final int z_offset;
|
||||
final int y_size;
|
||||
final Chunk[][] myChunks;
|
||||
final Column[][] myColumns;
|
||||
final LinkedList<TileEntity> tiles = new LinkedList<TileEntity>();
|
||||
final LinkedList<NextTickListEntry> ticks = new LinkedList<NextTickListEntry>();
|
||||
final World world;
|
||||
final IMovableRegistry reg = AEApi.instance().registries().movable();
|
||||
final LinkedList<WorldCoord> updates = new LinkedList<WorldCoord>();
|
||||
private final int x_size;
|
||||
private final int z_size;
|
||||
private final int cx_size;
|
||||
private final int cz_size;
|
||||
private final int x_offset;
|
||||
private final int y_offset;
|
||||
private final int z_offset;
|
||||
private final int y_size;
|
||||
private final Chunk[][] myChunks;
|
||||
private final Column[][] myColumns;
|
||||
private final LinkedList<TileEntity> tiles = new LinkedList<TileEntity>();
|
||||
private final LinkedList<NextTickListEntry> ticks = new LinkedList<NextTickListEntry>();
|
||||
private final World world;
|
||||
private final IMovableRegistry reg = AEApi.instance().registries().movable();
|
||||
private final LinkedList<WorldCoord> updates = new LinkedList<WorldCoord>();
|
||||
private final IBlockDefinition matrixFrame = AEApi.instance().definitions().blocks().matrixFrame();
|
||||
int verticalBits;
|
||||
private int verticalBits;
|
||||
|
||||
public CachedPlane( final World w, final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ )
|
||||
{
|
||||
@@ -121,9 +121,9 @@ public class CachedPlane
|
||||
{
|
||||
final BlockPos cp = tx.getKey();
|
||||
final TileEntity te = tx.getValue();
|
||||
|
||||
|
||||
final BlockPos tePOS = te.getPos();
|
||||
if( tePOS.getX() >= minX && tePOS.getX() <= maxX && tePOS.getY() >= minY && tePOS.getY() <= maxY && tePOS.getZ() >= minZ && tePOS.getZ() <= maxZ )
|
||||
if( tePOS.getX() >= minX && tePOS.getX() <= maxX && tePOS.getY() >= minY && tePOS.getY() <= maxY && tePOS.getZ() >= minZ && tePOS.getZ() <= maxZ )
|
||||
{
|
||||
if( mr.askToMove( te ) )
|
||||
{
|
||||
@@ -153,15 +153,15 @@ public class CachedPlane
|
||||
c.getTileEntityMap().remove( cp );
|
||||
}
|
||||
|
||||
final long k = this.world.getTotalWorldTime();
|
||||
final List list = this.world.getPendingBlockUpdates( c, false );
|
||||
final long k = this.getWorld().getTotalWorldTime();
|
||||
final List list = this.getWorld().getPendingBlockUpdates( c, false );
|
||||
if( list != null )
|
||||
{
|
||||
for( final Object o : list )
|
||||
{
|
||||
final NextTickListEntry entry = (NextTickListEntry) o;
|
||||
final BlockPos tePOS = entry.position;
|
||||
if( tePOS.getX() >= minX && tePOS.getX() <= maxX && tePOS.getY() >= minY && tePOS.getY() <= maxY && tePOS.getZ() >= minZ && tePOS.getZ() <= maxZ )
|
||||
if( tePOS.getX() >= minX && tePOS.getX() <= maxX && tePOS.getY() >= minY && tePOS.getY() <= maxY && tePOS.getZ() >= minZ && tePOS.getZ() <= maxZ )
|
||||
{
|
||||
final NextTickListEntry newEntry = new NextTickListEntry( tePOS, entry.getBlock() );
|
||||
newEntry.scheduledTime = entry.scheduledTime - k;
|
||||
@@ -176,7 +176,7 @@ public class CachedPlane
|
||||
{
|
||||
try
|
||||
{
|
||||
this.world.loadedTileEntityList.remove( te );
|
||||
this.getWorld().loadedTileEntityList.remove( te );
|
||||
}
|
||||
catch( final Exception e )
|
||||
{
|
||||
@@ -300,8 +300,8 @@ public class CachedPlane
|
||||
{
|
||||
AELog.error( e );
|
||||
|
||||
final BlockPos pos = new BlockPos( x,y,z);
|
||||
|
||||
final BlockPos pos = new BlockPos( x, y, z );
|
||||
|
||||
// attempt recovery...
|
||||
te.setWorldObj( this.world );
|
||||
te.setPos( pos );
|
||||
@@ -353,7 +353,7 @@ public class CachedPlane
|
||||
|
||||
for( int y = 1; y < 255; y += 32 )
|
||||
{
|
||||
WorldData.instance().compassData().service().updateArea( this.world, c.xPosition << 4, y, c.zPosition << 4 );
|
||||
WorldData.instance().compassData().service().updateArea( this.getWorld(), c.xPosition << 4, y, c.zPosition << 4 );
|
||||
}
|
||||
|
||||
Platform.sendChunk( c, this.verticalBits );
|
||||
@@ -361,7 +361,17 @@ public class CachedPlane
|
||||
}
|
||||
}
|
||||
|
||||
class Column
|
||||
LinkedList<WorldCoord> getUpdates()
|
||||
{
|
||||
return this.updates;
|
||||
}
|
||||
|
||||
World getWorld()
|
||||
{
|
||||
return this.world;
|
||||
}
|
||||
|
||||
private class Column
|
||||
{
|
||||
|
||||
private final int x;
|
||||
@@ -390,7 +400,7 @@ public class CachedPlane
|
||||
}
|
||||
}
|
||||
|
||||
public void setBlockIDWithMetadata( final int y, final Object[] blk )
|
||||
private void setBlockIDWithMetadata( final int y, final Object[] blk )
|
||||
{
|
||||
for( final Block matrixFrameBlock : CachedPlane.this.matrixFrame.maybeBlock().asSet() )
|
||||
{
|
||||
@@ -406,7 +416,7 @@ public class CachedPlane
|
||||
extendedBlockStorage.setExtBlocklightValue( this.x, y & 15, this.z, (Integer) blk[1] );
|
||||
}
|
||||
|
||||
public Object[] getDetails( final int y )
|
||||
private Object[] getDetails( final int y )
|
||||
{
|
||||
final ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4];
|
||||
this.ch[0] = extendedblockstorage.get( this.x, y & 15, this.z );
|
||||
@@ -414,7 +424,7 @@ public class CachedPlane
|
||||
return this.ch;
|
||||
}
|
||||
|
||||
public boolean doNotSkip( final int y )
|
||||
private boolean doNotSkip( final int y )
|
||||
{
|
||||
final ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4];
|
||||
if( CachedPlane.this.reg.isBlacklisted( extendedblockstorage.getBlockByExtId( this.x, y & 15, this.z ) ) )
|
||||
@@ -425,7 +435,7 @@ public class CachedPlane
|
||||
return this.skipThese == null || !this.skipThese.contains( y );
|
||||
}
|
||||
|
||||
public void setSkip( final int yCoord )
|
||||
private void setSkip( final int yCoord )
|
||||
{
|
||||
if( this.skipThese == null )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user