Fixed the tablet test item and enabled for now to allow people testing it (can't be crafted though, it's for testing only).

This commit is contained in:
Florian Nücke 2014-07-21 15:25:21 +02:00
parent 2f46c07ed5
commit 0821aaba86
3 changed files with 18 additions and 3 deletions

View File

@ -75,6 +75,7 @@ oc:item.RedstoneCard1.name=Redstone Card (Tier 2)
oc:item.Server0.name=Server (Tier 1)
oc:item.Server1.name=Server (Tier 2)
oc:item.Server2.name=Server (Tier 3)
oc:item.Tablet.name=Tablet
oc:item.Terminal.name=Remote Terminal
oc:item.Transistor.name=Transistor
oc:item.UpgradeAngel.name=Angel Upgrade
@ -228,6 +229,7 @@ oc:tooltip.Server=This is a server, there are many like it, but this one can be
oc:tooltip.Server.Components=Installed components:
oc:tooltip.ServerRack=Allows the installation of up to four servers. Use a Remote Terminal to access the servers built into this server rack.
oc:tooltip.Switch=Allows connecting different networks to each other. Only network messages will be passed along, components will not be visible through this. Use this to separate networks while still allowing communication using Network Cards, for example.
oc:tooltip.Tablet=EXPERIMENTAL - FOR TESTING ONLY [nl] This it a test for item-based computers. It cannot be crafted. Report bugs with it if you test it!
oc:tooltip.Terminal=Allows controlling a server remotely, as long as you are in range of it. Acts like a portable screen and keyboard. Shift-right-click a server in a server rack to bind the terminal to it.
oc:tooltip.TooLong=Hold [§f%s§7] for a detailed tooltip.
oc:tooltip.Transistor=A basic element in most other computer parts. It's a bit twisted, but it does the job.

View File

@ -232,10 +232,10 @@ object Items extends ItemAPI {
Recipes.addItem(new item.UpgradeBattery(multi, Tier.Three), "batteryUpgrade3", "oc:batteryUpgrade3")
Recipes.addItem(new item.RedstoneCard(multi, Tier.One), "redstoneCard1", "oc:redstoneCard1")
// ???
// 1.3.2
Recipes.addItem(new item.UpgradeTractorBeam(multi), "tractorBeamUpgrade", "oc:tractorBeamUpgrade")
// Experimental
// registerItem(new item.Tablet(multi), "tablet")
registerItem(new item.Tablet(multi), "tablet")
}
}

View File

@ -109,6 +109,19 @@ class TabletWrapper(val stack: ItemStack, var holder: Entity) extends ComponentI
}
}
override protected def connectItemNode(node: Node) {
super.connectItemNode(node)
if (node != null) node.host match {
case buffer: api.component.TextBuffer => components collect {
case Some(keyboard: api.component.Keyboard) => buffer.node.connect(keyboard.node)
}
case keyboard: api.component.Keyboard => components collect {
case Some(buffer: api.component.TextBuffer) => keyboard.node.connect(buffer.node)
}
case _ =>
}
}
override def onDisconnect(node: Node) {
if (node == this.node) {
disconnectComponents()
@ -171,7 +184,7 @@ class TabletWrapper(val stack: ItemStack, var holder: Entity) extends ComponentI
// ----------------------------------------------------------------------- //
override def node = computer.node
override def node = Option(computer).fold(null: Node)(_.node)
override def canInteract(player: String) = computer.canInteract(player)