2015-08-06 18:49:57 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
package appeng.parts.automation;
|
|
|
|
|
|
|
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
import appeng.api.config.Upgrades;
|
|
|
|
import appeng.api.definitions.IItemDefinition;
|
|
|
|
import appeng.tile.inventory.IAEAppEngInventory;
|
|
|
|
|
|
|
|
|
|
|
|
public final class DefinitionUpgradeInventory extends UpgradeInventory
|
|
|
|
{
|
|
|
|
private final IItemDefinition definition;
|
|
|
|
|
|
|
|
public DefinitionUpgradeInventory( IItemDefinition definition, IAEAppEngInventory parent, int s )
|
|
|
|
{
|
|
|
|
super( parent, s );
|
|
|
|
|
|
|
|
this.definition = definition;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getMaxInstalled( Upgrades upgrades )
|
|
|
|
{
|
|
|
|
int max = 0;
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
for( ItemStack stack : upgrades.getSupported().keySet() )
|
2015-01-03 02:53:14 +01:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.definition.isSameAs( stack ) )
|
2015-01-03 02:53:14 +01:00
|
|
|
{
|
|
|
|
max = upgrades.getSupported().get( stack );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return max;
|
|
|
|
}
|
|
|
|
}
|