Skip navigation links

Package li.cil.oc.api

This API provides interfaces and factory methods for the OpenComputers mod.

See: Description

Package li.cil.oc.api Description

This API provides interfaces and factory methods for the OpenComputers mod.

There are several parts to this API:

The Driver API
This API is used to provide glue code to the mod that allows it to interact with foreign objects. You need a driver if you wish to connect some object to the internal Network, for example because you wish to interact with other blocks / components of the mod. The most typical scenario for this will be adding a new object that user programs should be able to interact with: a Component.

Note that for tile entities you implement yourself, you will not have to provide a driver, as long as you implement the necessary interface: Environment and call Network.joinOrCreateNetwork(net.minecraft.tileentity.TileEntity) in the first updateEntity() call. For items that should be installed in a computer you will always have to provide a driver.

The FileSystem API
This API provides facilities that make it easier to create file systems that can be interacted with from user programs via the file system driver that comes with the mod.
The Network API
This API provides interfaces that allow interacting with the internal network and creating nodes, components and power connectors for said network. If you implement Environment in your tile entity or provide a ManagedEnvironment via a driver you'll want to create a node. This API provides factory methods for creating it.
Skip navigation links