final variables and parameters
seeing some methods it does actually help to enforce the 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,23 +104,23 @@ 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<ChunkPosition, TileEntity>> rawTiles = new LinkedList<Entry<ChunkPosition, TileEntity>>();
|
||||
LinkedList<ChunkPosition> deadTiles = new LinkedList<ChunkPosition>();
|
||||
final LinkedList<Entry<ChunkPosition, TileEntity>> rawTiles = new LinkedList<Entry<ChunkPosition, TileEntity>>();
|
||||
final LinkedList<ChunkPosition> deadTiles = new LinkedList<ChunkPosition>();
|
||||
|
||||
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<ChunkPosition, TileEntity>) c.chunkTileEntityMap ).entrySet() );
|
||||
for( Entry<ChunkPosition, TileEntity> tx : rawTiles )
|
||||
for( final Entry<ChunkPosition, TileEntity> tx : rawTiles )
|
||||
{
|
||||
ChunkPosition cp = tx.getKey();
|
||||
TileEntity te = tx.getValue();
|
||||
final ChunkPosition cp = tx.getKey();
|
||||
final TileEntity te = tx.getValue();
|
||||
if( te.xCoord >= minX && te.xCoord <= maxX && te.yCoord >= minY && te.yCoord <= maxY && te.zCoord >= minZ && te.zCoord <= maxZ )
|
||||
{
|
||||
if( mr.askToMove( te ) )
|
||||
@@ -130,8 +130,8 @@ public class CachedPlane
|
||||
}
|
||||
else
|
||||
{
|
||||
Object[] details = this.myColumns[te.xCoord - minX][te.zCoord - minZ].getDetails( te.yCoord );
|
||||
Block blk = (Block) details[0];
|
||||
final Object[] details = this.myColumns[te.xCoord - minX][te.zCoord - minZ].getDetails( te.yCoord );
|
||||
final Block blk = (Block) details[0];
|
||||
|
||||
// don't skip air, just let the code replace it...
|
||||
if( blk != null && blk.isAir( c.worldObj, te.xCoord, te.yCoord, te.zCoord ) && blk.isReplaceable( c.worldObj, te.xCoord, te.yCoord, te.zCoord ) )
|
||||
@@ -147,21 +147,21 @@ public class CachedPlane
|
||||
}
|
||||
}
|
||||
|
||||
for( ChunkPosition cp : deadTiles )
|
||||
for( final ChunkPosition cp : deadTiles )
|
||||
{
|
||||
c.chunkTileEntityMap.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;
|
||||
final NextTickListEntry entry = (NextTickListEntry) o;
|
||||
if( entry.xCoord >= minX && entry.xCoord <= maxX && entry.yCoord >= minY && entry.yCoord <= maxY && entry.zCoord >= minZ && entry.zCoord <= maxZ )
|
||||
{
|
||||
NextTickListEntry newEntry = new NextTickListEntry( entry.xCoord, entry.yCoord, entry.zCoord, entry.func_151351_a() );
|
||||
final NextTickListEntry newEntry = new NextTickListEntry( entry.xCoord, entry.yCoord, entry.zCoord, entry.func_151351_a() );
|
||||
newEntry.scheduledTime = entry.scheduledTime - k;
|
||||
this.ticks.add( newEntry );
|
||||
}
|
||||
@@ -170,28 +170,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 )
|
||||
{
|
||||
@@ -203,18 +203,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 );
|
||||
@@ -232,22 +232,22 @@ public class CachedPlane
|
||||
long duration = endTime - startTime;
|
||||
AELog.info( "Block Copy Time: " + duration );
|
||||
|
||||
for( TileEntity te : this.tiles )
|
||||
for( final TileEntity te : this.tiles )
|
||||
{
|
||||
dst.addTile( te.xCoord - this.x_offset, te.yCoord - this.y_offset, te.zCoord - this.z_offset, te, this, mr );
|
||||
}
|
||||
|
||||
for( TileEntity te : dst.tiles )
|
||||
for( final TileEntity te : dst.tiles )
|
||||
{
|
||||
this.addTile( te.xCoord - dst.x_offset, te.yCoord - dst.y_offset, te.zCoord - dst.z_offset, te, dst, mr );
|
||||
}
|
||||
|
||||
for( NextTickListEntry entry : this.ticks )
|
||||
for( final NextTickListEntry entry : this.ticks )
|
||||
{
|
||||
dst.addTick( entry.xCoord - this.x_offset, entry.yCoord - this.y_offset, entry.zCoord - this.z_offset, entry );
|
||||
}
|
||||
|
||||
for( NextTickListEntry entry : dst.ticks )
|
||||
for( final NextTickListEntry entry : dst.ticks )
|
||||
{
|
||||
this.addTick( entry.xCoord - dst.x_offset, entry.yCoord - dst.y_offset, entry.zCoord - dst.z_offset, entry );
|
||||
}
|
||||
@@ -262,35 +262,35 @@ 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( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS )
|
||||
for( final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
this.updates.add( new WorldCoord( x + d.offsetX, y + d.offsetY, z + d.offsetZ ) );
|
||||
}
|
||||
}
|
||||
|
||||
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.scheduleBlockUpdate( x + this.x_offset, y + this.y_offset, z + this.z_offset, entry.func_151351_a(), (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, x + this.x_offset, y + this.y_offset, z + this.z_offset );
|
||||
}
|
||||
catch( Throwable e )
|
||||
catch( final Throwable e )
|
||||
{
|
||||
AELog.error( e );
|
||||
|
||||
@@ -317,7 +317,7 @@ public class CachedPlane
|
||||
alternateDestination.addTile( x, y, z, te, null, mr );
|
||||
}
|
||||
}
|
||||
catch( Throwable e )
|
||||
catch( final Throwable e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
@@ -331,7 +331,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.isModified = true;
|
||||
@@ -344,7 +344,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 )
|
||||
{
|
||||
@@ -366,7 +366,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;
|
||||
@@ -376,7 +376,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 )
|
||||
{
|
||||
@@ -385,9 +385,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 )
|
||||
{
|
||||
@@ -395,25 +395,25 @@ public class CachedPlane
|
||||
}
|
||||
}
|
||||
|
||||
ExtendedBlockStorage extendedBlockStorage = this.storage[y >> 4];
|
||||
final ExtendedBlockStorage extendedBlockStorage = this.storage[y >> 4];
|
||||
extendedBlockStorage.func_150818_a( this.x, y & 15, this.z, (Block) blk[0] );
|
||||
// extendedBlockStorage.setExtBlockID( x, y & 15, z, blk[0] );
|
||||
extendedBlockStorage.setExtBlockMetadata( this.x, y & 15, this.z, (Integer) blk[1] );
|
||||
extendedBlockStorage.setExtBlocklightValue( this.x, y & 15, this.z, (Integer) blk[2] );
|
||||
}
|
||||
|
||||
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.getBlockByExtId( this.x, y & 15, this.z );
|
||||
this.ch[1] = extendedblockstorage.getExtBlockMetadata( this.x, y & 15, this.z );
|
||||
this.ch[2] = 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;
|
||||
@@ -422,7 +422,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,13 +37,13 @@ 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, int x, int y, int z )
|
||||
public void moveTile( final TileEntity te, final World w, final int x, final int y, final int z )
|
||||
{
|
||||
|
||||
te.setWorldObj( w );
|
||||
@@ -51,7 +51,7 @@ public class DefaultSpatialHandler implements IMovableHandler
|
||||
te.yCoord = y;
|
||||
te.zCoord = z;
|
||||
|
||||
Chunk c = w.getChunkFromBlockCoords( x, z );
|
||||
final Chunk c = w.getChunkFromBlockCoords( x, z );
|
||||
c.func_150812_a( x & 0xF, y, z & 0xF, te );
|
||||
// c.setChunkBlockTileEntity( x & 0xF, y, z & 0xF, te );
|
||||
|
||||
|
||||
@@ -42,7 +42,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++ )
|
||||
{
|
||||
@@ -53,19 +53,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 );
|
||||
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, BLOCKS, x, z );
|
||||
final Chunk chunk = new Chunk( this.world, BLOCKS, 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 )
|
||||
{
|
||||
@@ -82,7 +82,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 )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public class StorageChunkProvider extends ChunkProviderGenerate
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getPossibleCreatures( EnumCreatureType a, int b, int c, int d )
|
||||
public List getPossibleCreatures( final EnumCreatureType a, final int b, final int c, final int d )
|
||||
{
|
||||
return new ArrayList();
|
||||
}
|
||||
|
||||
@@ -62,11 +62,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
|
||||
{
|
||||
@@ -74,7 +74,7 @@ public class StorageHelper
|
||||
newWorld = (WorldServer) link.dim;
|
||||
player = ( entity instanceof EntityPlayerMP ) ? (EntityPlayerMP) entity : null;
|
||||
}
|
||||
catch( Throwable e )
|
||||
catch( final Throwable e )
|
||||
{
|
||||
return entity;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ public class StorageHelper
|
||||
// load the chunk!
|
||||
WorldServer.class.cast( newWorld ).getChunkProvider().loadChunk( 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 )
|
||||
@@ -119,8 +119,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 ) ) )
|
||||
{
|
||||
@@ -128,7 +128,7 @@ public class StorageHelper
|
||||
oldWorld.getChunkFromChunkCoords( entX, entZ ).isModified = 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;
|
||||
@@ -137,7 +137,7 @@ public class StorageHelper
|
||||
|
||||
if( entity instanceof EntityHanging )
|
||||
{
|
||||
EntityHanging h = (EntityHanging) entity;
|
||||
final EntityHanging h = (EntityHanging) entity;
|
||||
h.field_146063_b += link.xOff;
|
||||
h.field_146064_c += link.yOff;
|
||||
h.field_146062_d += link.zOff;
|
||||
@@ -177,7 +177,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++ )
|
||||
{
|
||||
@@ -207,44 +207,44 @@ 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, 0, dst ) );
|
||||
}
|
||||
|
||||
AxisAlignedBB srcBox = AxisAlignedBB.getBoundingBox( x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1 );
|
||||
final AxisAlignedBB srcBox = AxisAlignedBB.getBoundingBox( x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1 );
|
||||
|
||||
AxisAlignedBB dstBox = AxisAlignedBB.getBoundingBox( i, j, k, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1 );
|
||||
final AxisAlignedBB dstBox = AxisAlignedBB.getBoundingBox( 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 )
|
||||
{
|
||||
cDst.world.notifyBlockOfNeighborChange( wc.x, wc.y, wc.z, Platform.AIR_BLOCK );
|
||||
}
|
||||
|
||||
for( WorldCoord wc : cSrc.updates )
|
||||
for( final WorldCoord wc : cSrc.updates )
|
||||
{
|
||||
cSrc.world.notifyBlockOfNeighborChange( wc.x, wc.y, wc.z, Platform.AIR_BLOCK );
|
||||
}
|
||||
@@ -269,15 +269,15 @@ public class StorageHelper
|
||||
|
||||
final World dst;
|
||||
|
||||
public TriggerUpdates( World dst2 )
|
||||
public TriggerUpdates( final World dst2 )
|
||||
{
|
||||
this.dst = dst2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit( int x, int y, int z )
|
||||
public void visit( final int x, final int y, final int z )
|
||||
{
|
||||
Block blk = this.dst.getBlock( x, y, z );
|
||||
final Block blk = this.dst.getBlock( x, y, z );
|
||||
blk.onNeighborBlockChange( this.dst, x, y, z, Platform.AIR_BLOCK );
|
||||
}
|
||||
}
|
||||
@@ -289,7 +289,7 @@ public class StorageHelper
|
||||
final Block blkID;
|
||||
final int Meta;
|
||||
|
||||
public WrapInMatrixFrame( Block blockID, int metaData, World dst2 )
|
||||
public WrapInMatrixFrame( final Block blockID, final int metaData, final World dst2 )
|
||||
{
|
||||
this.dst = dst2;
|
||||
this.blkID = blockID;
|
||||
@@ -297,7 +297,7 @@ public class StorageHelper
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit( int x, int y, int z )
|
||||
public void visit( final int x, final int y, final int z )
|
||||
{
|
||||
this.dst.setBlock( x, y, z, this.blkID, this.Meta, 3 );
|
||||
}
|
||||
@@ -314,7 +314,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 ) );
|
||||
@@ -331,33 +331,33 @@ 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void placeInPortal( Entity par1Entity, double par2, double par4, double par6, float par8 )
|
||||
public void placeInPortal( final Entity par1Entity, final double par2, final double par4, final double par6, final float par8 )
|
||||
{
|
||||
par1Entity.setLocationAndAngles( this.destination.x, this.destination.y, this.destination.z, par1Entity.rotationYaw, 0.0F );
|
||||
par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placeInExistingPortal( Entity par1Entity, double par2, double par4, double par6, float par8 )
|
||||
public boolean placeInExistingPortal( final Entity par1Entity, final double par2, final double par4, final double par6, final float par8 )
|
||||
{
|
||||
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 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,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;
|
||||
}
|
||||
@@ -69,13 +69,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 Vec3.createVectorHelper( 0.07, 0.07, 0.07 );
|
||||
}
|
||||
@@ -94,7 +94,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;
|
||||
}
|
||||
@@ -118,19 +118,19 @@ public class StorageWorldProvider extends WorldProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getSkyColor( Entity cameraEntity, float partialTicks )
|
||||
public Vec3 getSkyColor( final Entity cameraEntity, final float partialTicks )
|
||||
{
|
||||
return Vec3.createVectorHelper( 0.07, 0.07, 0.07 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStarBrightness( float par1 )
|
||||
public float getStarBrightness( final float par1 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSnowAt( int x, int y, int z, boolean checkLight )
|
||||
public boolean canSnowAt( final int x, final int y, final int z, final boolean checkLight )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -142,13 +142,13 @@ public class StorageWorldProvider extends WorldProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockHighHumidity( int x, int y, int z )
|
||||
public boolean isBlockHighHumidity( final int x, final int y, final int z )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDoLightning( Chunk chunk )
|
||||
public boolean canDoLightning( final Chunk chunk )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user