Fixed the Marx generator not charging past a certain point, closes #39

This commit is contained in:
malte0811 2018-08-25 16:53:59 +02:00
parent d51562b937
commit 0eb9a03185
2 changed files with 8 additions and 4 deletions

View file

@ -105,7 +105,7 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
public FiringState state = FiringState.CHARGING;
public Discharge dischargeData;
// Voltage=10*storedJ
private JouleEnergyStorage storage = new JouleEnergyStorage(5_000, 3_200);
private JouleEnergyStorage storage = new JouleEnergyStorage(50_000, 20*32_000);
private boolean hasConnection;
private double[] capVoltages;
private int voltageControl = 0;
@ -536,8 +536,10 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
public double insertEnergy(double joules, boolean simulate, EnergyType type) {
TileEntityMarx master = master(this);
if (master!=null) {
double ret = master.storage.insert(joules, ConversionUtil.joulesPerEu(), simulate, master.leftover);
master.leftover -= ret;
double ret = master.storage.insert(joules, 1, simulate, master.leftover);
if (!simulate) {
master.leftover -= ret;
}
return joules -ret;
} else {
return 0;

View file

@ -15,6 +15,7 @@
package malte0811.industrialWires.blocks.wire;
import blusunrize.immersiveengineering.api.IEProperties;
import malte0811.industrialWires.IWConfig;
import malte0811.industrialWires.IndustrialWires;
import malte0811.industrialWires.blocks.BlockIWBase;
import malte0811.industrialWires.blocks.IMetaEnum;
@ -163,7 +164,8 @@ public class BlockIC2Connector extends BlockIWBase implements IMetaEnum {
tooltip.add(I18n.format(IndustrialWires.MODID + ".tooltip.power_tier", (type%5) + 1));
MixedWireType wire = MixedWireType.ALL[type];
tooltip.add(I18n.format(IndustrialWires.MODID + ".tooltip.energy_per_tick",
wire.getIORate()*ConversionUtil.euPerJoule(), wire.getIORate()*ConversionUtil.ifPerJoule()));
wire.getIORate()*ConversionUtil.euPerJoule(),
wire.getIORate()*ConversionUtil.ifPerJoule()*IWConfig.wireRatio));
}
}