Temporary fix for multiple buffer type merges

This commit is contained in:
Aidan C. Brady 2015-04-15 12:52:07 -04:00
parent 2c53ce6956
commit 308233720c
2 changed files with 15 additions and 7 deletions

View file

@ -98,6 +98,7 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
public void absorbBuffer(IGridTransmitter<IGasHandler, GasNetwork> transmitter)
{
Object b = transmitter.getBuffer();
if(!(b instanceof GasStack) || ((GasStack)b).getGas() == null || ((GasStack)b).amount == 0)
{
return;
@ -111,9 +112,12 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
return;
}
// if(!gas.isGasEqual(buffer)) Mekanism.logger.warn("Gas type " + gas.getGas().getName() + " of buffer doesn't match type " + buffer.getGas().getName() + " of absorbing network");
//TODO better multiple buffer impl
if(buffer.isGasEqual(gas))
{
buffer.amount += gas.amount;
}
buffer.amount += gas.amount;
gas.amount = 0;
}

View file

@ -82,6 +82,7 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
public void absorbBuffer(IGridTransmitter<IFluidHandler, FluidNetwork> transmitter)
{
Object b = transmitter.getBuffer();
if(!(b instanceof FluidStack) || ((FluidStack)b).getFluid() == null || ((FluidStack)b).amount == 0)
{
return;
@ -95,9 +96,12 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
return;
}
if(!fluid.isFluidEqual(buffer)) Mekanism.logger.warn("Fluid type " + fluid.getFluid().getName() + " of buffer doesn't match type " + buffer.getFluid().getName() + " of absorbing network");
//TODO better multiple buffer impl
if(buffer.isFluidEqual(fluid))
{
buffer.amount += fluid.amount;
}
buffer.amount += fluid.amount;
fluid.amount = 0;
}