mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-20 12:09:45 +00:00
Fix some client/server stuff, and fluid networks
This commit is contained in:
1 parent
d14686ea2e
commit
29659ad2cd
6 files changed
+40
-40
No files matched your search
@@ -68,15 +68,18 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
|
||||
{
|
||||
if(buffer == null)
|
||||
{
|
||||
buffer = net.buffer;
|
||||
buffer = net.buffer.copy();
|
||||
} else
|
||||
{
|
||||
if(buffer.getGas() != net.buffer.getGas())
|
||||
if(buffer.getGas() == net.buffer.getGas())
|
||||
{
|
||||
throw new RuntimeException("Gas types did not match when merging networks: " + buffer.getGas() + " vs. " + net.buffer.getGas());
|
||||
buffer.amount += net.buffer.amount;
|
||||
}
|
||||
else if(net.buffer.amount > buffer.amount)
|
||||
{
|
||||
buffer = net.buffer.copy();
|
||||
}
|
||||
|
||||
buffer.amount += net.buffer.amount;
|
||||
}
|
||||
|
||||
net.buffer = null;
|
||||
@@ -106,12 +109,10 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
|
||||
|
||||
if(buffer == null || buffer.getGas() == null || buffer.amount == 0)
|
||||
{
|
||||
buffer = gas;
|
||||
buffer = gas.copy();
|
||||
return;
|
||||
}
|
||||
|
||||
if(gas.getGas() != buffer.getGas())throw new RuntimeException("Gas Type " + gas.getGas().getName() + " of buffer does not match gas type " + buffer.getGas().getName() + " of Network");
|
||||
|
||||
buffer.amount += gas.amount;
|
||||
gas.amount = 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user