mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 17:56:34 -04:00
Added getter to internal.Robot to allow upgrade renderers know whether to animate or not. Closes #1127.
This commit is contained in:
parent
576b28fc68
commit
3540809a0d
@ -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.
|
||||
* <p/>
|
||||
* 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();
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user