From 43bd502095ad2af110cc2f0cc424a8c1ac9a3bcd Mon Sep 17 00:00:00 2001 From: malte0811 Date: Tue, 27 Nov 2018 21:26:07 +0100 Subject: [PATCH] Fix the Marx generator not breaking/processing ores, closes #47 Fix panel wire connectors not working when connected directly to another one or the Marge generator --- .../controlpanel/TileEntityRSPanelIE.java | 6 ++---- .../blocks/hv/TileEntityMarx.java | 21 ++++++------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/main/java/malte0811/industrialwires/blocks/controlpanel/TileEntityRSPanelIE.java b/src/main/java/malte0811/industrialwires/blocks/controlpanel/TileEntityRSPanelIE.java index aa0b768..d038f6e 100644 --- a/src/main/java/malte0811/industrialwires/blocks/controlpanel/TileEntityRSPanelIE.java +++ b/src/main/java/malte0811/industrialwires/blocks/controlpanel/TileEntityRSPanelIE.java @@ -116,9 +116,7 @@ public class TileEntityRSPanelIE extends TileEntityRSPanel//TODO what parts of T @Override public void connectCable(WireType wireType, TargetingInfo targetingInfo, IImmersiveConnectable other) { hasConn = true; - if (other instanceof IRedstoneConnector && ((IRedstoneConnector) other).getNetwork() != wireNetwork) { - wireNetwork.mergeNetwork(((IRedstoneConnector) other).getNetwork()); - } + RedstoneWireNetwork.updateConnectors(pos, world, wireNetwork); } @Override @@ -128,7 +126,7 @@ public class TileEntityRSPanelIE extends TileEntityRSPanel//TODO what parts of T @Override public boolean allowEnergyToPass(ImmersiveNetHandler.Connection connection) { - return false; + return true; } @Override diff --git a/src/main/java/malte0811/industrialwires/blocks/hv/TileEntityMarx.java b/src/main/java/malte0811/industrialwires/blocks/hv/TileEntityMarx.java index 2ef08dc..2f95a21 100644 --- a/src/main/java/malte0811/industrialwires/blocks/hv/TileEntityMarx.java +++ b/src/main/java/malte0811/industrialwires/blocks/hv/TileEntityMarx.java @@ -72,7 +72,6 @@ import java.util.*; import static blusunrize.immersiveengineering.api.energy.wires.WireType.REDSTONE_CATEGORY; import static malte0811.industrialwires.blocks.hv.TileEntityMarx.FiringState.FIRE; -import static malte0811.industrialwires.util.MiscUtils.getOffset; import static malte0811.industrialwires.util.MiscUtils.offset; import static malte0811.industrialwires.util.NBTKeys.*; import static malte0811.industrialwires.wires.MixedWireType.IC2_HV_CAT; @@ -285,11 +284,11 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable, private void handleOreProcessing(double energyStored) { BlockPos bottom = getBottomElectrode(); - Set toBreak = new HashSet<>(stageCount-2); + List toBreak = new ArrayList<>(stageCount - 2); int ores = 0; for (int i = 1;i fools = world.getEntitiesWithinAABB(Entity.class, aabb); damageDistSqu *= damageDistSqu; @@ -370,16 +369,6 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable, } } - //checks whether the given pos can't be broken because it is part of the generator - private boolean canBreak(BlockPos pos) { - BlockPos dischargePos = offset(this.pos, facing, mirrored, 1, 3, 0); - Vec3i offset = getOffset(dischargePos, facing, mirrored, pos); - if (offset.getZ()<1||offset.getZ()>=stageCount-1) { - return false; - } - return Math.abs(offset.getX())>Math.abs(offset.getY()); - } - private int getRSSignalFromVoltage(double voltage) { return (int) (Math.round(255 * voltage / MAX_VOLTAGE)&0xff); } @@ -566,6 +555,8 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable, @Override public void connectCable(WireType cableType, TargetingInfo target, IImmersiveConnectable other) { hasConnection = true; + if (WireType.REDSTONE_CATEGORY.equals(cableType.getCategory())) + RedstoneWireNetwork.updateConnectors(pos, world, getNetwork()); } @Override @@ -575,7 +566,7 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable, @Override public boolean allowEnergyToPass(ImmersiveNetHandler.Connection con) { - return false; + return true; } @Override