final variables and parameters
This commit is contained in:
@@ -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 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user