diff --git a/src/main/java/li/cil/oc/api/internal/Robot.java b/src/main/java/li/cil/oc/api/internal/Robot.java index 7eca208b7..30eda3ced 100644 --- a/src/main/java/li/cil/oc/api/internal/Robot.java +++ b/src/main/java/li/cil/oc/api/internal/Robot.java @@ -1,5 +1,7 @@ package li.cil.oc.api.internal; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import li.cil.oc.api.driver.EnvironmentHost; import li.cil.oc.api.network.Environment; import net.minecraft.inventory.ISidedInventory; @@ -65,4 +67,14 @@ public interface Robot extends Agent, Environment, EnvironmentHost, Tiered, ISid * network packet to be sent. */ void synchronizeSlot(int slot); + + /** + * This essentially returns whether the robot is currently running or not. + *
+ * This is explicitly meant for client side use, to allow upgrade renderers + * to know whether to resume animations or not, based on whether the robot + * is currently powered on or not. + */ + @SideOnly(Side.CLIENT) + boolean shouldAnimate(); } diff --git a/src/main/scala/li/cil/oc/common/tileentity/Robot.scala b/src/main/scala/li/cil/oc/common/tileentity/Robot.scala index 2062041fe..a3cd0923c 100644 --- a/src/main/scala/li/cil/oc/common/tileentity/Robot.scala +++ b/src/main/scala/li/cil/oc/common/tileentity/Robot.scala @@ -187,6 +187,8 @@ class Robot extends traits.Computer with traits.PowerInformation with IFluidHand ServerPacketSender.sendRobotLightChange(this) } + override def shouldAnimate = isRunning + // ----------------------------------------------------------------------- // override def node = if (isServer) machine.node else null diff --git a/src/main/scala/li/cil/oc/common/tileentity/RobotProxy.scala b/src/main/scala/li/cil/oc/common/tileentity/RobotProxy.scala index b97004f74..d75185d62 100644 --- a/src/main/scala/li/cil/oc/common/tileentity/RobotProxy.scala +++ b/src/main/scala/li/cil/oc/common/tileentity/RobotProxy.scala @@ -68,6 +68,8 @@ class RobotProxy(val robot: Robot) extends traits.Computer with traits.PowerInfo override def setRunning(value: Boolean) = robot.setRunning(value) + override def shouldAnimate(): Boolean = robot.shouldAnimate + // ----------------------------------------------------------------------- // override def componentCount = robot.componentCount