diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 613c99cfc3..c2248cffb1 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -519,6 +519,10 @@ public class Block extends UnlockableContent implements Senseable{ return rotate; } + public boolean rotatedOutput(int fromX, int fromY, Tile destination){ + return rotatedOutput(fromX, fromY); + } + public boolean synthetic(){ return update || destructible; } diff --git a/core/src/mindustry/world/blocks/Autotiler.java b/core/src/mindustry/world/blocks/Autotiler.java index b23635a9d4..fa62143fd5 100644 --- a/core/src/mindustry/world/blocks/Autotiler.java +++ b/core/src/mindustry/world/blocks/Autotiler.java @@ -206,7 +206,7 @@ public interface Autotiler{ //block is facing the other Point2.equals(tile.x + Geometry.d4(rotation).x, tile.y + Geometry.d4(rotation).y, otherx, othery) || //does not output to rotated direction - !otherblock.rotatedOutput(otherx, othery) || + !otherblock.rotatedOutput(otherx, othery, tile) || //other block is facing this one Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y); } diff --git a/core/src/mindustry/world/blocks/production/GenericCrafter.java b/core/src/mindustry/world/blocks/production/GenericCrafter.java index 1a2843e829..03a7b867bc 100644 --- a/core/src/mindustry/world/blocks/production/GenericCrafter.java +++ b/core/src/mindustry/world/blocks/production/GenericCrafter.java @@ -13,6 +13,7 @@ import mindustry.gen.*; import mindustry.logic.*; import mindustry.type.*; import mindustry.world.*; +import mindustry.world.blocks.liquid.Conduit.*; import mindustry.world.draw.*; import mindustry.world.meta.*; @@ -91,8 +92,17 @@ public class GenericCrafter extends Block{ } @Override - public boolean rotatedOutput(int x, int y){ - return false; + public boolean rotatedOutput(int fromX, int fromY, Tile destination){ + if(!(destination.build instanceof ConduitBuild)) return false; + + Building crafter = world.build(fromX, fromY); + if(crafter == null) return false; + int relative = Mathf.mod(crafter.relativeTo(destination) - crafter.rotation, 4); + for(int dir : liquidOutputDirections){ + if(dir == -1 || dir == relative) return false; + } + + return true; } @Override