Class FactoryControllerPeripheral
java.lang.Object
io.github.nbcss.createfactorycontroller.content.compat.computercraft.FactoryControllerPeripheral
- All Implemented Interfaces:
dan200.computercraft.api.peripheral.IPeripheral
public class FactoryControllerPeripheral
extends Object
implements dan200.computercraft.api.peripheral.IPeripheral
Allow computers from CC: Tweaked to access information from a factory controller.
The factory controller acts as a peripheral.
Lua usage:
local fc = peripheral.find("factory_controller")
fc.getInfo()
The controller's state is read-only.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(@Nullable dan200.computercraft.api.peripheral.IPeripheral other) Get summaries for all components placed in the factory controller.Get information about all gauges placed in the factory controller.getInfo()Get general information about the factory controller.Get information about all logical tubes attached to the factory controller.Get missing links in the factory controller's known networks.Get the UUIDs of all networks known to the factory controller.final intgetPromiseCountForAddress(String network, String address) Get the number of active promises targeting a packager address on a network.final intgetPromiseCountForGauge(String network, String gaugeId) Get the number of active promises associated with one gauge on a network.@NonNull StringgetType()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dan200.computercraft.api.peripheral.IPeripheral
attach, detach, getAdditionalTypes
-
Method Details
-
getType
- Specified by:
getTypein interfacedan200.computercraft.api.peripheral.IPeripheral
-
getTarget
- Specified by:
getTargetin interfacedan200.computercraft.api.peripheral.IPeripheral
-
equals
public boolean equals(@Nullable @Nullable dan200.computercraft.api.peripheral.IPeripheral other) - Specified by:
equalsin interfacedan200.computercraft.api.peripheral.IPeripheral
-
getInfo
Get general information about the factory controller.- Returns:
-
{ pos: { x: int y: int z: int } name: string -- Custom name of the controller, if any redstonePowered: boolean -- Whether the controller is powered by redstone componentCount: int -- The number of components in the factory controller }
-
getNetworks
Get the UUIDs of all networks known to the factory controller.- Returns:
-
string[] -- Network UUIDs
-
getComponents
Get summaries for all components placed in the factory controller.- Returns:
-
{ pos: string -- Component position as "x,y" type: string -- Component type ID }[]
-
getGauges
Get information about all gauges placed in the factory controller.- Returns:
-
{ pos: string -- Component position as "x,y" type: string -- Component type ID item: string -- Item ID, or an empty string when no item is set count: int -- Requested item count unit: string -- Gauge unit requestMode: string -- Gauge request mode workMode: string -- Gauge work mode stock: int -- Current stock level promised: int -- Current promised item count satisfied: boolean -- Whether the gauge is satisfied waitingForNetwork: boolean -- Whether the gauge is waiting for a network redstonePowered: boolean -- Whether the gauge is powered by redstone address: string -- Recipe address, if any network: string -- Network UUID, if any gaugeId: string -- Gauge UUID, if any }[]
-
getLogicTubes
Get information about all logical tubes attached to the factory controller.- Returns:
-
{ pos: string -- Component position as "x,y" type: string -- Component type ID mode: string -- Logical tube mode powered: boolean -- Whether the logical tube is powered }[]
-
getMissingLinks
Get missing links in the factory controller's known networks.- Returns:
-
{ network: string -- Network UUID links: string[] -- Missing link positions as "dimension@x,y,z" }[]
-
getPromiseCountForGauge
@LuaFunction(mainThread=true) public final int getPromiseCountForGauge(String network, String gaugeId) Get the number of active promises associated with one gauge on a network.- Parameters:
network- Network UUID fromgetNetworks()gaugeId- Gauge UUID fromgetGauges()- Returns:
-
int -- Active promise count
-
getPromiseCountForAddress
@LuaFunction(mainThread=true) public final int getPromiseCountForAddress(String network, String address) Get the number of active promises targeting a packager address on a network.- Parameters:
network- Network UUID fromgetNetworks()address- Packager address- Returns:
-
int -- Active promise count
-