From 8c948098d84c007869ea7ffc3d60949ff41d6675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sun, 8 Dec 2013 15:09:10 +0100 Subject: [PATCH] fixed dynamic component adding/removal when dynamically changing visibility of components --- li/cil/oc/common/tileentity/Screen.scala | 6 +++--- li/cil/oc/server/network/Component.scala | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/li/cil/oc/common/tileentity/Screen.scala b/li/cil/oc/common/tileentity/Screen.scala index 6f923fd34..3b60750ea 100644 --- a/li/cil/oc/common/tileentity/Screen.scala +++ b/li/cil/oc/common/tileentity/Screen.scala @@ -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, ' ') } ) } diff --git a/li/cil/oc/server/network/Component.scala b/li/cil/oc/server/network/Component.scala index 726c541ae..a94768eac 100644 --- a/li/cil/oc/server/network/Component.scala +++ b/li/cil/oc/server/network/Component.scala @@ -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 _ => })