Formatted code

This commit is contained in:
yueh
2015-12-24 02:03:16 +01:00
parent e94a0cfccf
commit c9e8a6e939
216 changed files with 1196 additions and 1187 deletions
@@ -1,3 +1,4 @@
package appeng.util;
@@ -1,3 +1,4 @@
package appeng.util;
@@ -39,8 +39,8 @@ public interface IWorldCallable<T>
/**
* Similar to {@link Callable#call()}
*
* @param world this param is given to not hold a reference to the world but let the caller handle it. Do not expect a world here thus can be
* <tt>null</tt>.
* @param world this param is given to not hold a reference to the world but let the caller handle it. Do not expect
* a world here thus can be <tt>null</tt>.
*
* @return result of call on the world. Can be <tt>null</tt>.
*
+21 -24
View File
@@ -175,7 +175,7 @@ public class Platform
/**
* This displays the value for encoded longs ( double *100 )
*
* @param n to be formatted long value
* @param n to be formatted long value
* @param isRate if true it adds a /t to the formatted string
*
* @return formatted long value
@@ -264,7 +264,7 @@ public class Platform
return EnumFacing.NORTH;
}
//something is better then nothing?
// something is better then nothing?
return EnumFacing.NORTH;
}
@@ -385,7 +385,7 @@ public class Platform
z = tile.getPos().getZ();
}
if( ( type.getType().isItem() && tile == null ) || type.hasPermissions( tile, x,y,z, side, p ) )
if( ( type.getType().isItem() && tile == null ) || type.hasPermissions( tile, x, y, z, side, p ) )
{
if( tile == null && type.getType() == GuiHostType.ITEM )
{
@@ -820,7 +820,7 @@ public class Platform
final BlockPos posX = teA.getPos().offset( EnumFacing.EAST );
final BlockPos negX = teA.getPos().offset( EnumFacing.WEST );
if( teA.getWorld().getBlockState( posX ) == myBlockID )
{
teB = teA.getWorld().getTileEntity( posX );
@@ -850,12 +850,12 @@ public class Platform
final BlockPos posY = teA.getPos().offset( EnumFacing.SOUTH );
final BlockPos negY = teA.getPos().offset( EnumFacing.NORTH );
if( teB == null )
{
if( teA.getWorld().getBlockState( posY ) == myBlockID )
{
teB = teA.getWorld().getTileEntity(posY);
teB = teA.getWorld().getTileEntity( posY );
if( !( teB instanceof TileEntityChest ) )
{
teB = null;
@@ -1038,12 +1038,12 @@ public class Platform
{
// TODO: Build Craft Wrench?
/*
if( eq.getItem() instanceof IToolWrench )
{
IToolWrench wrench = (IToolWrench) eq.getItem();
return wrench.canWrench( player, x, y, z );
}
*/
* if( eq.getItem() instanceof IToolWrench )
* {
* IToolWrench wrench = (IToolWrench) eq.getItem();
* return wrench.canWrench( player, x, y, z );
* }
*/
}
catch( final Throwable ignore )
{ // explodes without BC
@@ -1407,16 +1407,16 @@ public class Platform
{
final Item ai = a.getItem();
final Item bi = b.getItem();
return ( ai.getDurabilityForDisplay(a) > 1 ) == ( bi.getDurabilityForDisplay(b) > 1 );
return ( ai.getDurabilityForDisplay( a ) > 1 ) == ( bi.getDurabilityForDisplay( b ) > 1 );
}
else
{
final Item ai = a.getItem();
final Item bi = b.getItem();
final float percentDamagedOfA = 1.0f - (float) ai.getDurabilityForDisplay(a);
final float percentDamagedOfB = 1.0f - (float) bi.getDurabilityForDisplay(b);
final float percentDamagedOfA = 1.0f - (float) ai.getDurabilityForDisplay( a );
final float percentDamagedOfB = 1.0f - (float) bi.getDurabilityForDisplay( b );
return ( percentDamagedOfA > mode.breakPoint ) == ( percentDamagedOfB > mode.breakPoint );
}
@@ -1451,13 +1451,10 @@ public class Platform
/*
* // test ore dictionary.. int OreID = getOreID( a ); if ( OreID != -1 ) return OreID == getOreID( b );
*
* if ( Mode != FuzzyMode.IGNORE_ALL ) { if ( a.hasTagCompound() && !isShared( a.getTagCompound() ) ) { a =
* Platform.getSharedItemStack( AEItemStack.create( a ) ); }
*
* if ( b.hasTagCompound() && !isShared( b.getTagCompound() ) ) { b = Platform.getSharedItemStack(
* AEItemStack.create( b ) ); }
*
* // test regular items with damage values and what not... if ( isShared( a.getTagCompound() ) && isShared(
* b.getTagCompound() ) && a.itemID == b.itemID ) { return ((AppEngSharedNBTTagCompound)
* a.getTagCompound()).compareFuzzyWithRegistry( (AppEngSharedNBTTagCompound) b.getTagCompound() ); } }
@@ -1477,17 +1474,17 @@ public class Platform
final float playerPitch = playerIn.prevRotationPitch + ( playerIn.rotationPitch - playerIn.prevRotationPitch );
final float playerYaw = playerIn.prevRotationYaw + ( playerIn.rotationYaw - playerIn.prevRotationYaw );
final float yawRayX = MathHelper.sin( -playerYaw * 0.017453292f - ( float ) Math.PI );
final float yawRayZ = MathHelper.cos( -playerYaw * 0.017453292f - ( float ) Math.PI );
final float yawRayX = MathHelper.sin( -playerYaw * 0.017453292f - (float) Math.PI );
final float yawRayZ = MathHelper.cos( -playerYaw * 0.017453292f - (float) Math.PI );
final float pitchMultiplier = -MathHelper.cos( -playerPitch * 0.017453292F );
final float eyeRayY = MathHelper.sin( -playerPitch * 0.017453292F );
final float eyeRayX = yawRayX * pitchMultiplier;
final float eyeRayZ = yawRayZ * pitchMultiplier;
if ( playerIn instanceof EntityPlayerMP )
if( playerIn instanceof EntityPlayerMP )
{
reachDistance = ( ( EntityPlayerMP ) playerIn ).theItemInWorldManager.getBlockReachDistance();
reachDistance = ( (EntityPlayerMP) playerIn ).theItemInWorldManager.getBlockReachDistance();
}
final Vec3 from = new Vec3( x, y, z );
@@ -1,3 +1,4 @@
package appeng.util;
@@ -54,7 +55,7 @@ public enum ReadableNumberConverter implements ISlimReadableNumberConverter, IWi
* restricts a string representation of a number to a specific width
*
* @param number to be formatted number
* @param width width limitation of the resulting number
* @param width width limitation of the resulting number
*
* @return formatted number restricted by the width limitation
*/
@@ -109,4 +109,4 @@ package appeng.util.inv;
// {
// return new NullIterator<ItemSlot>();
// }
//}
// }
@@ -253,7 +253,7 @@ public class AdaptorIInventory extends InventoryAdaptor
* than the limit.
*
* @param itemsToAdd itemStack to add to the inventory
* @param modulate true to modulate, false for simulate
* @param modulate true to modulate, false for simulate
*
* @return the left itemstack, which could not be added
*/
@@ -74,13 +74,13 @@ public class AdaptorPlayerInventory implements IInventory
{
this.src.setInventorySlotContents( var1 + this.min, var2 );
}
@Override
public IChatComponent getDisplayName()
{
return this.src.getDisplayName();
}
@Override
public boolean hasCustomName()
{
@@ -104,19 +104,20 @@ public class AdaptorPlayerInventory implements IInventory
{
return this.src.isUseableByPlayer( var1 );
}
@Override
public void openInventory(
final EntityPlayer player )
{
this.src.openInventory(player);
this.src.openInventory( player );
}
@Override
public void closeInventory(
final EntityPlayer player )
{
this.src.closeInventory(player);
this.src.closeInventory( player );
}
@Override
@@ -206,13 +206,13 @@ public class WrapperChainedInventory implements IInventory
{
return false;
}
@Override
public void openInventory(
final EntityPlayer player )
{
}
@Override
public void closeInventory(
final EntityPlayer player )
@@ -256,7 +256,7 @@ public class WrapperChainedInventory implements IInventory
final int id,
final int value )
{
}
@Override
@@ -268,6 +268,6 @@ public class WrapperChainedInventory implements IInventory
@Override
public void clear()
{
}
}
@@ -121,14 +121,14 @@ public class WrapperInvSlot
public void openInventory(
final EntityPlayer player )
{
this.inv.openInventory(player);
this.inv.openInventory( player );
}
@Override
public void closeInventory(
final EntityPlayer player )
{
this.inv.closeInventory(player);
this.inv.closeInventory( player );
}
@Override
@@ -136,20 +136,20 @@ public class WrapperInvSlot
{
this.inv.clear();
}
@Override
public int getField(
final int id )
{
return this.inv.getField( id );
}
@Override
public int getFieldCount()
{
return this.inv.getFieldCount();
}
@Override
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
@@ -138,14 +138,14 @@ public class WrapperInventoryRange implements IInventory
public void openInventory(
final EntityPlayer player )
{
this.src.openInventory(player);
this.src.openInventory( player );
}
@Override
public void closeInventory(
final EntityPlayer player )
{
this.src.closeInventory(player);
this.src.closeInventory( player );
}
@Override
@@ -153,14 +153,14 @@ public class WrapperInventoryRange implements IInventory
{
this.src.clear();
}
@Override
public int getField(
final int id )
{
return this.src.getField( id );
}
@Override
public int getFieldCount()
{
@@ -180,6 +180,7 @@ public class WrapperInventoryRange implements IInventory
{
this.src.setField( id, value );
}
@Override
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
@@ -108,4 +108,4 @@ package appeng.util.inv;
// {
// return false;
// }
//}
// }