mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
fixed dynamic component adding/removal when dynamically changing visibility of components
This commit is contained in:
parent
1b15f89498
commit
8c948098d8
@ -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, ' ')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@ -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 _ =>
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user