Interface IComputerSystem

All Superinterfaces:
IComputerAccess

@NonExtendable public interface IComputerSystem extends IComputerAccess
An interface passed to ILuaAPIFactory in order to provide additional information about a computer.
  • 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

      <T> @Nullable T getComponent(ComputerComponent<T> component)
      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.