remove forced level emitters update

remove unneeded itemStack creation.
This commit is contained in:
Salomão
2021-01-04 12:34:44 -03:00
parent a3e69ce608
commit e6998913e1
3 changed files with 4 additions and 8 deletions
@@ -171,7 +171,6 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
@Override @Override
public void postChange( final IBaseMonitor<IAEFluidStack> monitor, final Iterable<IAEFluidStack> change, final IActionSource actionSource ) public void postChange( final IBaseMonitor<IAEFluidStack> monitor, final Iterable<IAEFluidStack> change, final IActionSource actionSource )
{ {
this.updateReportingValue( (IMEMonitor<IAEFluidStack>) monitor );
} }
@Override @Override
@@ -504,17 +504,16 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
fuzz = fuzz.copy(); fuzz = fuzz.copy();
fuzz.setStackSize( g.getStackSize() ); fuzz.setStackSize( g.getStackSize() );
final IAEItemStack ais = this.inventory.extractItems( fuzz, Actionable.SIMULATE, this.machineSrc ); final IAEItemStack ais = this.inventory.extractItems( fuzz, Actionable.SIMULATE, this.machineSrc );
final ItemStack is = ais == null ? ItemStack.EMPTY : ais.createItemStack();
if( !is.isEmpty() && is.getCount() == g.getStackSize() ) if (ais != null && ais.getStackSize() == g.getStackSize())
{ {
found = true; found = true;
break; break;
} }
else if( !is.isEmpty() ) else if( ais != null )
{ {
g = g.copy(); g = g.copy();
g.decStackSize( is.getCount() ); g.decStackSize( ais.getStackSize() );
} }
} }
@@ -526,9 +525,8 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
else else
{ {
final IAEItemStack ais = this.inventory.extractItems( g.copy(), Actionable.SIMULATE, this.machineSrc ); final IAEItemStack ais = this.inventory.extractItems( g.copy(), Actionable.SIMULATE, this.machineSrc );
final ItemStack is = ais == null ? ItemStack.EMPTY : ais.createItemStack();
if( is.isEmpty() || is.getCount() < g.getStackSize() ) if (ais == null || ais.getStackSize() < g.getStackSize())
{ {
return false; return false;
} }
@@ -400,7 +400,6 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override @Override
public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change, final IActionSource actionSource ) public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change, final IActionSource actionSource )
{ {
this.updateReportingValue( (IMEMonitor<IAEItemStack>) monitor );
} }
@Override @Override