From 0eb9a03185b92aa055a8894abff6a8b389565d84 Mon Sep 17 00:00:00 2001 From: malte0811 Date: Sat, 25 Aug 2018 16:53:59 +0200 Subject: [PATCH] Fixed the Marx generator not charging past a certain point, closes #39 --- .../industrialWires/blocks/hv/TileEntityMarx.java | 8 +++++--- .../industrialWires/blocks/wire/BlockIC2Connector.java | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/malte0811/industrialWires/blocks/hv/TileEntityMarx.java b/src/main/java/malte0811/industrialWires/blocks/hv/TileEntityMarx.java index 6a416ce..2ad54c8 100644 --- a/src/main/java/malte0811/industrialWires/blocks/hv/TileEntityMarx.java +++ b/src/main/java/malte0811/industrialWires/blocks/hv/TileEntityMarx.java @@ -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; diff --git a/src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java b/src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java index 43f6945..25e43ab 100644 --- a/src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java +++ b/src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java @@ -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)); } }