mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-27 15:23:16 +00:00
Merge branch 'master' into development
Conflicts: src/main/java/mekanism/common/Mekanism.java src/main/java/mekanism/generators/common/MekanismGenerators.java src/main/java/mekanism/generators/common/tile/TileEntityGasGenerator.java src/main/java/mekanism/tools/common/MekanismTools.java
This commit is contained in:
commit
3561f9fe59
5 files changed
+30
-7
No files matched your search
@@ -300,7 +300,7 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
for(Coord4D coord : ((Map<Coord4D, IGasHandler>)possibleAcceptors.clone()).keySet())
|
||||
for(Coord4D coord : possibleAcceptors.keySet())
|
||||
{
|
||||
EnumSet<ForgeDirection> sides = acceptorDirections.get(coord);
|
||||
IGasHandler acceptor = (IGasHandler)coord.getTileEntity(getWorld());
|
||||
|
||||
@@ -238,7 +238,7 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
for(Coord4D coord : ((Map<Coord4D, TileEntity>)possibleAcceptors.clone()).keySet())
|
||||
for(Coord4D coord : possibleAcceptors.keySet())
|
||||
{
|
||||
EnumSet<ForgeDirection> sides = acceptorDirections.get(coord);
|
||||
TileEntity acceptor = coord.getTileEntity(getWorld());
|
||||
|
||||
@@ -317,7 +317,7 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
for(Coord4D coord : ((Map<Coord4D, IFluidHandler>)possibleAcceptors.clone()).keySet())
|
||||
for(Coord4D coord : possibleAcceptors.keySet())
|
||||
{
|
||||
EnumSet<ForgeDirection> sides = acceptorDirections.get(coord);
|
||||
IFluidHandler acceptor = (IFluidHandler)coord.getTileEntity(getWorld());
|
||||
|
||||
@@ -57,7 +57,7 @@ public class InventoryNetwork extends DynamicNetwork<IInventory, InventoryNetwor
|
||||
{
|
||||
List<AcceptorData> toReturn = new ArrayList<AcceptorData>();
|
||||
|
||||
for(Coord4D coord : ((Map<Coord4D, IInventory>)possibleAcceptors.clone()).keySet())
|
||||
for(Coord4D coord : possibleAcceptors.keySet())
|
||||
{
|
||||
EnumSet<ForgeDirection> sides = acceptorDirections.get(coord);
|
||||
IInventory acceptor = (IInventory)coord.getTileEntity(getWorld());
|
||||
|
||||
@@ -75,7 +75,13 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
||||
if(gasType != null && FuelHandler.getFuel(gasType) != null)
|
||||
{
|
||||
GasStack removed = GasTransmission.removeGas(inventory[0], gasType, fuelTank.getNeeded());
|
||||
fuelTank.receive(removed, true);
|
||||
boolean isTankEmpty = (fuelTank.getGas() == null);
|
||||
int fuelReceived = fuelTank.receive(removed, true);
|
||||
|
||||
if(fuelReceived > 0 && isTankEmpty)
|
||||
{
|
||||
output = FuelHandler.getFuel(fuelTank.getGas().getGas()).energyPerTick * 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,6 +215,7 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
||||
}
|
||||
|
||||
generationRate = dataStream.readDouble();
|
||||
output = dataStream.readDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -227,6 +234,7 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
||||
}
|
||||
|
||||
data.add(generationRate);
|
||||
data.add(output);
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -234,9 +242,18 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack, boolean doTransfer)
|
||||
{
|
||||
if(fuelTank.getGas() == null || fuelTank.getGas().isGasEqual(stack))
|
||||
boolean isTankEmpty = (fuelTank.getGas() == null);
|
||||
|
||||
if(isTankEmpty || fuelTank.getGas().isGasEqual(stack))
|
||||
{
|
||||
return fuelTank.receive(stack, doTransfer);
|
||||
int fuelReceived = fuelTank.receive(stack, true);
|
||||
|
||||
if (isTankEmpty && fuelReceived > 0)
|
||||
{
|
||||
output = FuelHandler.getFuel(fuelTank.getGas().getGas()).energyPerTick * 2;
|
||||
}
|
||||
|
||||
return fuelReceived;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -248,6 +265,12 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
||||
super.readFromNBT(nbtTags);
|
||||
|
||||
fuelTank.read(nbtTags.getCompoundTag("fuelTank"));
|
||||
FuelGas fuel = FuelHandler.getFuel(fuelTank.getGas().getGas());
|
||||
|
||||
if(fuel != null)
|
||||
{
|
||||
output = fuel.energyPerTick * 2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user