Ensure that disabled parts are actually disabled and removed.

This commit is contained in:
yueh
2015-07-10 00:07:45 +02:00
parent 91b8d30a15
commit c823e1464b
13 changed files with 235 additions and 95 deletions
@@ -155,7 +155,10 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
throw new IllegalStateException( "Meta Overlap detected with type " + mat + " and damage " + partDamage + ". Found " + registeredPartType + " there already." );
}
this.registered.put( partDamage, pti );
if( enabled )
{
this.registered.put( partDamage, pti );
}
}
public int getDamageByType( PartType t )
@@ -195,6 +198,11 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
@Override
public boolean onItemUse( ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
{
if( this.getTypeByStack( is ) == PartType.InvalidType )
{
return false;
}
return AEApi.instance().partHelper().placeBus( is, x, y, z, side, player, w );
}
@@ -396,7 +404,6 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
}
}
private static final class RegisteredComparator implements Comparator<Entry<Integer, PartTypeWithVariant>>
{
@Override
@@ -31,9 +31,9 @@ import appeng.integration.IntegrationType;
import appeng.parts.automation.PartAnnihilationPlane;
import appeng.parts.automation.PartExportBus;
import appeng.parts.automation.PartFormationPlane;
import appeng.parts.automation.PartIdentityAnnihilationPlane;
import appeng.parts.automation.PartImportBus;
import appeng.parts.automation.PartLevelEmitter;
import appeng.parts.automation.PartIdentityAnnihilationPlane;
import appeng.parts.misc.PartCableAnchor;
import appeng.parts.misc.PartInterface;
import appeng.parts.misc.PartInvertedToggleBus;