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
@@ -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 )
{