Puts everywhere brackets
This commit is contained in:
@@ -65,7 +65,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
this.setFeature( EnumSet.of( AEFeature.Facades ) );
|
||||
this.setHasSubtypes( true );
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer( this, BusRenderer.INSTANCE );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -125,7 +127,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
{
|
||||
ItemStack facade = this.createFacadeForItem( l, false );
|
||||
if( facade != null )
|
||||
{
|
||||
this.subTypes.add( facade );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( Throwable t )
|
||||
@@ -135,18 +139,24 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
if( FacadeConfig.instance.hasChanged() )
|
||||
{
|
||||
FacadeConfig.instance.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack createFacadeForItem( ItemStack l, boolean returnItem )
|
||||
{
|
||||
if( l == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Block b = Block.getBlockFromItem( l.getItem() );
|
||||
if( b == null || l.hasTagCompound() )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int metadata = l.getItem().getMetadata( l.getItemDamage() );
|
||||
|
||||
@@ -158,7 +168,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
if( FacadeConfig.instance.checkEnabled( b, metadata, defaultValue ) )
|
||||
{
|
||||
if( returnItem )
|
||||
{
|
||||
return l;
|
||||
}
|
||||
|
||||
ItemStack is = new ItemStack( this );
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
@@ -180,7 +192,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
{
|
||||
ItemStack in = this.getTextureItem( is );
|
||||
if( in != null )
|
||||
{
|
||||
return new FacadePart( is, side );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -189,7 +203,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
{
|
||||
Block blk = this.getBlock( is );
|
||||
if( blk != null )
|
||||
{
|
||||
return new ItemStack( blk, 1, this.getMeta( is ) );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -201,7 +217,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
{
|
||||
int[] blk = data.getIntArray( "x" );
|
||||
if( blk != null && blk.length == 2 )
|
||||
{
|
||||
return blk[1];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -220,7 +238,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
{
|
||||
int[] blk = data.getIntArray( "x" );
|
||||
if( blk != null && blk.length == 2 )
|
||||
{
|
||||
return Block.getBlockById( blk[0] );
|
||||
}
|
||||
}
|
||||
}
|
||||
return Blocks.glass;
|
||||
@@ -236,7 +256,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
{
|
||||
this.calculateSubTypes();
|
||||
if( this.subTypes.isEmpty() )
|
||||
{
|
||||
return new ItemStack( Items.cake );
|
||||
}
|
||||
return this.subTypes.get( 0 );
|
||||
}
|
||||
|
||||
@@ -260,11 +282,15 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
ItemStack out = this.getTextureItem( is );
|
||||
|
||||
if( out == null || out.getItem() == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Block blk = Block.getBlockFromItem( out.getItem() );
|
||||
if( blk != null && blk.canRenderInPass( 1 ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -112,15 +112,21 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
for( PartTypeWithVariant p : this.registered.values() )
|
||||
{
|
||||
if( p.part == mat && p.variant == varID )
|
||||
{
|
||||
throw new IllegalStateException( "Cannot create the same material twice..." );
|
||||
}
|
||||
}
|
||||
|
||||
boolean enabled = true;
|
||||
for( AEFeature f : mat.getFeature() )
|
||||
{
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
}
|
||||
|
||||
for( IntegrationType integrationType : mat.getIntegrations() )
|
||||
{
|
||||
enabled &= IntegrationRegistry.INSTANCE.isEnabled( integrationType );
|
||||
}
|
||||
|
||||
final int partDamage = mat.baseDamage + varID;
|
||||
final ItemStackSrc output = new ItemStackSrc( this, partDamage );
|
||||
@@ -140,7 +146,9 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
|
||||
final Map<Integer, PartTypeWithVariant> reference = ( enabled ) ? this.registered : this.unregistered;
|
||||
if( reference.containsKey( partDamage ) )
|
||||
{
|
||||
throw new IllegalStateException( "Meta Overlap detected with type " + mat + " and damage " + partDamage + ". Found " + reference.get( partDamage ) + " there already." );
|
||||
}
|
||||
|
||||
reference.put( partDamage, pti );
|
||||
}
|
||||
@@ -152,7 +160,9 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
for( Entry<Integer, PartTypeWithVariant> pt : this.registered.entrySet() )
|
||||
{
|
||||
if( pt.getValue().part == t )
|
||||
{
|
||||
return pt.getKey();
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -195,7 +205,9 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
if( pt.getExtraName() != null )
|
||||
{
|
||||
return super.getItemStackDisplayName( is ) + " - " + pt.getExtraName().getLocal();
|
||||
}
|
||||
|
||||
return super.getItemStackDisplayName( is );
|
||||
}
|
||||
@@ -215,7 +227,9 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
} );
|
||||
|
||||
for( Entry<Integer, PartTypeWithVariant> part : types )
|
||||
{
|
||||
cList.add( new ItemStack( this, 1, part.getKey() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -245,10 +259,14 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
|
||||
final PartTypeWithVariant pt = this.registered.get( is.getItemDamage() );
|
||||
if( pt != null )
|
||||
{
|
||||
return pt.part;
|
||||
}
|
||||
final PartTypeWithVariant unregisteredPartType = this.unregistered.get( is.getItemDamage() );
|
||||
if( unregisteredPartType != null )
|
||||
{
|
||||
return unregisteredPartType.part;
|
||||
}
|
||||
|
||||
throw new IllegalStateException( "ItemStack " + is + " has to be either registered or unregistered, but was not found in either." );
|
||||
}
|
||||
@@ -263,7 +281,9 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
try
|
||||
{
|
||||
if( type.constructor == null )
|
||||
{
|
||||
type.constructor = part.getConstructor( ItemStack.class );
|
||||
}
|
||||
|
||||
return type.constructor.newInstance( is );
|
||||
}
|
||||
@@ -288,7 +308,9 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
public int variantOf( int itemDamage )
|
||||
{
|
||||
if( this.registered.containsKey( itemDamage ) )
|
||||
{
|
||||
return this.registered.get( itemDamage ).variant;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -312,12 +334,16 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
case ImportBus:
|
||||
importBus = true;
|
||||
if( u == pt )
|
||||
{
|
||||
group = true;
|
||||
}
|
||||
break;
|
||||
case ExportBus:
|
||||
exportBus = true;
|
||||
if( u == pt )
|
||||
{
|
||||
group = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
@@ -325,7 +351,9 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
if( group && importBus && exportBus )
|
||||
{
|
||||
return GuiText.IOBuses.getUnlocalized();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user