making slots in server racks default to different sides; ensuring virtual keyboards of servers are only visible locally

This commit is contained in:
Florian Nücke 2014-02-06 01:13:05 +01:00
parent 3ff43ce1f5
commit af1e76ca8c
2 changed files with 4 additions and 2 deletions

View File

@ -2,8 +2,8 @@ package li.cil.oc.common.component
import cpw.mods.fml.relauncher.{Side, SideOnly}
import li.cil.oc.api.network.{Node, Visibility}
import li.cil.oc.common.tileentity
import li.cil.oc.common.item
import li.cil.oc.common.tileentity
import li.cil.oc.server.component
import li.cil.oc.server.{PacketSender => ServerPacketSender}
import li.cil.oc.util.ExtendedNBT._
@ -17,6 +17,8 @@ class Terminal(val rack: tileentity.Rack, val number: Int) extends Buffer.Owner
val keyboard = if (buffer.node != null) {
buffer.node.setVisibility(Visibility.Neighbors)
new component.Keyboard {
node.setVisibility(Visibility.Neighbors)
override def isUseableByPlayer(p: EntityPlayer) = {
val stack = p.getCurrentEquippedItem
Items.multi.subItem(stack) match {

View File

@ -19,7 +19,7 @@ import stargatetech2.api.bus.IBusDevice
class Rack extends Hub with PowerBalancer with Inventory with Rotatable with BundledRedstoneAware with AbstractBusAware with IBusDevice with Analyzable {
val servers = Array.fill(getSizeInventory)(None: Option[component.Server])
val sides = Array.fill(servers.length)(ForgeDirection.UNKNOWN)
val sides = Array(ForgeDirection.UP, ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.DOWN)
val terminals = (0 until servers.length).map(new common.component.Terminal(this, _)).toArray