Class ComputerComponent<T>

java.lang.Object
dan200.computercraft.api.component.ComputerComponent<T>
Type Parameters:
T - The type of this component.

public final class ComputerComponent<T> extends Object
A component attached to a computer.

Components provide a mechanism to attach additional data to a computer, that can then be queried with IComputerSystem.getComponent(ComputerComponent).

This is largely designed for custom APIs, allowing APIs to read additional properties of the computer, such as its position.

See Also:
  • Method Details

    • create

      public static <T> ComputerComponent<T> create(String namespace, String id)
      Create a new computer component.

      Mods typically will not need to create their own components.

      Type Parameters:
      T - The component
      Parameters:
      namespace - The namespace of this component. This should be the mod id.
      id - The unique id of this component.
      Returns:
      The newly created component.
    • toString

      public String toString()
      Overrides:
      toString in class Object