Package dan200.computercraft.api.lua
Interface IComputerSystem
- All Superinterfaces:
IComputerAccess
An interface passed to
ILuaAPIFactory
in order to provide additional information
about a computer.-
Method Summary
Modifier and TypeMethodDescription<T> @Nullable T
getComponent
(ComputerComponent<T> component) Get a component attached to this computer.@Nullable String
getLabel()
Get the label for this computer.net.minecraft.server.level.ServerLevel
getLevel()
Get the level this computer is currently in.net.minecraft.core.BlockPos
Get the position this computer is currently at.Methods inherited from interface dan200.computercraft.api.peripheral.IComputerAccess
getAttachmentName, getAvailablePeripheral, getAvailablePeripherals, getID, getMainThreadMonitor, mount, mount, mountWritable, mountWritable, queueEvent, unmount
-
Method Details
-
getLevel
net.minecraft.server.level.ServerLevel getLevel()Get the level this computer is currently in.This method is not guaranteed to remain the same (even for stationary computers).
- Returns:
- The computer's current level.
-
getPosition
net.minecraft.core.BlockPos getPosition()Get the position this computer is currently at.This method is not guaranteed to remain the same (even for stationary computers).
- Returns:
- The computer's current position.
-
getLabel
@Nullable String getLabel()Get the label for this computer.- Returns:
- This computer's label, or
null
if it is not set.
-
getComponent
Get a component attached to this computer.No component is guaranteed to be on a computer, and so this method should always be guarded with a null check.
This method will always return the same value for a given component, and so may be cached.
- Type Parameters:
T
- The type of the component.- Parameters:
component
- The component to query.- Returns:
- The component, if present.
-