From 7ff9ad7351df628893c65a87d59cb90d6a380628 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Sat, 16 Oct 2021 06:49:52 -0700 Subject: [PATCH] Move payload blend check to `BuildingComp` (#6152) --- core/src/mindustry/entities/comp/BuildingComp.java | 4 ++++ .../mindustry/world/blocks/distribution/PayloadConveyor.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 00366c603f..79b6ee9650 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -432,6 +432,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, return block.unloadable; } + public boolean payloadCheck(int conveyorRotation){ + return block.rotate && (rotation + 2) % 4 == conveyorRotation; + } + /** Called when an unloader takes an item. */ public void itemTaken(Item item){ diff --git a/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java b/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java index 2681376e35..8e27cee908 100644 --- a/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java @@ -114,7 +114,7 @@ public class PayloadConveyor extends Block{ int ntrns = 1 + size/2; Tile next = tile.nearby(Geometry.d4(rotation).x * ntrns, Geometry.d4(rotation).y * ntrns); - blocked = (next != null && next.solid() && !(next.block().outputsPayload || next.block().acceptsPayload)) || (this.next != null && this.next.block.rotate && (this.next.rotation + 2) % 4 == rotation); + blocked = (next != null && next.solid() && !(next.block().outputsPayload || next.block().acceptsPayload)) || (this.next != null && this.next.payloadCheck(rotation)); } @Override