mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -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
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler
|
||||
import li.cil.oc.api
|
||||
import li.cil.oc.common.tileentity
|
||||
import li.cil.oc.server.{PacketSender => ServerPacketSender}
|
||||
@ -25,11 +26,13 @@ class Robot(playerInventory: InventoryPlayer, robot: tileentity.Robot) extends P
|
||||
|
||||
override def detectAndSendChanges() {
|
||||
super.detectAndSendChanges()
|
||||
if (FMLCommonHandler.instance.getEffectiveSide.isServer) {
|
||||
if (math.abs(robot.globalBuffer - lastSentBuffer) > 1) {
|
||||
lastSentBuffer = robot.globalBuffer
|
||||
ServerPacketSender.sendPowerState(robot)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override def canInteractWith(player: EntityPlayer) =
|
||||
super.canInteractWith(player) && robot.canInteract(player.getCommandSenderName)
|
||||
|
Loading…
x
Reference in New Issue
Block a user