Fixed issue with Upgrades not having correct maximums.
This commit is contained in:
@@ -16,7 +16,7 @@ public class PartUpgradeable extends PartBasicState implements ISegmentedInvento
|
|||||||
{
|
{
|
||||||
|
|
||||||
IConfigManager settings = new ConfigManager( this );
|
IConfigManager settings = new ConfigManager( this );
|
||||||
private UpgradeInventory upgrades = new UpgradeInventory( is.getItem(), this, 4 );
|
private UpgradeInventory upgrades = new UpgradeInventory( is, this, getUpgradeSlots() );
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getInstalledUpgrades(Upgrades u)
|
public int getInstalledUpgrades(Upgrades u)
|
||||||
@@ -24,6 +24,11 @@ public class PartUpgradeable extends PartBasicState implements ISegmentedInvento
|
|||||||
return upgrades.getInstalledUpgrades( u );
|
return upgrades.getInstalledUpgrades( u );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected int getUpgradeSlots()
|
||||||
|
{
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
public void writeToNBT(net.minecraft.nbt.NBTTagCompound extra)
|
public void writeToNBT(net.minecraft.nbt.NBTTagCompound extra)
|
||||||
{
|
{
|
||||||
super.writeToNBT( extra );
|
super.writeToNBT( extra );
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE
|
|||||||
private int getMaxInstalled(Upgrades u)
|
private int getMaxInstalled(Upgrades u)
|
||||||
{
|
{
|
||||||
Integer max = null;
|
Integer max = null;
|
||||||
|
|
||||||
for (ItemStack is : u.getSupported().keySet())
|
for (ItemStack is : u.getSupported().keySet())
|
||||||
{
|
{
|
||||||
if ( is.getItem() == itemorblock )
|
if ( is.getItem() == itemorblock )
|
||||||
@@ -78,6 +77,11 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE
|
|||||||
max = u.getSupported().get( is );
|
max = u.getSupported().get( is );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if ( itemorblock instanceof ItemStack && Platform.isSameItem( (ItemStack) itemorblock, is ) )
|
||||||
|
{
|
||||||
|
max = u.getSupported().get( is );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( max == null )
|
if ( max == null )
|
||||||
|
|||||||
Reference in New Issue
Block a user