From e2b9977ebc60bff3a39457b706fa1e4b5d77984d Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Thu, 5 Mar 2020 21:27:28 +0100 Subject: [PATCH] Remove omnidirectional due to issues --- core/src/mindustry/entities/type/TileEntity.java | 4 ---- core/src/mindustry/world/blocks/Autotiler.java | 6 ++---- core/src/mindustry/world/blocks/distribution/Conveyor.java | 2 +- .../mindustry/world/blocks/distribution/CraterConveyor.java | 5 ----- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/core/src/mindustry/entities/type/TileEntity.java b/core/src/mindustry/entities/type/TileEntity.java index 9a41e6c9fb..0814a4ce58 100644 --- a/core/src/mindustry/entities/type/TileEntity.java +++ b/core/src/mindustry/entities/type/TileEntity.java @@ -122,10 +122,6 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{ return dead || tile.entity != this; } - public boolean isOmnidirectional(){ - return !block.rotate; - } - @CallSuper public void write(DataOutput stream) throws IOException{ stream.writeShort((short)health); diff --git a/core/src/mindustry/world/blocks/Autotiler.java b/core/src/mindustry/world/blocks/Autotiler.java index 89700e739a..75cb41419a 100644 --- a/core/src/mindustry/world/blocks/Autotiler.java +++ b/core/src/mindustry/world/blocks/Autotiler.java @@ -9,8 +9,6 @@ import mindustry.world.*; import java.util.*; -import static mindustry.Vars.world; - public interface Autotiler{ class AutotilerHolder{ static final int[] blendresult = new int[3]; @@ -91,13 +89,13 @@ public interface Autotiler{ default boolean blendsArmored(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) - || ((world.tile(otherx, othery).entity.isOmnidirectional() && Edges.getFacingEdge(otherblock, otherx, othery, tile) != null && + || ((!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)))); } default boolean lookingAt(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) - || (world.tile(otherx, othery).entity.isOmnidirectional() || Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y))); + || (!otherblock.rotate || Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y))); } boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock); diff --git a/core/src/mindustry/world/blocks/distribution/Conveyor.java b/core/src/mindustry/world/blocks/distribution/Conveyor.java index e64b184c24..9d7c8cebd6 100644 --- a/core/src/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/mindustry/world/blocks/distribution/Conveyor.java @@ -285,7 +285,7 @@ public class Conveyor extends Block implements Autotiler{ ConveyorEntity e = tile.ent(); if(e.len >= capacity) return false; int direction = source == null ? 0 : Math.abs(source.relativeTo(tile.x, tile.y) - tile.rotation()); - return (((direction == 0) && e.minitem >= itemSpace) || ((direction % 2 == 1) && e.minitem > 0.7f)) && (source == null || source.entity.isOmnidirectional() && (source.rotation() + 2) % 4 == tile.rotation()); + return (((direction == 0) && e.minitem >= itemSpace) || ((direction % 2 == 1) && e.minitem > 0.7f)) && (source == null || !(source.block().rotate && (source.rotation() + 2) % 4 == tile.rotation())); } @Override diff --git a/core/src/mindustry/world/blocks/distribution/CraterConveyor.java b/core/src/mindustry/world/blocks/distribution/CraterConveyor.java index 1855f6bc50..5fceab89e9 100644 --- a/core/src/mindustry/world/blocks/distribution/CraterConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/CraterConveyor.java @@ -269,11 +269,6 @@ public class CraterConveyor extends Block implements Autotiler{ dump = stream.readByte(); reload = stream.readFloat(); } - - @Override - public boolean isOmnidirectional(){ - return blendbit2 == 6; - } } // crater conveyor tiles that input into this one