Close GUI of screens getting invalidated.

E.g. if other player breaks screen someone is looking at, or it is moved using some mod (AE2 spatial storage, Redstone/Remain in Motion, Funky Locomotion).
This commit is contained in:
Florian Nücke 2015-05-16 20:28:50 +02:00
parent f73418f231
commit a0fd81c783

View File

@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly
import li.cil.oc.Settings
import li.cil.oc.api.network.Analyzable
import li.cil.oc.api.network._
import li.cil.oc.client.gui
import li.cil.oc.common.component.TextBuffer
import li.cil.oc.util.Color
import li.cil.oc.util.ExtendedWorld._
@ -271,6 +272,13 @@ class Screen(var tier: Int) extends traits.TextBuffer with SidedEnvironment with
override def dispose() {
super.dispose()
screens.clone().foreach(_.checkMultiBlock())
if (isClient) {
Minecraft.getMinecraft.currentScreen match {
case screenGui: gui.Screen if screenGui.buffer == buffer =>
Minecraft.getMinecraft.displayGuiScreen(null)
case _ =>
}
}
}
override protected def onColorChanged() {