mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 02:12:42 -04:00
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:
parent
f73418f231
commit
a0fd81c783
@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly
|
|||||||
import li.cil.oc.Settings
|
import li.cil.oc.Settings
|
||||||
import li.cil.oc.api.network.Analyzable
|
import li.cil.oc.api.network.Analyzable
|
||||||
import li.cil.oc.api.network._
|
import li.cil.oc.api.network._
|
||||||
|
import li.cil.oc.client.gui
|
||||||
import li.cil.oc.common.component.TextBuffer
|
import li.cil.oc.common.component.TextBuffer
|
||||||
import li.cil.oc.util.Color
|
import li.cil.oc.util.Color
|
||||||
import li.cil.oc.util.ExtendedWorld._
|
import li.cil.oc.util.ExtendedWorld._
|
||||||
@ -271,6 +272,13 @@ class Screen(var tier: Int) extends traits.TextBuffer with SidedEnvironment with
|
|||||||
override def dispose() {
|
override def dispose() {
|
||||||
super.dispose()
|
super.dispose()
|
||||||
screens.clone().foreach(_.checkMultiBlock())
|
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() {
|
override protected def onColorChanged() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user