diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/ArmoredConduit.java b/core/src/io/anuke/mindustry/world/blocks/distribution/ArmoredConduit.java index 8655562c08..a977d10e25 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/ArmoredConduit.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/ArmoredConduit.java @@ -42,8 +42,6 @@ public class ArmoredConduit extends Conduit{ @Override public boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){ - return otherblock.outputsLiquid && (Point2.equals(tile.x + Geometry.d4(rotation).x, tile.y + Geometry.d4(rotation).y, otherx, othery) - || ((!otherblock.rotate && Edges.getFacingEdge(otherblock, otherx, othery, tile) != null && - Edges.getFacingEdge(otherblock, otherx, othery, tile).relativeTo(tile) == rotation) || (otherblock.rotate && Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y)))); + return otherblock.outputsLiquid && ArmoredConveyor.blender(tile, rotation, otherx, othery, otherrot, otherblock); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/ArmoredConveyor.java b/core/src/io/anuke/mindustry/world/blocks/distribution/ArmoredConveyor.java index fad38034e5..c71ff7e208 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/ArmoredConveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/ArmoredConveyor.java @@ -17,8 +17,12 @@ public class ArmoredConveyor extends Conveyor{ @Override public boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){ - return otherblock.outputsItems() && (Point2.equals(tile.x + Geometry.d4(rotation).x, tile.y + Geometry.d4(rotation).y, otherx, othery) - || ((!otherblock.rotate && Edges.getFacingEdge(otherblock, otherx, othery, tile) != null && - Edges.getFacingEdge(otherblock, otherx, othery, tile).relativeTo(tile) == rotation) || (otherblock.rotate && Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y)))); + return otherblock.outputsItems() && blender(tile, rotation, otherx, othery, otherrot, otherblock); + } + + public static boolean blender(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){ + return (Point2.equals(tile.x + Geometry.d4(rotation).x, tile.y + Geometry.d4(rotation).y, otherx, othery) + || ((!otherblock.rotate && Edges.getFacingEdge(otherblock, otherx, othery, tile) != null && + Edges.getFacingEdge(otherblock, otherx, othery, tile).relativeTo(tile) == rotation) || (otherblock.rotate && Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y)))); } }