final variables and parameters

This commit is contained in:
thatsIch
2015-09-30 14:24:40 +02:00
parent 059523f543
commit 8b3a954f73
732 changed files with 9253 additions and 9256 deletions
@@ -45,7 +45,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
{
private final int maxRegion;
public ItemSpatialStorageCell( int spatialScale )
public ItemSpatialStorageCell( final int spatialScale )
{
super( Optional.of( spatialScale + "Cubed" ) );
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
@@ -54,9 +54,9 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
}
@Override
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
{
WorldCoord wc = this.getStoredSize( stack );
final WorldCoord wc = this.getStoredSize( stack );
if( wc.x > 0 )
{
lines.add( GuiText.StoredSize.getLocal() + ": " + wc.x + " x " + wc.y + " x " + wc.z );
@@ -64,24 +64,24 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
}
@Override
public boolean isSpatialStorage( ItemStack is )
public boolean isSpatialStorage( final ItemStack is )
{
return true;
}
@Override
public int getMaxStoredDim( ItemStack is )
public int getMaxStoredDim( final ItemStack is )
{
return this.maxRegion;
}
@Override
public World getWorld( ItemStack is )
public World getWorld( final ItemStack is )
{
if( is.hasTagCompound() )
{
NBTTagCompound c = is.getTagCompound();
int dim = c.getInteger( "StorageDim" );
final NBTTagCompound c = is.getTagCompound();
final int dim = c.getInteger( "StorageDim" );
World w = DimensionManager.getWorld( dim );
if( w == null )
{
@@ -101,14 +101,14 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
}
@Override
public WorldCoord getStoredSize( ItemStack is )
public WorldCoord getStoredSize( final ItemStack is )
{
if( is.hasTagCompound() )
{
NBTTagCompound c = is.getTagCompound();
final NBTTagCompound c = is.getTagCompound();
if( Platform.isServer() )
{
int dim = c.getInteger( "StorageDim" );
final int dim = c.getInteger( "StorageDim" );
return WorldData.instance().dimensionData().getStoredSize( dim );
}
else
@@ -120,12 +120,12 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
}
@Override
public WorldCoord getMin( ItemStack is )
public WorldCoord getMin( final ItemStack is )
{
World w = this.getWorld( is );
final World w = this.getWorld( is );
if( w != null )
{
NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" );
final NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" );
if( info != null )
{
return new WorldCoord( info.getInteger( "minX" ), info.getInteger( "minY" ), info.getInteger( "minZ" ) );
@@ -135,12 +135,12 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
}
@Override
public WorldCoord getMax( ItemStack is )
public WorldCoord getMax( final ItemStack is )
{
World w = this.getWorld( is );
final World w = this.getWorld( is );
if( w != null )
{
NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" );
final NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" );
if( info != null )
{
return new WorldCoord( info.getInteger( "maxX" ), info.getInteger( "maxY" ), info.getInteger( "maxZ" ) );
@@ -150,14 +150,14 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
}
@Override
public TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition )
public TransitionResult doSpatialTransition( final ItemStack is, final World w, final WorldCoord min, final WorldCoord max, final boolean doTransition )
{
WorldCoord scale = this.getStoredSize( is );
final WorldCoord scale = this.getStoredSize( is );
int targetX = max.x - min.x - 1;
int targetY = max.y - min.y - 1;
int targetZ = max.z - min.z - 1;
int maxSize = this.getMaxStoredDim( is );
final int targetX = max.x - min.x - 1;
final int targetY = max.y - min.y - 1;
final int targetZ = max.z - min.z - 1;
final int maxSize = this.getMaxStoredDim( is );
World destination = this.getWorld( is );
@@ -170,7 +170,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
destination = this.createNewWorld( is );
}
int floorBuffer = 64;
final int floorBuffer = 64;
StorageHelper.getInstance().swapRegions( w, destination, min.x + 1, min.y + 1, min.z + 1, 1, floorBuffer + 1, 1, targetX - 1, targetY - 1, targetZ - 1 );
this.setStoredSize( is, targetX, targetY, targetZ );
@@ -181,22 +181,22 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
return new TransitionResult( false, 0 );
}
public World createNewWorld( ItemStack is )
public World createNewWorld( final ItemStack is )
{
NBTTagCompound c = Platform.openNbtData( is );
int newDim = DimensionManager.getNextFreeDimId();
final NBTTagCompound c = Platform.openNbtData( is );
final int newDim = DimensionManager.getNextFreeDimId();
c.setInteger( "StorageDim", newDim );
WorldData.instance().dimensionData().addStorageCell( newDim );
DimensionManager.initDimension( newDim );
return DimensionManager.getWorld( newDim );
}
private void setStoredSize( ItemStack is, int targetX, int targetY, int targetZ )
private void setStoredSize( final ItemStack is, final int targetX, final int targetY, final int targetZ )
{
if( is.hasTagCompound() )
{
NBTTagCompound c = is.getTagCompound();
int dim = c.getInteger( "StorageDim" );
final NBTTagCompound c = is.getTagCompound();
final int dim = c.getInteger( "StorageDim" );
c.setInteger( "sizeX", targetX );
c.setInteger( "sizeY", targetY );
c.setInteger( "sizeZ", targetZ );