Extracts item comparison from Platform into their own helper. (#2555)
* Extracts item comparison from Platform into their own helper. Renamed methods to be more more fitting for the actual comparison. Added documentation about each methods behaviour.
This commit is contained in:
@@ -1066,7 +1066,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
final ItemStack current = p == null ? null : p.getItemStack( PartItemStack.WORLD );
|
||||
|
||||
if( Platform.isSameItemType( iss, current ) )
|
||||
if( Platform.itemComparisons().isEqualItemType( iss, current ) )
|
||||
{
|
||||
p.readFromNBT( extra );
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class StackUpgradeInventory extends UpgradeInventory
|
||||
|
||||
for( final ItemStack is : upgrades.getSupported().keySet() )
|
||||
{
|
||||
if( Platform.isSameItem( this.stack, is ) )
|
||||
if( Platform.itemComparisons().isEqualItem( this.stack, is ) )
|
||||
{
|
||||
max = upgrades.getSupported().get( is );
|
||||
break;
|
||||
|
||||
@@ -111,7 +111,7 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
|
||||
{
|
||||
ItemStack sub = itemHandler.getStackInSlot( i );
|
||||
|
||||
if( !Platform.isSameItemPrecise( sub, req ) )
|
||||
if( !Platform.itemComparisons().isSameItem( sub, req ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -275,7 +275,7 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
|
||||
return false;
|
||||
}
|
||||
|
||||
return a == null || b == null || !Platform.isSameItemPrecise( a, b );
|
||||
return a == null || b == null || !Platform.itemComparisons().isSameItem( a, b );
|
||||
}
|
||||
|
||||
private void postDifference( Iterable<IAEItemStack> a )
|
||||
|
||||
@@ -270,7 +270,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
break;
|
||||
}
|
||||
|
||||
if( newType != null && !Platform.isSameItem( newType, this.getItemStack() ) )
|
||||
if( newType != null && !Platform.itemComparisons().isEqualItem( newType, this.getItemStack() ) )
|
||||
{
|
||||
final boolean oldOutput = this.isOutput();
|
||||
final long myFreq = this.getFrequency();
|
||||
|
||||
Reference in New Issue
Block a user