From 6b90bbe421d9c25a9964cc9d0ece19b0844b7e93 Mon Sep 17 00:00:00 2001 From: Summet-V Date: Wed, 4 Nov 2020 17:53:33 +0300 Subject: [PATCH] Controlled property for blocks --- core/src/mindustry/entities/comp/BuildingComp.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 8363d16d02..11d61e1b6a 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -29,10 +29,12 @@ import mindustry.logic.*; import mindustry.type.*; import mindustry.ui.*; import mindustry.world.*; +import mindustry.world.blocks.*; import mindustry.world.blocks.ConstructBlock.*; import mindustry.world.blocks.environment.*; import mindustry.world.blocks.payloads.*; import mindustry.world.blocks.power.*; +import mindustry.world.blocks.units.*; import mindustry.world.consumers.*; import mindustry.world.meta.*; import mindustry.world.modules.*; @@ -1285,6 +1287,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, case powerNetStored -> power == null ? 0 : power.graph.getLastPowerStored(); case powerNetCapacity -> power == null ? 0 : power.graph.getLastCapacity(); case enabled -> enabled ? 1 : 0; + case controlled -> this instanceof ControlBlock c ? c.isControlled() ? 1 : 0 : 0; case payloadCount -> getPayload() != null ? 1 : 0; default -> 0; };