From 0efb5151942d3837a0416e9769e9a4e044c76096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sun, 14 Feb 2021 13:14:38 +0100 Subject: [PATCH] Enable robots to check their energy level. --- .../java/li/cil/oc2/common/entity/RobotEntity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/li/cil/oc2/common/entity/RobotEntity.java b/src/main/java/li/cil/oc2/common/entity/RobotEntity.java index 4d8c467e..3c7d5198 100644 --- a/src/main/java/li/cil/oc2/common/entity/RobotEntity.java +++ b/src/main/java/li/cil/oc2/common/entity/RobotEntity.java @@ -868,6 +868,16 @@ public final class RobotEntity extends Entity implements Robot { return actionProcessor.rotate(direction); } + @Callback(synchronize = false) + public int getCurrentEnergy() { + return energy.getEnergyStored(); + } + + @Callback(synchronize = false) + public int getMaxEnergy() { + return energy.getMaxEnergyStored(); + } + @Callback(synchronize = false) public int getLastActionId() { return actionProcessor.lastActionId;