Puts everywhere brackets
This commit is contained in:
@@ -50,7 +50,9 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
ItemStackSrc is = this.colors[color.ordinal()];
|
||||
|
||||
if( is == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return is.item;
|
||||
}
|
||||
@@ -67,7 +69,9 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
ItemStackSrc is = this.colors[color.ordinal()];
|
||||
|
||||
if( is == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return is.stack( stackSize );
|
||||
}
|
||||
@@ -77,7 +81,9 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
{
|
||||
ItemStack[] is = new ItemStack[this.colors.length];
|
||||
for( int x = 0; x < is.length; x++ )
|
||||
{
|
||||
is[x] = this.colors[x].stack( 1 );
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
@@ -87,7 +93,9 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
ItemStackSrc is = this.colors[color.ordinal()];
|
||||
|
||||
if( comparableItem == null || is == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return comparableItem.getItem() == is.item && comparableItem.getItemDamage() == is.damage;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,9 @@ public final class DamagedItemDefinition implements IItemDefinition
|
||||
public boolean isSameAs( ItemStack comparableStack )
|
||||
{
|
||||
if( comparableStack == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return comparableStack.getItem() == this.source.getItem() && comparableStack.getItemDamage() == this.source.getDamage();
|
||||
}
|
||||
|
||||
@@ -49,10 +49,14 @@ public class ItemStackSrc implements IStackSrc
|
||||
public ItemStack stack( int i )
|
||||
{
|
||||
if( this.block != null )
|
||||
{
|
||||
return new ItemStack( this.block, i, this.damage );
|
||||
}
|
||||
|
||||
if( this.item != null )
|
||||
{
|
||||
return new ItemStack( this.item, i, this.damage );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -51,21 +51,31 @@ public final class NameResolver
|
||||
String name = this.withOriginalName.getSimpleName();
|
||||
|
||||
if( name.startsWith( "ItemMultiPart" ) )
|
||||
{
|
||||
name = ITEM_MULTI_PART.matcher( name ).replaceAll( "ItemPart" );
|
||||
}
|
||||
else if( name.startsWith( "ItemMultiMaterial" ) )
|
||||
{
|
||||
name = ITEM_MULTI_MATERIAL.matcher( name ).replaceAll( "ItemMaterial" );
|
||||
}
|
||||
|
||||
if( subName != null )
|
||||
{
|
||||
// simple hack to allow me to do get nice names for these without
|
||||
// mode code outside of AEBaseItem
|
||||
if( subName.startsWith( "P2PTunnel" ) )
|
||||
{
|
||||
return "ItemPart.P2PTunnel";
|
||||
}
|
||||
|
||||
if( subName.equals( "CertusQuartzTools" ) )
|
||||
{
|
||||
return QUARTZ.matcher( name ).replaceAll( "CertusQuartz" );
|
||||
}
|
||||
if( subName.equals( "NetherQuartzTools" ) )
|
||||
{
|
||||
return QUARTZ.matcher( name ).replaceAll( "NetherQuartz" );
|
||||
}
|
||||
|
||||
name += '.' + subName;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,9 @@ public final class WrappedDamageItemDefinition implements ITileDefinition
|
||||
public boolean isSameAs( ItemStack comparableStack )
|
||||
{
|
||||
if( comparableStack == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.definition.isSameAs( comparableStack ) && comparableStack.getItemDamage() == this.damage;
|
||||
}
|
||||
|
||||
@@ -45,17 +45,25 @@ public class CellRegistry implements ICellRegistry
|
||||
public void addCellHandler( ICellHandler h )
|
||||
{
|
||||
if( h != null )
|
||||
{
|
||||
this.handlers.add( h );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellHandled( ItemStack is )
|
||||
{
|
||||
if( is == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for( ICellHandler ch : this.handlers )
|
||||
{
|
||||
if( ch.isCell( is ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -63,7 +71,9 @@ public class CellRegistry implements ICellRegistry
|
||||
public ICellHandler getHandler( ItemStack is )
|
||||
{
|
||||
if( is == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
for( ICellHandler ch : this.handlers )
|
||||
{
|
||||
if( ch.isCell( is ) )
|
||||
@@ -78,7 +88,9 @@ public class CellRegistry implements ICellRegistry
|
||||
public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel chan )
|
||||
{
|
||||
if( is == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
for( ICellHandler ch : this.handlers )
|
||||
{
|
||||
if( ch.isCell( is ) )
|
||||
|
||||
@@ -55,11 +55,15 @@ public class ExternalStorageRegistry implements IExternalStorageRegistry
|
||||
for( IExternalStorageHandler x : this.Handlers )
|
||||
{
|
||||
if( x.canHandle( te, d, chan, mySrc ) )
|
||||
{
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
if( this.lastHandler.canHandle( te, d, chan, mySrc ) )
|
||||
{
|
||||
return this.lastHandler;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -38,9 +38,13 @@ public final class GridCacheRegistry implements IGridCacheRegistry
|
||||
public void registerGridCache( Class<? extends IGridCache> iface, Class<? extends IGridCache> implementation )
|
||||
{
|
||||
if( iface.isAssignableFrom( implementation ) )
|
||||
{
|
||||
this.caches.put( iface, implementation );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException( "Invalid setup, grid cache must either be the same class, or an interface that the implementation implements. Gotten: " + iface + " and " + implementation );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -124,8 +124,12 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
private void injectRecipe( AppEngGrinderRecipe appEngGrinderRecipe )
|
||||
{
|
||||
for( IGrinderEntry gr : this.recipes )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.recipes.add( appEngGrinderRecipe );
|
||||
}
|
||||
@@ -133,7 +137,9 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
private ItemStack copy( ItemStack is )
|
||||
{
|
||||
if( is != null )
|
||||
{
|
||||
return is.copy();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -166,18 +172,26 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
private int getDustToOreRatio( String name )
|
||||
{
|
||||
if( name.equals( "Obsidian" ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if( name.equals( "Charcoal" ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if( name.equals( "Coal" ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
private void addOre( String name, ItemStack item )
|
||||
{
|
||||
if( item == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.log( "Adding Ore - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
|
||||
this.ores.put( item, name );
|
||||
@@ -193,14 +207,18 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
this.addRecipe( item, is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addRecipe( item, is, 8 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addIngot( String name, ItemStack item )
|
||||
{
|
||||
if( item == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.log( "Adding Ingot - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
|
||||
this.ingots.put( item, name );
|
||||
@@ -214,7 +232,9 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
private void addDust( String name, ItemStack item )
|
||||
{
|
||||
if( item == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if( this.dusts.containsKey( name ) )
|
||||
{
|
||||
this.log( "Rejecting Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
|
||||
@@ -226,6 +246,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
this.dusts.put( name, item );
|
||||
|
||||
for( Entry<ItemStack, String> d : this.ores.entrySet() )
|
||||
{
|
||||
if( name.equals( d.getValue() ) )
|
||||
{
|
||||
ItemStack is = item.copy();
|
||||
@@ -238,12 +259,19 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
this.addRecipe( d.getKey(), is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addRecipe( d.getKey(), is, 8 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( Entry<ItemStack, String> d : this.ingots.entrySet() )
|
||||
{
|
||||
if( name.equals( d.getValue() ) )
|
||||
{
|
||||
this.addRecipe( d.getKey(), item, 4 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -68,7 +68,9 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
public void addRecipe( IInscriberRecipe recipe )
|
||||
{
|
||||
if( recipe == null )
|
||||
{
|
||||
throw new IllegalArgumentException( "Tried to add an invalid (null) inscriber recipe to the registry." );
|
||||
}
|
||||
|
||||
this.recipes.add( recipe );
|
||||
|
||||
@@ -154,15 +156,25 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
public IInscriberRecipe build()
|
||||
{
|
||||
if( this.inputs == null )
|
||||
{
|
||||
throw new IllegalStateException( "Input must be defined." );
|
||||
}
|
||||
if( this.inputs.size() == 0 )
|
||||
{
|
||||
throw new IllegalStateException( "Input must have a size." );
|
||||
}
|
||||
if( this.output == null )
|
||||
{
|
||||
throw new IllegalStateException( "Output must be defined." );
|
||||
}
|
||||
if ( this.topOptional == null && this.bottomOptional == null )
|
||||
{
|
||||
throw new IllegalStateException( "One optional must be defined." );
|
||||
}
|
||||
if ( this.type == null )
|
||||
{
|
||||
throw new IllegalStateException( "Process type must be defined." );
|
||||
}
|
||||
|
||||
return new InscriberRecipe( this.inputs, this.output, this.topOptional, this.bottomOptional, this.type );
|
||||
}
|
||||
|
||||
@@ -47,7 +47,9 @@ public final class LocatableRegistry implements ILocatableRegistry
|
||||
public void updateLocatable( LocatableEventAnnounce e )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return; // IGNORE!
|
||||
}
|
||||
|
||||
if( e.change == LocatableEvent.Register )
|
||||
{
|
||||
|
||||
@@ -53,7 +53,9 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo
|
||||
for( ItemStack o : this.DamageModifiers.keySet() )
|
||||
{
|
||||
if( Platform.isSameItem( o, is ) )
|
||||
{
|
||||
return this.DamageModifiers.get( o ).floatValue();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -62,7 +64,9 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo
|
||||
public void oreRegistered( String name, ItemStack item )
|
||||
{
|
||||
if( !( name.startsWith( "berry" ) || name.startsWith( "nugget" ) ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// addNugget( "Cobble", 18 ); // ?
|
||||
this.considerItem( name, item, "MeatRaw", 32 );
|
||||
|
||||
@@ -69,12 +69,16 @@ public class MovableTileRegistry implements IMovableRegistry
|
||||
IMovableHandler canMove = this.Valid.get( myClass );
|
||||
|
||||
if( canMove == null )
|
||||
{
|
||||
canMove = this.testClass( myClass, te );
|
||||
}
|
||||
|
||||
if( canMove != this.nullHandler )
|
||||
{
|
||||
if( te instanceof IMovableTile )
|
||||
{
|
||||
( (IMovableTile) te ).prepareToMove();
|
||||
}
|
||||
|
||||
te.invalidate();
|
||||
return true;
|
||||
|
||||
@@ -115,7 +115,9 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
public void addNewAttunement( ItemStack trigger, TunnelType type )
|
||||
{
|
||||
if( type == null || trigger == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.Tunnels.put( trigger, type );
|
||||
}
|
||||
@@ -125,7 +127,9 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
ItemStack myItemStack = GameRegistry.findItemStack( modID, Name, 1 );
|
||||
|
||||
if( myItemStack == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
myItemStack.setItemDamage( meta );
|
||||
return myItemStack;
|
||||
@@ -145,15 +149,21 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
if( trigger != null )
|
||||
{
|
||||
if( FluidContainerRegistry.isContainer( trigger ) )
|
||||
{
|
||||
return TunnelType.FLUID;
|
||||
}
|
||||
|
||||
for( ItemStack is : this.Tunnels.keySet() )
|
||||
{
|
||||
if( is.getItem() == trigger.getItem() && is.getItemDamage() == OreDictionary.WILDCARD_VALUE )
|
||||
{
|
||||
return this.Tunnels.get( is );
|
||||
}
|
||||
|
||||
if( Platform.isSameItem( is, trigger ) )
|
||||
{
|
||||
return this.Tunnels.get( is );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,9 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
|
||||
{
|
||||
Class<? extends ICraftHandler> clz = this.handlers.get( name );
|
||||
if( clz == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
return clz.newInstance();
|
||||
@@ -90,7 +92,9 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
|
||||
}
|
||||
|
||||
if( rr != null )
|
||||
{
|
||||
return rr;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -48,7 +48,9 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||
public void registerWirelessHandler( IWirelessTermHandler handler )
|
||||
{
|
||||
if( handler != null )
|
||||
{
|
||||
this.handlers.add( handler );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +59,9 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||
for( IWirelessTermHandler h : this.handlers )
|
||||
{
|
||||
if( h.canHandle( is ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -68,7 +72,9 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||
for( IWirelessTermHandler h : this.handlers )
|
||||
{
|
||||
if( h.canHandle( is ) )
|
||||
{
|
||||
return h;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -77,7 +83,9 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||
public void openWirelessTerminalGui( ItemStack item, World w, EntityPlayer player )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( !this.isWirelessTerminal( item ) )
|
||||
{
|
||||
@@ -106,6 +114,8 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||
Platform.openGUI( player, null, null, GuiBridge.GUI_WIRELESS_TERM );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.addChatMessage( PlayerMessages.DeviceNotPowered.get() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,10 +48,14 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
public void disableWorldGenForProviderID( WorldGenType type, Class<? extends WorldProvider> provider )
|
||||
{
|
||||
if( type == null )
|
||||
{
|
||||
throw new IllegalArgumentException( "Bad Type Passed" );
|
||||
}
|
||||
|
||||
if( provider == null )
|
||||
{
|
||||
throw new IllegalArgumentException( "Bad Provider Passed" );
|
||||
}
|
||||
|
||||
this.types[type.ordinal()].badProviders.add( provider );
|
||||
}
|
||||
@@ -60,7 +64,9 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
public void enableWorldGenForDimension( WorldGenType type, int dimensionID )
|
||||
{
|
||||
if( type == null )
|
||||
{
|
||||
throw new IllegalArgumentException( "Bad Type Passed" );
|
||||
}
|
||||
|
||||
this.types[type.ordinal()].enabledDimensions.add( dimensionID );
|
||||
}
|
||||
@@ -80,10 +86,14 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
public boolean isWorldGenEnabled( WorldGenType type, World w )
|
||||
{
|
||||
if( type == null )
|
||||
{
|
||||
throw new IllegalArgumentException( "Bad Type Passed" );
|
||||
}
|
||||
|
||||
if( w == null )
|
||||
{
|
||||
throw new IllegalArgumentException( "Bad Provider Passed" );
|
||||
}
|
||||
|
||||
boolean isBadProvider = this.types[type.ordinal()].badProviders.contains( w.provider.getClass() );
|
||||
boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.dimensionId );
|
||||
|
||||
@@ -52,7 +52,9 @@ public class BasicCellHandler implements ICellHandler
|
||||
public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel channel )
|
||||
{
|
||||
if( channel == StorageChannel.ITEMS )
|
||||
{
|
||||
return CellInventory.getCell( is, container );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ public class CreativeCellHandler implements ICellHandler
|
||||
public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel channel )
|
||||
{
|
||||
if( channel == StorageChannel.ITEMS && is != null && is.getItem() instanceof ItemCreativeStorageCell )
|
||||
{
|
||||
return CreativeCellInventory.getCell( is );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,9 @@ public class ExternalIInv implements IExternalStorageHandler
|
||||
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, d );
|
||||
|
||||
if( channel == StorageChannel.ITEMS && ad != null )
|
||||
{
|
||||
return new MEMonitorIInventory( ad );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -90,20 +90,32 @@ public class InscriberRecipe implements IInscriberRecipe
|
||||
public boolean equals( Object o )
|
||||
{
|
||||
if( this == o )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if( !(o instanceof IInscriberRecipe) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
IInscriberRecipe that = (IInscriberRecipe) o;
|
||||
|
||||
if( !this.inputs.equals( that.getInputs() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( !this.output.equals( that.getOutput() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( !this.maybeTop.equals( that.getTopOptional() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( !this.maybeBot.equals( that.getBottomOptional()) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return this.type == that.getProcessType();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user