fixed dynamic component adding/removal when dynamically changing visibility of components

This commit is contained in:
Florian Nücke 2013-12-08 15:09:10 +01:00
parent 1b15f89498
commit 8c948098d8
2 changed files with 6 additions and 6 deletions

View File

@ -180,9 +180,9 @@ class Screen(var tier: Int) extends Buffer with SidedEnvironment with Rotatable
if (isServer) {
screen.buffer.node.setVisibility(Visibility.None)
}
val s = screen.buffer
val (w, h) = s.resolution
s.buffer.fill(0, 0, w, h, ' ')
val buffer = screen.buffer
val (w, h) = buffer.resolution
buffer.buffer.fill(0, 0, w, h, ' ')
}
)
}

View File

@ -5,7 +5,7 @@ import cpw.mods.fml.relauncher.Side
import java.lang.reflect.{Method, InvocationTargetException}
import li.cil.oc.api
import li.cil.oc.api.network._
import li.cil.oc.common.tileentity
import li.cil.oc.server.component
import li.cil.oc.util.Persistable
import net.minecraft.nbt.NBTTagCompound
import scala.Some
@ -58,12 +58,12 @@ trait Component extends api.network.Component with Persistable {
}
private def addTo(nodes: Iterable[api.network.Node]) = nodes.foreach(_.host match {
case computer: tileentity.Computer => computer.computer.addComponent(this)
case computer: component.Computer => computer.addComponent(this)
case _ =>
})
private def removeFrom(nodes: Iterable[api.network.Node]) = nodes.foreach(_.host match {
case computer: tileentity.Computer => computer.computer.removeComponent(this)
case computer: component.Computer => computer.removeComponent(this)
case _ =>
})