|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdan200.computer.api.ComputerCraftAPI
public class ComputerCraftAPI
The static entry point to the ComputerCraft API. Members in this class must be called after mod_ComputerCraft has been initialised, but may be called before it is fully loaded.
Constructor Summary | |
---|---|
ComputerCraftAPI()
|
Method Summary | |
---|---|
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 void |
registerExternalPeripheral(java.lang.Class<? extends net.minecraft.tileentity.TileEntity> clazz,
IPeripheralHandler handler)
Registers a peripheral handler for a TileEntity that you do not have access to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComputerCraftAPI()
Method Detail |
---|
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: "computer/disk"
#createSaveDirMount(World, String)
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, IMount)
,
IComputerAccess.mountWritable(String, IWritableMount)
,
IMount
,
IMountWritable
public static IMount createResourceMount(java.lang.Class modClass, java.lang.String domain, java.lang.String subPath)
class
- 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, IMount)
,
IComputerAccess#mountWritable(String, IMountWritable)
,
IMount
public static void registerExternalPeripheral(java.lang.Class<? extends net.minecraft.tileentity.TileEntity> clazz, IPeripheralHandler handler)
IPeripheral
,
IPeripheralHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |