public final class ComputerCraftAPI
extends java.lang.Object
Constructor and Description |
---|
ComputerCraftAPI() |
Modifier and Type | Method and Description |
---|---|
static IMount |
createResourceMount(java.lang.Class modClass,
java.lang.String domain,
java.lang.String subPath)
Creates a file system mount to a resource folder, and returns it.
Use in conjuction with IComputerAccess.mount() or IComputerAccess.mountWritable() to mount a resource folder onto a computers file system. The files in this mount will be a combination of files in the specified mod jar, and resource packs that contain resources with the same domain and path. |
static IWritableMount |
createSaveDirMount(World world,
java.lang.String subPath,
long capacity)
Creates a file system mount that maps to a subfolder of the save directory for a given world, and returns it.
Use in conjuction with IComputerAccess.mount() or IComputerAccess.mountWritable() to mount a folder from the users save directory onto a computers file system. |
static int |
createUniqueNumberedSaveDir(World world,
java.lang.String parentSubPath)
Creates a numbered directory in a subfolder of the save directory for a given world, and returns that number.
Use in conjuction with createSaveDirMount() to create a unique place for your peripherals or media items to store files. |
static java.lang.String |
getAPIVersion() |
static int |
getBundledRedstoneOutput(World world,
BlockPos pos,
EnumFacing side)
If there is a Computer or Turtle at a certain position in the world, get it's bundled redstone output.
|
static java.lang.String |
getInstalledVersion() |
static boolean |
isInstalled() |
static void |
registerBundledRedstoneProvider(IBundledRedstoneProvider handler)
Registers a bundled redstone handler to provide bundled redstone output for blocks
|
static void |
registerMediaProvider(IMediaProvider handler)
Registers a media handler to provide IMedia implementations for Items
|
static void |
registerPeripheralProvider(IPeripheralProvider handler)
Registers a peripheral handler to convert blocks into IPeripheral implementations.
|
static void |
registerPermissionProvider(ITurtlePermissionProvider handler)
Registers a permission handler to restrict where turtles can move or build
|
static void |
registerTurtleUpgrade(ITurtleUpgrade upgrade)
Registers a new turtle turtle for use in ComputerCraft.
|
public static boolean isInstalled()
public static java.lang.String getInstalledVersion()
public static java.lang.String getAPIVersion()
public static int createUniqueNumberedSaveDir(World world, java.lang.String parentSubPath)
world
- The world for which the save dir should be created. This should be the serverside world object.parentSubPath
- The folder path within the save directory where the new directory should be created. eg: "computercraft/disk"createSaveDirMount(World, String, long)
public static IWritableMount createSaveDirMount(World world, java.lang.String subPath, long capacity)
world
- The world for which the save dir can be found. This should be the serverside world object.subPath
- The folder path within the save directory that the mount should map to. eg: "computer/disk/42".capacity
- The ammount of data that can be stored in the directory before it fills up, in bytes.createUniqueNumberedSaveDir(World, String)
,
IComputerAccess.mount(String, dan200.computercraft.api.filesystem.IMount)
,
IComputerAccess.mountWritable(String, dan200.computercraft.api.filesystem.IWritableMount)
,
IMount
,
IWritableMount
public static IMount createResourceMount(java.lang.Class modClass, java.lang.String domain, java.lang.String subPath)
modClass
- A class in whose jar to look first for the resources to mount. Using your main mod class is recommended. eg: MyMod.classdomain
- The domain under which to look for resources. eg: "mymod"subPath
- The domain under which to look for resources. eg: "mymod/lua/myfiles"IComputerAccess.mount(String, dan200.computercraft.api.filesystem.IMount)
,
IComputerAccess.mountWritable(String, IWritableMount)
,
IMount
public static void registerPeripheralProvider(IPeripheralProvider handler)
IPeripheral
,
IPeripheralProvider
public static void registerTurtleUpgrade(ITurtleUpgrade upgrade)
ITurtleUpgrade
public static void registerBundledRedstoneProvider(IBundledRedstoneProvider handler)
IBundledRedstoneProvider
public static int getBundledRedstoneOutput(World world, BlockPos pos, EnumFacing side)
IBundledRedstoneProvider
public static void registerMediaProvider(IMediaProvider handler)
IMediaProvider
public static void registerPermissionProvider(ITurtlePermissionProvider handler)
ITurtlePermissionProvider