Ensure that disabled parts are actually disabled and removed.

This commit is contained in:
yueh
2015-07-10 00:07:45 +02:00
committed by thatsIch
parent b013f3a8fa
commit c978bf90f8
11 changed files with 243 additions and 104 deletions
@@ -157,7 +157,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 )
@@ -175,16 +178,13 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
}
@Override
public boolean onItemUse(
ItemStack is,
EntityPlayer player,
World w,
BlockPos pos,
EnumFacing side,
float hitX,
float hitY,
float hitZ )
public boolean onItemUse( ItemStack is, EntityPlayer player, World w, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ )
{
if( this.getTypeByStack( is ) == PartType.InvalidType )
{
return false;
}
return AEApi.instance().partHelper().placeBus( is, pos, side, player, w );
}
@@ -411,7 +411,6 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
}
}
private static final class RegisteredComparator implements Comparator<Entry<Integer, PartTypeWithVariant>>
{
@Override