Format sourcecode

This commit is contained in:
yueh
2017-07-20 21:17:10 +02:00
parent 66437897be
commit 621910df91
295 changed files with 2142 additions and 1562 deletions
@@ -42,8 +42,10 @@ import appeng.util.inv.WrapperMCISidedInventory;
/**
* Universal Facade for other inventories. Used to conveniently interact with various types of inventories. This is not used for
* actually monitoring an inventory. It is just for insertion and extraction, and is primarily used by import/export buses.
* Universal Facade for other inventories. Used to conveniently interact with various types of inventories. This is not
* used for
* actually monitoring an inventory. It is just for insertion and extraction, and is primarily used by import/export
* buses.
*/
public abstract class InventoryAdaptor implements Iterable<ItemSlot>
{
@@ -56,7 +58,7 @@ public abstract class InventoryAdaptor implements Iterable<ItemSlot>
return null;
}
if ( te instanceof ICapabilityProvider )
if( te instanceof ICapabilityProvider )
{
ICapabilityProvider capProvider = (ICapabilityProvider) te;
+8 -4
View File
@@ -33,7 +33,8 @@ public class ItemSorters
private static SortDir Direction = SortDir.ASCENDING;
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_NAME = new Comparator<IAEItemStack>(){
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_NAME = new Comparator<IAEItemStack>()
{
@Override
public int compare( final IAEItemStack o1, final IAEItemStack o2 )
@@ -45,7 +46,8 @@ public class ItemSorters
return Platform.getItemDisplayName( o2 ).compareToIgnoreCase( Platform.getItemDisplayName( o1 ) );
}
};
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_MOD = new Comparator<IAEItemStack>(){
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_MOD = new Comparator<IAEItemStack>()
{
@Override
public int compare( final IAEItemStack o1, final IAEItemStack o2 )
@@ -70,7 +72,8 @@ public class ItemSorters
return compareToIgnoreCase;
}
};
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_SIZE = new Comparator<IAEItemStack>(){
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_SIZE = new Comparator<IAEItemStack>()
{
@Override
public int compare( final IAEItemStack o1, final IAEItemStack o2 )
@@ -83,7 +86,8 @@ public class ItemSorters
}
};
private static IInvTweaks api;
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_INV_TWEAKS = new Comparator<IAEItemStack>(){
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_INV_TWEAKS = new Comparator<IAEItemStack>()
{
@Override
public int compare( final IAEItemStack o1, final IAEItemStack o2 )
@@ -18,8 +18,10 @@
package appeng.util;
import net.minecraft.util.math.Vec3d;
public class LookDirection
{
+10 -9
View File
@@ -698,7 +698,8 @@ public class Platform
try
{
ITooltipFlag.TooltipFlags tooltipFlag = Minecraft.getMinecraft().gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL;
ITooltipFlag.TooltipFlags tooltipFlag = Minecraft
.getMinecraft().gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL;
return itemStack.getTooltip( Minecraft.getMinecraft().player, tooltipFlag );
}
catch( final Exception errB )
@@ -1803,14 +1804,14 @@ public class Platform
return (float) ( player.posY + player.getEyeHeight() - player.getDefaultEyeHeight() );
}
// public static void addStat( final int playerID, final Achievement achievement )
// {
// final EntityPlayer p = AEApi.instance().registries().players().findPlayer( playerID );
// if( p != null )
// {
// p.addStat( achievement, 1 );
// }
// }
// public static void addStat( final int playerID, final Achievement achievement )
// {
// final EntityPlayer p = AEApi.instance().registries().players().findPlayer( playerID );
// if( p != null )
// {
// p.addStat( achievement, 1 );
// }
// }
public static boolean isRecipePrioritized( final ItemStack what )
{
@@ -87,13 +87,15 @@ public class ItemComparisonHelper
*/
public boolean isEqualItem( @Nonnull final ItemStack left, @Nonnull final ItemStack right )
{
return this.isItemEqual(left, right);
return this.isItemEqual( left, right );
}
/**
* A slightly different method from ItemStack.java to skip the isEmpty() check. This allows you to check for identical empty spots..
* A slightly different method from ItemStack.java to skip the isEmpty() check. This allows you to check for
* identical empty spots..
*/
public boolean isItemEqual( ItemStack left, ItemStack right ) {
public boolean isItemEqual( ItemStack left, ItemStack right )
{
return left.getItem() == right.getItem() && left.getItemDamage() == right.getItemDamage();
}
@@ -395,7 +397,8 @@ public class ItemComparisonHelper
return true;
}
if( ( ta == null && tb == null ) || ( ta != null && ta.hasNoTags() && tb == null ) || ( tb != null && tb.hasNoTags() && ta == null ) || ( ta != null && ta.hasNoTags() && tb != null && tb.hasNoTags() ) )
if( ( ta == null && tb == null ) || ( ta != null && ta.hasNoTags() && tb == null ) || ( tb != null && tb
.hasNoTags() && ta == null ) || ( ta != null && ta.hasNoTags() && tb != null && tb.hasNoTags() ) )
{
return true;
}
+2 -1
View File
@@ -36,7 +36,8 @@ public class ItemSlot
public ItemStack getItemStack()
{
return this.itemStack.isEmpty() ? ( this.aeItemStack == null ? ItemStack.EMPTY : ( this.itemStack = this.aeItemStack.getItemStack() ) ) : this.itemStack;
return this.itemStack
.isEmpty() ? ( this.aeItemStack == null ? ItemStack.EMPTY : ( this.itemStack = this.aeItemStack.getItemStack() ) ) : this.itemStack;
}
public void setItemStack( final ItemStack is )
@@ -150,7 +150,8 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
final FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( d );
if (!showCraftingLabel) {
if( !showCraftingLabel )
{
showCraftingLabel = stackSize == 0;
}
@@ -321,7 +322,8 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
return true;
}
if( ( ta == null && tb == null ) || ( ta != null && ta.hasNoTags() && tb == null ) || ( tb != null && tb.hasNoTags() && ta == null ) || ( ta != null && ta.hasNoTags() && tb != null && tb.hasNoTags() ) )
if( ( ta == null && tb == null ) || ( ta != null && ta.hasNoTags() && tb == null ) || ( tb != null && tb
.hasNoTags() && ta == null ) || ( ta != null && ta.hasNoTags() && tb != null && tb.hasNoTags() ) )
{
return true;
}
@@ -167,7 +167,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
short itemNumericId = data.readShort();
d.setString( "id", String.valueOf( itemNumericId ) );
d.setShort( "Damage", data.readShort() );
d.setByte( "Count", (byte) 1 ); // 1 Because vanilla'll freak out otherwise
d.setByte( "Count", (byte) 1 ); // 1 Because vanilla'll freak out otherwise
if( hasTagCompound )
{
@@ -186,7 +186,8 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
final ItemStack itemstack = new ItemStack( d );
if(!showCraftingLabel) {
if( !showCraftingLabel )
{
showCraftingLabel = stackSize == 0 && isCraftable;
}
@@ -448,7 +449,8 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
@Override
public ItemStack getItemStack()
{
final ItemStack is = new ItemStack( this.getDefinition().getItem(), (int) Math.min( Integer.MAX_VALUE, this.getStackSize() ), this.getDefinition().getDamageValue() );
final ItemStack is = new ItemStack( this.getDefinition().getItem(), (int) Math.min( Integer.MAX_VALUE, this.getStackSize() ), this.getDefinition()
.getDamageValue() );
if( this.getDefinition().getTagCompound() != null )
{
is.setTagCompound( this.getDefinition().getTagCompound().getNBTTagCompoundCopy() );
@@ -524,7 +526,8 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
return true;
}
if( ( ta == null && tb == null ) || ( ta != null && ta.hasNoTags() && tb == null ) || ( tb != null && tb.hasNoTags() && ta == null ) || ( ta != null && ta.hasNoTags() && tb != null && tb.hasNoTags() ) )
if( ( ta == null && tb == null ) || ( ta != null && ta.hasNoTags() && tb == null ) || ( tb != null && tb
.hasNoTags() && ta == null ) || ( ta != null && ta.hasNoTags() && tb != null && tb.hasNoTags() ) )
{
return true;
}
@@ -577,7 +580,8 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
private int compareNBT( final AEItemDef b )
{
final int nbt = this.compare( ( this.getDefinition().getTagCompound() == null ? 0 : this.getDefinition().getTagCompound().getHash() ), ( b.getTagCompound() == null ? 0 : b.getTagCompound().getHash() ) );
final int nbt = this.compare( ( this.getDefinition().getTagCompound() == null ? 0 : this.getDefinition().getTagCompound().getHash() ),
( b.getTagCompound() == null ? 0 : b.getTagCompound().getHash() ) );
if( nbt == 0 )
{
return this.compare( System.identityHashCode( this.getDefinition().getTagCompound() ), System.identityHashCode( b.getTagCompound() ) );
@@ -611,7 +615,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
return this.getDefinition().getDisplayName();
}
@SideOnly( Side.CLIENT )
public String getModID()
{
+6 -3
View File
@@ -109,12 +109,14 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
}
@Override
public boolean getShowCraftingLabel() {
public boolean getShowCraftingLabel()
{
return this.showCraftingLabel;
}
@Override
public void setShowCraftingLabel(boolean showCraftingLabel) {
public void setShowCraftingLabel( boolean showCraftingLabel )
{
this.showCraftingLabel = showCraftingLabel;
}
@@ -151,7 +153,8 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
@Override
public void writeToPacket( final ByteBuf i ) throws IOException
{
final byte mask = (byte) ( this.getType( 0 ) | ( this.getType( this.stackSize ) << 2 ) | ( this.getType( this.countRequestable ) << 4 ) | ( (byte) ( this.isCraftable ? 1 : 0 ) << 6 ) | ( this.hasTagCompound() ? 1 : 0 ) << 7 );
final byte mask = (byte) ( this.getType( 0 ) | ( this.getType( this.stackSize ) << 2 ) | ( this
.getType( this.countRequestable ) << 4 ) | ( (byte) ( this.isCraftable ? 1 : 0 ) << 6 ) | ( this.hasTagCompound() ? 1 : 0 ) << 7 );
i.writeByte( mask );
i.writeBoolean( this.showCraftingLabel );
@@ -45,7 +45,8 @@ public class OreHelper
/**
* A local cache to speed up OreDictionary lookups.
*/
private final LoadingCache<String, List<ItemStack>> oreDictCache = CacheBuilder.newBuilder().build( new CacheLoader<String, List<ItemStack>>(){
private final LoadingCache<String, List<ItemStack>> oreDictCache = CacheBuilder.newBuilder().build( new CacheLoader<String, List<ItemStack>>()
{
@Override
public List<ItemStack> load( final String oreName )
{