Added device info to MFU.

This commit is contained in:
Vexatos 2017-02-03 22:06:36 +01:00
parent f00b828332
commit 0c64dd30fd
6 changed files with 24 additions and 7 deletions

View File

@ -809,7 +809,7 @@ opencomputers {
nanomachinesReconfigure: 5000 nanomachinesReconfigure: 5000
# Energy consumed by a MFU per tick while connected. # Energy consumed by a MFU per tick while connected.
# Similar to `wirelessCostPerRange`, this is multiplied with the distance to the bound block. # Similarly to `wirelessCostPerRange`, this is multiplied with the distance to the bound block.
mfuRelay: 1 mfuRelay: 1
} }

View File

@ -371,7 +371,7 @@ oc:tooltip.UpgradeGenerator=Can be used to generate energy from fuel on the go.
oc:tooltip.UpgradeHover=This upgrade allows robots to fly higher above the ground without having to climb walls.[nl] Maximum height: §f%s§7 oc:tooltip.UpgradeHover=This upgrade allows robots to fly higher above the ground without having to climb walls.[nl] Maximum height: §f%s§7
oc:tooltip.UpgradeInventory=This upgrade provides inventory space to a robot or drone. Without one of these, they will not be able to store items internally. oc:tooltip.UpgradeInventory=This upgrade provides inventory space to a robot or drone. Without one of these, they will not be able to store items internally.
oc:tooltip.UpgradeInventoryController=This upgrade allows robots and drones more control in how it interacts with external inventories, and allows robots to swap their equipped tool with an item in their inventory. oc:tooltip.UpgradeInventoryController=This upgrade allows robots and drones more control in how it interacts with external inventories, and allows robots to swap their equipped tool with an item in their inventory.
oc:tooltip.UpgradeMF=TODO really, do this oc:tooltip.UpgradeMF=You will never know what the acronym stands for. TODO add proper description
oc:tooltip.UpgradeMF.Linked=§fConnection established§7 oc:tooltip.UpgradeMF.Linked=§fConnection established§7
oc:tooltip.UpgradeMF.Unlinked=§fNo connection§7 oc:tooltip.UpgradeMF.Unlinked=§fNo connection§7
oc:tooltip.UpgradeLeash=Allows some devices, such as drones, to bind Isaa- excuse me... *chatter* My apologies. I'm just being told this is actually used to put animals on a leash. Multiple animals, even. Odd. oc:tooltip.UpgradeLeash=Allows some devices, such as drones, to bind Isaa- excuse me... *chatter* My apologies. I'm just being told this is actually used to put animals on a leash. Multiple animals, even. Odd.

View File

@ -175,6 +175,7 @@ object Constants {
object DeviceInfo { object DeviceInfo {
final val DefaultVendor = "MightyPirates GmbH & Co. KG" final val DefaultVendor = "MightyPirates GmbH & Co. KG"
final val Scummtech = "Scummtech, Inc."
} }

View File

@ -11,7 +11,6 @@ import net.minecraftforge.event.world.WorldEvent
import scala.collection.mutable import scala.collection.mutable
/** /**
*
* @author Vexatos * @author Vexatos
*/ */
object BlockChangeHandler { object BlockChangeHandler {

View File

@ -12,7 +12,6 @@ import net.minecraftforge.common.DimensionManager
import net.minecraftforge.common.util.ForgeDirection import net.minecraftforge.common.util.ForgeDirection
/** /**
*
* @author Vexatos * @author Vexatos
*/ */
object DriverUpgradeMF extends Item with HostAware { object DriverUpgradeMF extends Item with HostAware {

View File

@ -1,5 +1,11 @@
package li.cil.oc.server.component package li.cil.oc.server.component
import java.util
import li.cil.oc.Constants
import li.cil.oc.api.driver.DeviceInfo
import li.cil.oc.api.driver.DeviceInfo.DeviceAttribute
import li.cil.oc.api.driver.DeviceInfo.DeviceClass
import li.cil.oc.api.network._ import li.cil.oc.api.network._
import li.cil.oc.api.prefab import li.cil.oc.api.prefab
import li.cil.oc.common.event.BlockChangeHandler import li.cil.oc.common.event.BlockChangeHandler
@ -7,18 +13,21 @@ import li.cil.oc.common.event.BlockChangeHandler.ChangeListener
import li.cil.oc.server.network import li.cil.oc.server.network
import li.cil.oc.util.BlockPosition import li.cil.oc.util.BlockPosition
import li.cil.oc.util.ExtendedWorld._ import li.cil.oc.util.ExtendedWorld._
import li.cil.oc.{Settings, api} import li.cil.oc.Settings
import li.cil.oc.api
import net.minecraft.nbt.NBTTagCompound import net.minecraft.nbt.NBTTagCompound
import net.minecraft.tileentity.TileEntity import net.minecraft.tileentity.TileEntity
import net.minecraft.util.Vec3 import net.minecraft.util.Vec3
import net.minecraftforge.common.util.ForgeDirection import net.minecraftforge.common.util.ForgeDirection
import scala.collection.convert.WrapAsJava._
/** /**
* Mostly stolen from li.cil.oc.common.tileentity.Adapter * Mostly stolen from {@link li.cil.oc.common.tileentity.Adapter}
* *
* @author Sangar, Vexatos * @author Sangar, Vexatos
*/ */
class UpgradeMF(val host: EnvironmentHost, val coord: BlockPosition, val dir: ForgeDirection) extends prefab.ManagedEnvironment with ChangeListener { class UpgradeMF(val host: EnvironmentHost, val coord: BlockPosition, val dir: ForgeDirection) extends prefab.ManagedEnvironment with ChangeListener with DeviceInfo {
override val node = api.Network.newNode(this, Visibility.None). override val node = api.Network.newNode(this, Visibility.None).
withConnector(). withConnector().
create() create()
@ -29,6 +38,15 @@ class UpgradeMF(val host: EnvironmentHost, val coord: BlockPosition, val dir: Fo
override val canUpdate = true override val canUpdate = true
private final lazy val deviceInfo = Map(
DeviceAttribute.Class -> DeviceClass.Bus,
DeviceAttribute.Description -> "Remote Adapter",
DeviceAttribute.Vendor -> Constants.DeviceInfo.Scummtech,
DeviceAttribute.Product -> "ERR NAME NOT FOUND"
)
override def getDeviceInfo: util.Map[String, String] = deviceInfo
private def otherNode(tile: TileEntity, f: (Node) => Unit) { private def otherNode(tile: TileEntity, f: (Node) => Unit) {
network.Network.getNetworkNode(tile, dir) match { network.Network.getNetworkNode(tile, dir) match {
case Some(otherNode) => f(otherNode) case Some(otherNode) => f(otherNode)