final variables and parameters
This commit is contained in:
@@ -25,7 +25,7 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
public class BiomeGenStorage extends BiomeGenBase
|
||||
{
|
||||
|
||||
public BiomeGenStorage( int id )
|
||||
public BiomeGenStorage( final int id )
|
||||
{
|
||||
super( id );
|
||||
this.setBiomeName( "Storage Cell" );
|
||||
|
||||
@@ -63,7 +63,7 @@ public class CachedPlane
|
||||
private final IBlockDefinition matrixFrame = AEApi.instance().definitions().blocks().matrixFrame();
|
||||
int verticalBits;
|
||||
|
||||
public CachedPlane( World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ )
|
||||
public CachedPlane( final World w, final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ )
|
||||
{
|
||||
|
||||
this.world = w;
|
||||
@@ -76,15 +76,15 @@ public class CachedPlane
|
||||
this.y_offset = minY;
|
||||
this.z_offset = minZ;
|
||||
|
||||
int minCX = minX >> 4;
|
||||
int minCY = minY >> 4;
|
||||
int minCZ = minZ >> 4;
|
||||
int maxCX = maxX >> 4;
|
||||
int maxCY = maxY >> 4;
|
||||
int maxCZ = maxZ >> 4;
|
||||
final int minCX = minX >> 4;
|
||||
final int minCY = minY >> 4;
|
||||
final int minCZ = minZ >> 4;
|
||||
final int maxCX = maxX >> 4;
|
||||
final int maxCY = maxY >> 4;
|
||||
final int maxCZ = maxZ >> 4;
|
||||
|
||||
this.cx_size = maxCX - minCX + 1;
|
||||
int cy_size = maxCY - minCY + 1;
|
||||
final int cy_size = maxCY - minCY + 1;
|
||||
this.cz_size = maxCZ - minCZ + 1;
|
||||
|
||||
this.myChunks = new Chunk[this.cx_size][this.cz_size];
|
||||
@@ -104,25 +104,25 @@ public class CachedPlane
|
||||
}
|
||||
}
|
||||
|
||||
IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
final IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
|
||||
for( int cx = 0; cx < this.cx_size; cx++ )
|
||||
{
|
||||
for( int cz = 0; cz < this.cz_size; cz++ )
|
||||
{
|
||||
LinkedList<Entry<BlockPos, TileEntity>> rawTiles = new LinkedList<Entry<BlockPos, TileEntity>>();
|
||||
LinkedList<BlockPos> deadTiles = new LinkedList<BlockPos>();
|
||||
final LinkedList<Entry<BlockPos, TileEntity>> rawTiles = new LinkedList<Entry<BlockPos, TileEntity>>();
|
||||
final LinkedList<BlockPos> deadTiles = new LinkedList<BlockPos>();
|
||||
|
||||
Chunk c = w.getChunkFromChunkCoords( minCX + cx, minCZ + cz );
|
||||
final Chunk c = w.getChunkFromChunkCoords( minCX + cx, minCZ + cz );
|
||||
this.myChunks[cx][cz] = c;
|
||||
|
||||
rawTiles.addAll( ( (HashMap<BlockPos, TileEntity>) c.getTileEntityMap() ).entrySet() );
|
||||
for( Entry<BlockPos, TileEntity> tx : rawTiles )
|
||||
for( final Entry<BlockPos, TileEntity> tx : rawTiles )
|
||||
{
|
||||
BlockPos cp = tx.getKey();
|
||||
TileEntity te = tx.getValue();
|
||||
final BlockPos cp = tx.getKey();
|
||||
final TileEntity te = tx.getValue();
|
||||
|
||||
BlockPos tePOS = te.getPos();
|
||||
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( mr.askToMove( te ) )
|
||||
@@ -132,8 +132,8 @@ public class CachedPlane
|
||||
}
|
||||
else
|
||||
{
|
||||
Object[] details = this.myColumns[tePOS.getX() - minX][tePOS.getZ() - minZ].getDetails( tePOS.getY() );
|
||||
Block blk = (Block) details[0];
|
||||
final Object[] details = this.myColumns[tePOS.getX() - minX][tePOS.getZ() - minZ].getDetails( tePOS.getY() );
|
||||
final Block blk = (Block) details[0];
|
||||
|
||||
// don't skip air, just let the code replace it...
|
||||
if( blk != null && blk.isAir( c.getWorld(), tePOS ) && blk.isReplaceable( c.getWorld(), tePOS ) )
|
||||
@@ -148,22 +148,22 @@ public class CachedPlane
|
||||
}
|
||||
}
|
||||
|
||||
for( BlockPos cp : deadTiles )
|
||||
for( final BlockPos cp : deadTiles )
|
||||
{
|
||||
c.getTileEntityMap().remove( cp );
|
||||
}
|
||||
|
||||
long k = this.world.getTotalWorldTime();
|
||||
List list = this.world.getPendingBlockUpdates( c, false );
|
||||
final long k = this.world.getTotalWorldTime();
|
||||
final List list = this.world.getPendingBlockUpdates( c, false );
|
||||
if( list != null )
|
||||
{
|
||||
for( Object o : list )
|
||||
for( final Object o : list )
|
||||
{
|
||||
NextTickListEntry entry = (NextTickListEntry) o;
|
||||
BlockPos tePOS = entry.position;
|
||||
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 )
|
||||
{
|
||||
NextTickListEntry newEntry = new NextTickListEntry( tePOS, entry.getBlock() );
|
||||
final NextTickListEntry newEntry = new NextTickListEntry( tePOS, entry.getBlock() );
|
||||
newEntry.scheduledTime = entry.scheduledTime - k;
|
||||
this.ticks.add( newEntry );
|
||||
}
|
||||
@@ -172,28 +172,28 @@ public class CachedPlane
|
||||
}
|
||||
}
|
||||
|
||||
for( TileEntity te : this.tiles )
|
||||
for( final TileEntity te : this.tiles )
|
||||
{
|
||||
try
|
||||
{
|
||||
this.world.loadedTileEntityList.remove( te );
|
||||
}
|
||||
catch( Exception e )
|
||||
catch( final Exception e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IMovableHandler getHandler( TileEntity te )
|
||||
private IMovableHandler getHandler( final TileEntity te )
|
||||
{
|
||||
IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
final IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
return mr.getHandler( te );
|
||||
}
|
||||
|
||||
void swap( CachedPlane dst )
|
||||
void swap( final CachedPlane dst )
|
||||
{
|
||||
IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
final IMovableRegistry mr = AEApi.instance().registries().movable();
|
||||
|
||||
if( dst.x_size == this.x_size && dst.y_size == this.y_size && dst.z_size == this.z_size )
|
||||
{
|
||||
@@ -205,18 +205,18 @@ public class CachedPlane
|
||||
{
|
||||
for( int z = 0; z < this.z_size; z++ )
|
||||
{
|
||||
Column a = this.myColumns[x][z];
|
||||
Column b = dst.myColumns[x][z];
|
||||
final Column a = this.myColumns[x][z];
|
||||
final Column b = dst.myColumns[x][z];
|
||||
|
||||
for( int y = 0; y < this.y_size; y++ )
|
||||
{
|
||||
int src_y = y + this.y_offset;
|
||||
int dst_y = y + dst.y_offset;
|
||||
final int src_y = y + this.y_offset;
|
||||
final int dst_y = y + dst.y_offset;
|
||||
|
||||
if( a.doNotSkip( src_y ) && b.doNotSkip( dst_y ) )
|
||||
{
|
||||
Object[] aD = a.getDetails( src_y );
|
||||
Object[] bD = b.getDetails( dst_y );
|
||||
final Object[] aD = a.getDetails( src_y );
|
||||
final Object[] bD = b.getDetails( dst_y );
|
||||
|
||||
a.setBlockIDWithMetadata( src_y, bD );
|
||||
b.setBlockIDWithMetadata( dst_y, aD );
|
||||
@@ -234,27 +234,27 @@ public class CachedPlane
|
||||
long duration = endTime - startTime;
|
||||
AELog.info( "Block Copy Time: " + duration );
|
||||
|
||||
for( TileEntity te : this.tiles )
|
||||
for( final TileEntity te : this.tiles )
|
||||
{
|
||||
BlockPos tePOS = te.getPos();
|
||||
final BlockPos tePOS = te.getPos();
|
||||
dst.addTile( tePOS.getX() - this.x_offset, tePOS.getY() - this.y_offset, tePOS.getZ() - this.z_offset, te, this, mr );
|
||||
}
|
||||
|
||||
for( TileEntity te : dst.tiles )
|
||||
for( final TileEntity te : dst.tiles )
|
||||
{
|
||||
BlockPos tePOS = te.getPos();
|
||||
final BlockPos tePOS = te.getPos();
|
||||
this.addTile( tePOS.getX() - dst.x_offset, tePOS.getY() - dst.y_offset, tePOS.getZ() - dst.z_offset, te, dst, mr );
|
||||
}
|
||||
|
||||
for( NextTickListEntry entry : this.ticks )
|
||||
for( final NextTickListEntry entry : this.ticks )
|
||||
{
|
||||
BlockPos tePOS = entry.position;
|
||||
final BlockPos tePOS = entry.position;
|
||||
dst.addTick( tePOS.getX() - this.x_offset, tePOS.getY() - this.y_offset, tePOS.getZ() - this.z_offset, entry );
|
||||
}
|
||||
|
||||
for( NextTickListEntry entry : dst.ticks )
|
||||
for( final NextTickListEntry entry : dst.ticks )
|
||||
{
|
||||
BlockPos tePOS = entry.position;
|
||||
final BlockPos tePOS = entry.position;
|
||||
this.addTick( tePOS.getX() - dst.x_offset, tePOS.getY() - dst.y_offset, tePOS.getZ() - dst.z_offset, entry );
|
||||
}
|
||||
|
||||
@@ -268,39 +268,39 @@ public class CachedPlane
|
||||
}
|
||||
}
|
||||
|
||||
private void markForUpdate( int x, int y, int z )
|
||||
private void markForUpdate( final int x, final int y, final int z )
|
||||
{
|
||||
this.updates.add( new WorldCoord( x, y, z ) );
|
||||
for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
this.updates.add( new WorldCoord( x + d.xOffset, y + d.yOffset, z + d.zOffset ) );
|
||||
}
|
||||
}
|
||||
|
||||
private void addTick( int x, int y, int z, NextTickListEntry entry )
|
||||
private void addTick( final int x, final int y, final int z, final NextTickListEntry entry )
|
||||
{
|
||||
this.world.scheduleUpdate( new BlockPos( x + this.x_offset, y + this.y_offset, z + this.z_offset ), entry.getBlock(), (int) entry.scheduledTime );
|
||||
}
|
||||
|
||||
private void addTile( int x, int y, int z, TileEntity te, CachedPlane alternateDestination, IMovableRegistry mr )
|
||||
private void addTile( final int x, final int y, final int z, final TileEntity te, final CachedPlane alternateDestination, final IMovableRegistry mr )
|
||||
{
|
||||
try
|
||||
{
|
||||
Column c = this.myColumns[x][z];
|
||||
final Column c = this.myColumns[x][z];
|
||||
|
||||
if( c.doNotSkip( y + this.y_offset ) || alternateDestination == null )
|
||||
{
|
||||
IMovableHandler handler = this.getHandler( te );
|
||||
final IMovableHandler handler = this.getHandler( te );
|
||||
|
||||
try
|
||||
{
|
||||
handler.moveTile( te, this.world, new BlockPos( x + this.x_offset, y + this.y_offset, z + this.z_offset ) );
|
||||
}
|
||||
catch( Throwable e )
|
||||
catch( final Throwable e )
|
||||
{
|
||||
AELog.error( e );
|
||||
|
||||
BlockPos pos = new BlockPos( x,y,z);
|
||||
final BlockPos pos = new BlockPos( x,y,z);
|
||||
|
||||
// attempt recovery...
|
||||
te.setWorldObj( this.world );
|
||||
@@ -322,7 +322,7 @@ public class CachedPlane
|
||||
alternateDestination.addTile( x, y, z, te, null, mr );
|
||||
}
|
||||
}
|
||||
catch( Throwable e )
|
||||
catch( final Throwable e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
@@ -336,7 +336,7 @@ public class CachedPlane
|
||||
{
|
||||
for( int z = 0; z < this.cz_size; z++ )
|
||||
{
|
||||
Chunk c = this.myChunks[x][z];
|
||||
final Chunk c = this.myChunks[x][z];
|
||||
c.resetRelightChecks();
|
||||
c.generateSkylightMap();
|
||||
c.setModified( true );
|
||||
@@ -349,7 +349,7 @@ public class CachedPlane
|
||||
for( int z = 0; z < this.cz_size; z++ )
|
||||
{
|
||||
|
||||
Chunk c = this.myChunks[x][z];
|
||||
final Chunk c = this.myChunks[x][z];
|
||||
|
||||
for( int y = 1; y < 255; y += 32 )
|
||||
{
|
||||
@@ -371,7 +371,7 @@ public class CachedPlane
|
||||
private final ExtendedBlockStorage[] storage;
|
||||
private List<Integer> skipThese = null;
|
||||
|
||||
public Column( Chunk chunk, int x, int z, int chunkY, int chunkHeight )
|
||||
public Column( final Chunk chunk, final int x, final int z, final int chunkY, final int chunkHeight )
|
||||
{
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
@@ -381,7 +381,7 @@ public class CachedPlane
|
||||
// make sure storage exists before hand...
|
||||
for( int ay = 0; ay < chunkHeight; ay++ )
|
||||
{
|
||||
int by = ( ay + chunkY );
|
||||
final int by = ( ay + chunkY );
|
||||
ExtendedBlockStorage extendedblockstorage = this.storage[by];
|
||||
if( extendedblockstorage == null )
|
||||
{
|
||||
@@ -390,9 +390,9 @@ public class CachedPlane
|
||||
}
|
||||
}
|
||||
|
||||
public void setBlockIDWithMetadata( int y, Object[] blk )
|
||||
public void setBlockIDWithMetadata( final int y, final Object[] blk )
|
||||
{
|
||||
for( Block matrixFrameBlock : CachedPlane.this.matrixFrame.maybeBlock().asSet() )
|
||||
for( final Block matrixFrameBlock : CachedPlane.this.matrixFrame.maybeBlock().asSet() )
|
||||
{
|
||||
if( blk[0] == matrixFrameBlock )
|
||||
{
|
||||
@@ -400,23 +400,23 @@ public class CachedPlane
|
||||
}
|
||||
}
|
||||
|
||||
ExtendedBlockStorage extendedBlockStorage = this.storage[y >> 4];
|
||||
final ExtendedBlockStorage extendedBlockStorage = this.storage[y >> 4];
|
||||
extendedBlockStorage.set( this.x, y & 15, this.z, (IBlockState) blk[0] );
|
||||
// extendedBlockStorage.setExtBlockID( x, y & 15, z, blk[0] );
|
||||
extendedBlockStorage.setExtBlocklightValue( this.x, y & 15, this.z, (Integer) blk[1] );
|
||||
}
|
||||
|
||||
public Object[] getDetails( int y )
|
||||
public Object[] getDetails( final int y )
|
||||
{
|
||||
ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4];
|
||||
final ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4];
|
||||
this.ch[0] = extendedblockstorage.get( this.x, y & 15, this.z );
|
||||
this.ch[1] = extendedblockstorage.getExtBlocklightValue( this.x, y & 15, this.z );
|
||||
return this.ch;
|
||||
}
|
||||
|
||||
public boolean doNotSkip( int y )
|
||||
public boolean doNotSkip( final int y )
|
||||
{
|
||||
ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4];
|
||||
final ExtendedBlockStorage extendedblockstorage = this.storage[y >> 4];
|
||||
if( CachedPlane.this.reg.isBlacklisted( extendedblockstorage.getBlockByExtId( this.x, y & 15, this.z ) ) )
|
||||
{
|
||||
return false;
|
||||
@@ -425,7 +425,7 @@ public class CachedPlane
|
||||
return this.skipThese == null || !this.skipThese.contains( y );
|
||||
}
|
||||
|
||||
public void setSkip( int yCoord )
|
||||
public void setSkip( final int yCoord )
|
||||
{
|
||||
if( this.skipThese == null )
|
||||
{
|
||||
|
||||
@@ -37,18 +37,18 @@ public class DefaultSpatialHandler implements IMovableHandler
|
||||
* @return true
|
||||
*/
|
||||
@Override
|
||||
public boolean canHandle( Class<? extends TileEntity> myClass, TileEntity tile )
|
||||
public boolean canHandle( final Class<? extends TileEntity> myClass, final TileEntity tile )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveTile( TileEntity te, World w, BlockPos newPosition )
|
||||
public void moveTile( final TileEntity te, final World w, final BlockPos newPosition )
|
||||
{
|
||||
te.setWorldObj( w );
|
||||
te.setPos( newPosition );
|
||||
|
||||
Chunk c = w.getChunkFromBlockCoords( newPosition );
|
||||
final Chunk c = w.getChunkFromBlockCoords( newPosition );
|
||||
c.addTileEntity( newPosition, te );
|
||||
|
||||
if( c.isLoaded() )
|
||||
|
||||
@@ -43,7 +43,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate
|
||||
{
|
||||
BLOCKS = new Block[255 * SQUARE_CHUNK_SIZE];
|
||||
|
||||
for( Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() )
|
||||
for( final Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() )
|
||||
{
|
||||
for( int x = 0; x < BLOCKS.length; x++ )
|
||||
{
|
||||
@@ -54,19 +54,19 @@ public class StorageChunkProvider extends ChunkProviderGenerate
|
||||
|
||||
final World world;
|
||||
|
||||
public StorageChunkProvider( World world, long i )
|
||||
public StorageChunkProvider( final World world, final long i )
|
||||
{
|
||||
super( world, i, false, null );
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Chunk provideChunk( int x, int z )
|
||||
public Chunk provideChunk( final int x, final int z )
|
||||
{
|
||||
Chunk chunk = new Chunk( this.world, x, z );
|
||||
final Chunk chunk = new Chunk( this.world, x, z );
|
||||
|
||||
byte[] biomes = chunk.getBiomeArray();
|
||||
AEConfig config = AEConfig.instance;
|
||||
final byte[] biomes = chunk.getBiomeArray();
|
||||
final AEConfig config = AEConfig.instance;
|
||||
|
||||
for( int k = 0; k < biomes.length; ++k )
|
||||
{
|
||||
@@ -83,7 +83,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populate( IChunkProvider par1iChunkProvider, int par2, int par3 )
|
||||
public void populate( final IChunkProvider par1iChunkProvider, final int par2, final int par3 )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getPossibleCreatures( EnumCreatureType creatureType, BlockPos pos )
|
||||
public List getPossibleCreatures( final EnumCreatureType creatureType, final BlockPos pos )
|
||||
{
|
||||
return new ArrayList();
|
||||
}
|
||||
|
||||
@@ -63,11 +63,11 @@ public class StorageHelper
|
||||
*
|
||||
* @return teleported entity
|
||||
*/
|
||||
public Entity teleportEntity( Entity entity, TelDestination link )
|
||||
public Entity teleportEntity( Entity entity, final TelDestination link )
|
||||
{
|
||||
WorldServer oldWorld;
|
||||
WorldServer newWorld;
|
||||
EntityPlayerMP player;
|
||||
final WorldServer oldWorld;
|
||||
final WorldServer newWorld;
|
||||
final EntityPlayerMP player;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -75,7 +75,7 @@ public class StorageHelper
|
||||
newWorld = (WorldServer) link.dim;
|
||||
player = ( entity instanceof EntityPlayerMP ) ? (EntityPlayerMP) entity : null;
|
||||
}
|
||||
catch( Throwable e )
|
||||
catch( final Throwable e )
|
||||
{
|
||||
return entity;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public class StorageHelper
|
||||
// load the chunk!
|
||||
WorldServer.class.cast( newWorld ).getChunkProvider().provideChunk( MathHelper.floor_double( link.x ) >> 4, MathHelper.floor_double( link.z ) >> 4 );
|
||||
|
||||
boolean diffDestination = newWorld != oldWorld;
|
||||
final boolean diffDestination = newWorld != oldWorld;
|
||||
if( diffDestination )
|
||||
{
|
||||
if( player != null )
|
||||
@@ -120,8 +120,8 @@ public class StorageHelper
|
||||
}
|
||||
else
|
||||
{
|
||||
int entX = entity.chunkCoordX;
|
||||
int entZ = entity.chunkCoordZ;
|
||||
final int entX = entity.chunkCoordX;
|
||||
final int entZ = entity.chunkCoordZ;
|
||||
|
||||
if( ( entity.addedToChunk ) && ( oldWorld.getChunkProvider().chunkExists( entX, entZ ) ) )
|
||||
{
|
||||
@@ -129,7 +129,7 @@ public class StorageHelper
|
||||
oldWorld.getChunkFromChunkCoords( entX, entZ ).setModified( true );
|
||||
}
|
||||
|
||||
Entity newEntity = EntityList.createEntityByName( EntityList.getEntityString( entity ), newWorld );
|
||||
final Entity newEntity = EntityList.createEntityByName( EntityList.getEntityString( entity ), newWorld );
|
||||
if( newEntity != null )
|
||||
{
|
||||
entity.lastTickPosX = entity.prevPosX = entity.posX = link.x;
|
||||
@@ -138,7 +138,7 @@ public class StorageHelper
|
||||
|
||||
if( entity instanceof EntityHanging )
|
||||
{
|
||||
EntityHanging h = (EntityHanging) entity;
|
||||
final EntityHanging h = (EntityHanging) entity;
|
||||
h.setPosition( link.x, link.y, link.z ); // TODO: VERIFIY THIS WORKS
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ public class StorageHelper
|
||||
return entity;
|
||||
}
|
||||
|
||||
public void transverseEdges( int minX, int minY, int minZ, int maxX, int maxY, int maxZ, ISpatialVisitor visitor )
|
||||
public void transverseEdges( final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ, final ISpatialVisitor visitor )
|
||||
{
|
||||
for( int y = minY; y < maxY; y++ )
|
||||
{
|
||||
@@ -206,42 +206,42 @@ public class StorageHelper
|
||||
}
|
||||
}
|
||||
|
||||
public void swapRegions( World src /** over world **/, World dst /** storage cell **/, int x, int y, int z, int i, int j, int k, int scaleX, int scaleY, int scaleZ )
|
||||
public void swapRegions( final World src /** over world **/, final World dst /** storage cell **/, final int x, final int y, final int z, final int i, final int j, final int k, final int scaleX, final int scaleY, final int scaleZ )
|
||||
{
|
||||
for( Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() )
|
||||
for( final Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().asSet() )
|
||||
{
|
||||
this.transverseEdges( i - 1, j - 1, k - 1, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1, new WrapInMatrixFrame( matrixFrameBlock.getDefaultState(), dst ) );
|
||||
}
|
||||
|
||||
AxisAlignedBB srcBox = AxisAlignedBB.fromBounds( x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1 );
|
||||
final AxisAlignedBB srcBox = AxisAlignedBB.fromBounds( x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1 );
|
||||
|
||||
AxisAlignedBB dstBox = AxisAlignedBB.fromBounds( i, j, k, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1 );
|
||||
final AxisAlignedBB dstBox = AxisAlignedBB.fromBounds( i, j, k, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1 );
|
||||
|
||||
CachedPlane cDst = new CachedPlane( dst, i, j, k, i + scaleX, j + scaleY, k + scaleZ );
|
||||
CachedPlane cSrc = new CachedPlane( src, x, y, z, x + scaleX, y + scaleY, z + scaleZ );
|
||||
final CachedPlane cDst = new CachedPlane( dst, i, j, k, i + scaleX, j + scaleY, k + scaleZ );
|
||||
final CachedPlane cSrc = new CachedPlane( src, x, y, z, x + scaleX, y + scaleY, z + scaleZ );
|
||||
|
||||
// do nearly all the work... swaps blocks, tiles, and block ticks
|
||||
cSrc.swap( cDst );
|
||||
|
||||
List<Entity> srcE = src.getEntitiesWithinAABB( Entity.class, srcBox );
|
||||
List<Entity> dstE = dst.getEntitiesWithinAABB( Entity.class, dstBox );
|
||||
final List<Entity> srcE = src.getEntitiesWithinAABB( Entity.class, srcBox );
|
||||
final List<Entity> dstE = dst.getEntitiesWithinAABB( Entity.class, dstBox );
|
||||
|
||||
for( Entity e : dstE )
|
||||
for( final Entity e : dstE )
|
||||
{
|
||||
this.teleportEntity( e, new TelDestination( src, srcBox, e.posX, e.posY, e.posZ, -i + x, -j + y, -k + z ) );
|
||||
}
|
||||
|
||||
for( Entity e : srcE )
|
||||
for( final Entity e : srcE )
|
||||
{
|
||||
this.teleportEntity( e, new TelDestination( dst, dstBox, e.posX, e.posY, e.posZ, -x + i, -y + j, -z + k ) );
|
||||
}
|
||||
|
||||
for( WorldCoord wc : cDst.updates )
|
||||
for( final WorldCoord wc : cDst.updates )
|
||||
{
|
||||
cSrc.world.notifyBlockOfStateChange( wc.getPos(), Platform.AIR_BLOCK );
|
||||
}
|
||||
|
||||
for( WorldCoord wc : cSrc.updates )
|
||||
for( final WorldCoord wc : cSrc.updates )
|
||||
{
|
||||
cSrc.world.notifyBlockOfStateChange( wc.getPos(), Platform.AIR_BLOCK );
|
||||
}
|
||||
@@ -266,15 +266,15 @@ public class StorageHelper
|
||||
|
||||
final World dst;
|
||||
|
||||
public TriggerUpdates( World dst2 )
|
||||
public TriggerUpdates( final World dst2 )
|
||||
{
|
||||
this.dst = dst2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit( BlockPos pos )
|
||||
public void visit( final BlockPos pos )
|
||||
{
|
||||
Block blk = this.dst.getBlockState( pos ).getBlock();
|
||||
final Block blk = this.dst.getBlockState( pos ).getBlock();
|
||||
blk.onNeighborBlockChange( this.dst, pos, Platform.AIR_BLOCK.getDefaultState(), Platform.AIR_BLOCK);
|
||||
}
|
||||
}
|
||||
@@ -286,14 +286,14 @@ public class StorageHelper
|
||||
final World dst;
|
||||
final IBlockState state;
|
||||
|
||||
public WrapInMatrixFrame( IBlockState state, World dst2 )
|
||||
public WrapInMatrixFrame( final IBlockState state, final World dst2 )
|
||||
{
|
||||
this.dst = dst2;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit( BlockPos pos )
|
||||
public void visit( final BlockPos pos )
|
||||
{
|
||||
this.dst.setBlockState( pos, state );
|
||||
}
|
||||
@@ -311,7 +311,7 @@ public class StorageHelper
|
||||
final int yOff;
|
||||
final int zOff;
|
||||
|
||||
TelDestination( World dimension, AxisAlignedBB srcBox, double x, double y, double z, int tileX, int tileY, int tileZ )
|
||||
TelDestination( final World dimension, final AxisAlignedBB srcBox, final double x, final double y, final double z, final int tileX, final int tileY, final int tileZ )
|
||||
{
|
||||
this.dim = dimension;
|
||||
this.x = Math.min( srcBox.maxX - 0.5, Math.max( srcBox.minX + 0.5, x + tileX ) );
|
||||
@@ -329,7 +329,7 @@ public class StorageHelper
|
||||
|
||||
final TelDestination destination;
|
||||
|
||||
public METeleporter( WorldServer par1WorldServer, TelDestination d )
|
||||
public METeleporter( final WorldServer par1WorldServer, final TelDestination d )
|
||||
{
|
||||
super( par1WorldServer );
|
||||
this.destination = d;
|
||||
@@ -337,8 +337,8 @@ public class StorageHelper
|
||||
|
||||
@Override
|
||||
public void placeInPortal(
|
||||
Entity par1Entity,
|
||||
float rotationYaw )
|
||||
final Entity par1Entity,
|
||||
final float rotationYaw )
|
||||
{
|
||||
par1Entity.setLocationAndAngles( this.destination.x, this.destination.y, this.destination.z, par1Entity.rotationYaw, 0.0F );
|
||||
par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
|
||||
@@ -346,20 +346,20 @@ public class StorageHelper
|
||||
|
||||
@Override
|
||||
public boolean placeInExistingPortal(
|
||||
Entity entityIn,
|
||||
float p_180620_2_ )
|
||||
final Entity entityIn,
|
||||
final float p_180620_2_ )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean makePortal( Entity par1Entity )
|
||||
public boolean makePortal( final Entity par1Entity )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeStalePortalLocations( long par1 )
|
||||
public void removeStalePortalLocations( final long par1 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class StorageWorldProvider extends WorldProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateCelestialAngle( long par1, float par3 )
|
||||
public float calculateCelestialAngle( final long par1, final float par3 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -67,13 +67,13 @@ public class StorageWorldProvider extends WorldProvider
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public float[] calcSunriseSunsetColors( float celestialAngle, float partialTicks )
|
||||
public float[] calcSunriseSunsetColors( final float celestialAngle, final float partialTicks )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getFogColor( float par1, float par2 )
|
||||
public Vec3 getFogColor( final float par1, final float par2 )
|
||||
{
|
||||
return new Vec3( 0.07, 0.07, 0.07 );
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public class StorageWorldProvider extends WorldProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesXZShowFog( int par1, int par2 )
|
||||
public boolean doesXZShowFog( final int par1, final int par2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -116,19 +116,19 @@ public class StorageWorldProvider extends WorldProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getSkyColor( Entity cameraEntity, float partialTicks )
|
||||
public Vec3 getSkyColor( final Entity cameraEntity, final float partialTicks )
|
||||
{
|
||||
return new Vec3( 0.07, 0.07, 0.07 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStarBrightness( float par1 )
|
||||
public float getStarBrightness( final float par1 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSnowAt( BlockPos pos, boolean checkLight )
|
||||
public boolean canSnowAt( final BlockPos pos, final boolean checkLight )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -140,13 +140,13 @@ public class StorageWorldProvider extends WorldProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockHighHumidity( BlockPos pos )
|
||||
public boolean isBlockHighHumidity( final BlockPos pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDoLightning( Chunk chunk )
|
||||
public boolean canDoLightning( final Chunk chunk )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user