From 3badd67d4c097cac2201c42b3b96546eb57876a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Fri, 7 Feb 2014 14:47:47 +0100 Subject: [PATCH] missed some --- .../li/cil/oc/common/tileentity/Adapter.scala | 2 +- .../cil/oc/common/tileentity/Capacitor.scala | 1 - .../tileentity/ComponentInventory.scala | 2 +- .../oc/server/fs/InputStreamFileSystem.scala | 30 +++++++++---------- .../java/li/cil/oc/util/WirelessNetwork.scala | 4 +-- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/main/java/li/cil/oc/common/tileentity/Adapter.scala b/src/main/java/li/cil/oc/common/tileentity/Adapter.scala index ee5a1c598..51c54bd12 100644 --- a/src/main/java/li/cil/oc/common/tileentity/Adapter.scala +++ b/src/main/java/li/cil/oc/common/tileentity/Adapter.scala @@ -17,7 +17,7 @@ class Adapter extends Environment with Analyzable { // ----------------------------------------------------------------------- // - def onAnalyze(player: EntityPlayer, side: Int, hitX: Float, hitY: Float, hitZ: Float) = blocks collect { + override def onAnalyze(player: EntityPlayer, side: Int, hitX: Float, hitY: Float, hitZ: Float) = blocks collect { case Some(((environment, _))) => environment.node } diff --git a/src/main/java/li/cil/oc/common/tileentity/Capacitor.scala b/src/main/java/li/cil/oc/common/tileentity/Capacitor.scala index 949e99160..f98227c77 100644 --- a/src/main/java/li/cil/oc/common/tileentity/Capacitor.scala +++ b/src/main/java/li/cil/oc/common/tileentity/Capacitor.scala @@ -46,7 +46,6 @@ class Capacitor extends Environment with PassiveNode { } def recomputeCapacity(updateSecondGradeNeighbors: Boolean = false) { - world.activeChunkSet node.setLocalBufferSize( Settings.get.bufferCapacitor + Settings.get.bufferCapacitorAdjacencyBonus * ForgeDirection.VALID_DIRECTIONS.count(side => { diff --git a/src/main/java/li/cil/oc/common/tileentity/ComponentInventory.scala b/src/main/java/li/cil/oc/common/tileentity/ComponentInventory.scala index 5b06ebf15..59623ade4 100644 --- a/src/main/java/li/cil/oc/common/tileentity/ComponentInventory.scala +++ b/src/main/java/li/cil/oc/common/tileentity/ComponentInventory.scala @@ -4,7 +4,7 @@ import li.cil.oc.common.inventory import li.cil.oc.api.network.Node trait ComponentInventory extends Environment with Inventory with inventory.ComponentInventory { - def componentContainer = this + override def componentContainer = this override protected def isComponentSlot(slot: Int) = isServer diff --git a/src/main/java/li/cil/oc/server/fs/InputStreamFileSystem.scala b/src/main/java/li/cil/oc/server/fs/InputStreamFileSystem.scala index 5ffa75ff7..af60c0758 100644 --- a/src/main/java/li/cil/oc/server/fs/InputStreamFileSystem.scala +++ b/src/main/java/li/cil/oc/server/fs/InputStreamFileSystem.scala @@ -11,19 +11,19 @@ trait InputStreamFileSystem extends api.fs.FileSystem { // ----------------------------------------------------------------------- // - def isReadOnly = true + override def isReadOnly = true - def delete(path: String) = false + override def delete(path: String) = false - def makeDirectory(path: String) = false + override def makeDirectory(path: String) = false - def rename(from: String, to: String) = false + override def rename(from: String, to: String) = false - def setLastModified(path: String, time: Long) = false + override def setLastModified(path: String, time: Long) = false // ----------------------------------------------------------------------- // - def open(path: String, mode: Mode) = if (mode == Mode.Read && exists(path) && !isDirectory(path)) { + override def open(path: String, mode: Mode) = if (mode == Mode.Read && exists(path) && !isDirectory(path)) { val handle = Iterator.continually((Math.random() * Int.MaxValue).toInt + 1).filterNot(handles.contains).next() openInputStream(path) match { case Some(stream) => @@ -33,9 +33,9 @@ trait InputStreamFileSystem extends api.fs.FileSystem { } } else throw new FileNotFoundException() - def getHandle(handle: Int): api.fs.Handle = handles.get(handle).orNull + override def getHandle(handle: Int): api.fs.Handle = handles.get(handle).orNull - def close() { + override def close() { for (handle <- handles.values) handle.close() handles.clear() @@ -43,7 +43,7 @@ trait InputStreamFileSystem extends api.fs.FileSystem { // ----------------------------------------------------------------------- // - def load(nbt: NBTTagCompound) { + override def load(nbt: NBTTagCompound) { val handlesNbt = nbt.getTagList("input") (0 until handlesNbt.tagCount).map(handlesNbt.tagAt).map(_.asInstanceOf[NBTTagCompound]).foreach(handleNbt => { val handle = handleNbt.getInteger("handle") @@ -59,7 +59,7 @@ trait InputStreamFileSystem extends api.fs.FileSystem { }) } - def save(nbt: NBTTagCompound) { + override def save(nbt: NBTTagCompound) { val handlesNbt = new NBTTagList() for (file <- handles.values) { assert(!file.isClosed) @@ -82,28 +82,28 @@ trait InputStreamFileSystem extends api.fs.FileSystem { var isClosed = false var position = 0L - def length = owner.size(path) + override def length = owner.size(path) - def close() = if (!isClosed) { + override def close() = if (!isClosed) { isClosed = true owner.handles -= handle stream.close() } - def read(into: Array[Byte]) = { + override def read(into: Array[Byte]) = { val read = stream.read(into) if (read >= 0) position += read read } - def seek(to: Long) = { + override def seek(to: Long) = { stream.reset() position = stream.skip(to) position } - def write(value: Array[Byte]) = throw new IOException("bad file descriptor") + override def write(value: Array[Byte]) = throw new IOException("bad file descriptor") } } diff --git a/src/main/java/li/cil/oc/util/WirelessNetwork.scala b/src/main/java/li/cil/oc/util/WirelessNetwork.scala index 2b7be165e..68b0d02de 100644 --- a/src/main/java/li/cil/oc/util/WirelessNetwork.scala +++ b/src/main/java/li/cil/oc/util/WirelessNetwork.scala @@ -70,7 +70,7 @@ object WirelessNetwork { } } - private def dimension(card: WirelessNetworkCard) = card.owner.worldObj.provider.dimensionId + private def dimension(card: WirelessNetworkCard) = card.owner.getWorldObj.provider.dimensionId private def offset(card: WirelessNetworkCard, value: Double) = (card.owner.xCoord + 0.5 + value, card.owner.yCoord + 0.5 + value, card.owner.zCoord + 0.5 + value) @@ -92,7 +92,7 @@ object WirelessNetwork { // surplus strength left after crossing the distance between the two. If // we reach a point where the surplus strength does not suffice we block // the message. - val world = card.owner.worldObj + val world = card.owner.getWorldObj val pool = world.getWorldVec3Pool val origin = pool.getVecFromPool(reference.owner.xCoord, reference.owner.yCoord, reference.owner.zCoord)