mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 03:36:47 -04:00
added side check to avoid potential crash in GUIs
This commit is contained in:
parent
461e4abbbf
commit
9d545e653d
@ -1,5 +1,6 @@
|
|||||||
package li.cil.oc.common.container
|
package li.cil.oc.common.container
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler
|
||||||
import li.cil.oc.api
|
import li.cil.oc.api
|
||||||
import li.cil.oc.common.tileentity
|
import li.cil.oc.common.tileentity
|
||||||
import li.cil.oc.server.{PacketSender => ServerPacketSender}
|
import li.cil.oc.server.{PacketSender => ServerPacketSender}
|
||||||
@ -25,9 +26,11 @@ class Robot(playerInventory: InventoryPlayer, robot: tileentity.Robot) extends P
|
|||||||
|
|
||||||
override def detectAndSendChanges() {
|
override def detectAndSendChanges() {
|
||||||
super.detectAndSendChanges()
|
super.detectAndSendChanges()
|
||||||
if (math.abs(robot.globalBuffer - lastSentBuffer) > 1) {
|
if (FMLCommonHandler.instance.getEffectiveSide.isServer) {
|
||||||
lastSentBuffer = robot.globalBuffer
|
if (math.abs(robot.globalBuffer - lastSentBuffer) > 1) {
|
||||||
ServerPacketSender.sendPowerState(robot)
|
lastSentBuffer = robot.globalBuffer
|
||||||
|
ServerPacketSender.sendPowerState(robot)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user