missed some

This commit is contained in:
Florian Nücke 2014-02-07 14:47:47 +01:00
parent 9ad9f3571c
commit 3badd67d4c
5 changed files with 19 additions and 20 deletions

View File

@ -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 case Some(((environment, _))) => environment.node
} }

View File

@ -46,7 +46,6 @@ class Capacitor extends Environment with PassiveNode {
} }
def recomputeCapacity(updateSecondGradeNeighbors: Boolean = false) { def recomputeCapacity(updateSecondGradeNeighbors: Boolean = false) {
world.activeChunkSet
node.setLocalBufferSize( node.setLocalBufferSize(
Settings.get.bufferCapacitor + Settings.get.bufferCapacitor +
Settings.get.bufferCapacitorAdjacencyBonus * ForgeDirection.VALID_DIRECTIONS.count(side => { Settings.get.bufferCapacitorAdjacencyBonus * ForgeDirection.VALID_DIRECTIONS.count(side => {

View File

@ -4,7 +4,7 @@ import li.cil.oc.common.inventory
import li.cil.oc.api.network.Node import li.cil.oc.api.network.Node
trait ComponentInventory extends Environment with Inventory with inventory.ComponentInventory { trait ComponentInventory extends Environment with Inventory with inventory.ComponentInventory {
def componentContainer = this override def componentContainer = this
override protected def isComponentSlot(slot: Int) = isServer override protected def isComponentSlot(slot: Int) = isServer

View File

@ -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() val handle = Iterator.continually((Math.random() * Int.MaxValue).toInt + 1).filterNot(handles.contains).next()
openInputStream(path) match { openInputStream(path) match {
case Some(stream) => case Some(stream) =>
@ -33,9 +33,9 @@ trait InputStreamFileSystem extends api.fs.FileSystem {
} }
} else throw new FileNotFoundException() } 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) for (handle <- handles.values)
handle.close() handle.close()
handles.clear() 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") val handlesNbt = nbt.getTagList("input")
(0 until handlesNbt.tagCount).map(handlesNbt.tagAt).map(_.asInstanceOf[NBTTagCompound]).foreach(handleNbt => { (0 until handlesNbt.tagCount).map(handlesNbt.tagAt).map(_.asInstanceOf[NBTTagCompound]).foreach(handleNbt => {
val handle = handleNbt.getInteger("handle") 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() val handlesNbt = new NBTTagList()
for (file <- handles.values) { for (file <- handles.values) {
assert(!file.isClosed) assert(!file.isClosed)
@ -82,28 +82,28 @@ trait InputStreamFileSystem extends api.fs.FileSystem {
var isClosed = false var isClosed = false
var position = 0L 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 isClosed = true
owner.handles -= handle owner.handles -= handle
stream.close() stream.close()
} }
def read(into: Array[Byte]) = { override def read(into: Array[Byte]) = {
val read = stream.read(into) val read = stream.read(into)
if (read >= 0) if (read >= 0)
position += read position += read
read read
} }
def seek(to: Long) = { override def seek(to: Long) = {
stream.reset() stream.reset()
position = stream.skip(to) position = stream.skip(to)
position position
} }
def write(value: Array[Byte]) = throw new IOException("bad file descriptor") override def write(value: Array[Byte]) = throw new IOException("bad file descriptor")
} }
} }

View File

@ -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) = 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) (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 // surplus strength left after crossing the distance between the two. If
// we reach a point where the surplus strength does not suffice we block // we reach a point where the surplus strength does not suffice we block
// the message. // the message.
val world = card.owner.worldObj val world = card.owner.getWorldObj
val pool = world.getWorldVec3Pool val pool = world.getWorldVec3Pool
val origin = pool.getVecFromPool(reference.owner.xCoord, reference.owner.yCoord, reference.owner.zCoord) val origin = pool.getVecFromPool(reference.owner.xCoord, reference.owner.yCoord, reference.owner.zCoord)