- * Don't use this class directly, prefer using the other classes in this
- * package instead. This class is initialized by OpenComputers in the
- * pre-init phase, so it should not be used before the init phase.
- */
-public class API {
- public static final String ID_OWNER = "OpenComputers|Core";
- public static final String VERSION = "6.0.0-alpha";
-
- // ----------------------------------------------------------------------- //
-
- /**
- * The loaded config.
- */
- public static Config config = null;
-
- /**
- * Whether OpenComputers uses power.
- *
- * This is set in the init phase, so do not rely it before the post-init phase.
- */
- public static boolean isPowerEnabled = false;
-
- // ----------------------------------------------------------------------- //
- // Prefer using the static methods in the respective classes in this package
- // over accessing these instances directly.
-
- public static DriverAPI driver = null;
- public static FileSystemAPI fileSystem = null;
- public static ItemAPI items = null;
- public static MachineAPI machine = null;
- public static ManualAPI manual = null;
- public static NanomachinesAPI nanomachines = null;
- public static NetworkAPI network = null;
-
- // ----------------------------------------------------------------------- //
-
- private API() {
- }
-}
diff --git a/src/api/java/li/cil/oc/api/CreativeTab.java b/src/api/java/li/cil/oc/api/CreativeTab.java
deleted file mode 100755
index 2454256fe..000000000
--- a/src/api/java/li/cil/oc/api/CreativeTab.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package li.cil.oc.api;
-
-import net.minecraft.creativetab.CreativeTabs;
-
-/**
- * Allows access to the creative tab used by OpenComputers.
- */
-public final class CreativeTab {
- /**
- * The creative tab used by OpenComputers.
- *
- * Changed to the actual tab if OC is present. Preferably you do
- * not try to access this anyway when OpenComputers isn't
- * present (don't ship the API in your mod), so don't rely on this!
- */
- public static CreativeTabs instance = CreativeTabs.REDSTONE;
-
- private CreativeTab() {
- }
-}
diff --git a/src/api/java/li/cil/oc/api/Driver.java b/src/api/java/li/cil/oc/api/Driver.java
deleted file mode 100755
index a89570253..000000000
--- a/src/api/java/li/cil/oc/api/Driver.java
+++ /dev/null
@@ -1,282 +0,0 @@
-package li.cil.oc.api;
-
-import li.cil.oc.api.driver.Block;
-import li.cil.oc.api.driver.Converter;
-import li.cil.oc.api.driver.EnvironmentProvider;
-import li.cil.oc.api.driver.InventoryProvider;
-import li.cil.oc.api.driver.Item;
-import li.cil.oc.api.driver.SidedBlock;
-import li.cil.oc.api.network.EnvironmentHost;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.world.World;
-
-import java.util.Collection;
-
-/**
- * This API allows registering new drivers with the mod.
- *
- * Drivers are used to make items and third-party blocks available in the mod's
- * component network, and optionally to user programs. If you implement a new
- * block that should interact with the mod's component network it is enough to
- * have it implement {@link li.cil.oc.api.network.Environment} - no driver is
- * needed in that case.
- *
- * Note that these methods should not be called in the pre-init phase,
- * since the {@link li.cil.oc.api.API#driver} may not have been initialized
- * at that time. Only start calling these methods in the init phase or later.
- *
- * @see Network
- * @see SidedBlock
- * @see Item
- */
-public final class Driver {
- /**
- * Registers a new block driver.
- *
- * Whenever the neighboring blocks of an Adapter block change, it checks if
- * there exists a driver for the changed block, and if it is configured to
- * interface that block type connects it to the component network.
- *
- * This must be called in the init phase, not the pre- or post-init
- * phases.
- *
- * @param driver the driver to register.
- * @deprecated Use {@link SidedBlock} instead.
- */
- @Deprecated // TODO Remove in OC 1.7
- public static void add(final Block driver) {
- if (API.driver != null)
- API.driver.add(driver);
- }
-
- /**
- * Registers a new side-aware block driver.
- *
- * Whenever the neighboring blocks of an Adapter block change, it checks if
- * there exists a driver for the changed block, and if it is configured to
- * interface that block type connects it to the component network.
- *
- * This must be called in the init phase, not the pre- or post-init
- * phases.
- *
- * @param driver the driver to register.
- */
- public static void add(final SidedBlock driver) {
- if (API.driver != null)
- API.driver.add(driver);
- }
-
- /**
- * Registers a new item driver.
- *
- * Item components can inserted into a computers component slots. They have
- * to specify their type, to determine into which slots they can fit.
- *
- * This must be called in the init phase, not the pre- or post-init
- * phases.
- *
- * @param driver the driver to register.
- */
- public static void add(final Item driver) {
- if (API.driver != null)
- API.driver.add(driver);
- }
-
- /**
- * Registers a new type converter.
- *
- * Type converters are used to automatically convert values returned from
- * callbacks to a "simple" format that can be pushed to any architecture.
- *
- * This must be called in the init phase, not the pre- or post-init
- * phases.
- *
- * @param converter the converter to register.
- */
- public static void add(final Converter converter) {
- if (API.driver != null)
- API.driver.add(converter);
- }
-
- /**
- * Register a new environment provider.
- *
- * Environment providers are used for mapping item stacks to the type of
- * environment that will be created by the stack, either by it being
- * placed in the world and acting as a block component, or by being
- * placed in an component inventory and created by the item's driver.
- *
- * @param provider the provider to register.
- */
- public static void add(final EnvironmentProvider provider) {
- if (API.driver != null)
- API.driver.add(provider);
- }
-
- /**
- * Register a new inventory provider.
- *
- * Inventory providers are used for accessing item inventories using
- * the inventory controller upgrade, for example.
- *
- * @param provider the provider to register.
- */
- public static void add(final InventoryProvider provider) {
- if (API.driver != null)
- API.driver.add(provider);
- }
-
- /**
- * Looks up a driver for the block at the specified position in the
- * specified world.
- *
- * Note that several drivers for a single block can exist. Because of this
- * block drivers are always encapsulated in a 'compound' driver, which is
- * what will be returned here. In other words, you should will not
- * get actual instances of drivers registered via {@link #add(li.cil.oc.api.driver.Block)}.
- *
- * @param world the world containing the block.
- * @param pos the position of the block.
- * @return a driver for the block, or null if there is none.
- * @deprecated Use {@link #driverFor(World, BlockPos, EnumFacing)},
- * passing null if the side is to be ignored.
- */
- @Deprecated // TODO Remove in OC 1.7
- public static Block driverFor(World world, BlockPos pos) {
- if (API.driver != null)
- return API.driver.driverFor(world, pos);
- return null;
- }
-
- /**
- * Looks up a driver for the block at the specified position in the
- * specified world.
- *
- * Note that several drivers for a single block can exist. Because of this
- * block drivers are always encapsulated in a 'compound' driver, which is
- * what will be returned here. In other words, you should will not
- * get actual instances of drivers registered via {@link #add(li.cil.oc.api.driver.Block)}.
- *
- * @param world the world containing the block.
- * @param pos the position of the block.
- * @return a driver for the block, or null if there is none.
- */
- public static SidedBlock driverFor(World world, BlockPos pos, EnumFacing side) {
- if (API.driver != null)
- return API.driver.driverFor(world, pos, side);
- return null;
- }
-
- /**
- * Looks up a driver for the specified item stack.
- *
- * Note that unlike for blocks, there can always only be one item driver
- * per item. If there are multiple ones, the first one that was registered
- * will be used.
- *
- * @param stack the item stack to get a driver for.
- * @param host the type that will host the environment created by returned driver.
- * @return a driver for the item, or null if there is none.
- */
- public static Item driverFor(ItemStack stack, Class extends EnvironmentHost> host) {
- if (API.driver != null)
- return API.driver.driverFor(stack, host);
- return null;
- }
-
- /**
- * Looks up a driver for the specified item stack.
- *
- * Note that unlike for blocks, there can always only be one item driver
- * per item. If there are multiple ones, the first one that was registered
- * will be used.
- *
- * This is a context-agnostic variant used mostly for "house-keeping"
- * stuff, such as querying slot types and tier.
- *
- * @param stack the item stack to get a driver for.
- * @return a driver for the item, or null if there is none.
- */
- public static Item driverFor(ItemStack stack) {
- if (API.driver != null)
- return API.driver.driverFor(stack);
- return null;
- }
-
- /**
- * Looks up the environment associated with the specified item stack.
- *
- * This will use the registered {@link EnvironmentProvider}s to find
- * an environment type for the specified item stack. If none can be
- * found, returns null.
- *
- * @param stack the item stack to get the environment type for.
- * @return the type of environment associated with the stack, or null.
- */
- public static Class> environmentFor(ItemStack stack) {
- if (API.driver != null)
- return API.driver.environmentFor(stack);
- return null;
- }
-
- /**
- * Get an inventory implementation providing access to an item inventory.
- *
- * This will use the registered {@link InventoryProvider}s to find an
- * inventory implementation providing access to the specified stack.
- * If none can be found, returns null.
- *
- * Note that the specified player may be null, but will usually
- * be the fake player of the agent making use of this API.
- *
- * @param stack the item stack to get the inventory access for.
- * @param player the player holding the item. May be null.
- * @return the inventory implementation interfacing the stack, or null.
- */
- public static IInventory inventoryFor(ItemStack stack, EntityPlayer player) {
- if (API.driver != null)
- return API.driver.inventoryFor(stack, player);
- return null;
- }
-
- /**
- * Get a list of all registered block drivers.
- *
- * This is intended to allow checking for particular drivers using more
- * customized logic.
- *
- * The returned collection is read-only.
- *
- * @return the list of all registered block drivers.
- */
- public static Collection blockDrivers() {
- if (API.driver != null)
- return API.driver.blockDrivers();
- return null;
- }
-
- /**
- * Get a list of all registered item drivers.
- *
- * This is intended to allow checking for particular drivers using more
- * customized logic.
- *
- * The returned collection is read-only.
- *
- * @return the list of all registered item drivers.
- */
- public static Collection itemDrivers() {
- if (API.driver != null)
- return API.driver.itemDrivers();
- return null;
- }
-
- // ----------------------------------------------------------------------- //
-
- private Driver() {
- }
-}
\ No newline at end of file
diff --git a/src/api/java/li/cil/oc/api/FileSystem.java b/src/api/java/li/cil/oc/api/FileSystem.java
deleted file mode 100755
index 49557d0cf..000000000
--- a/src/api/java/li/cil/oc/api/FileSystem.java
+++ /dev/null
@@ -1,279 +0,0 @@
-package li.cil.oc.api;
-
-import li.cil.oc.api.network.EnvironmentHost;
-import li.cil.oc.api.fs.Label;
-import li.cil.oc.api.network.ManagedEnvironment;
-
-/**
- * This class provides factory methods for creating file systems that are
- * compatible with the built-in file system driver.
- *
- * File systems created this way and wrapped in a managed environment via
- * {@link #asManagedEnvironment} or its overloads will appear as
- * filesystem components in the component network. Note that the
- * component's visibility is set to Neighbors per default. If you wish
- * to change the file system's visibility (e.g. like the disk drive does) you
- * must cast the environment's node to {@link li.cil.oc.api.network.Component}
- * and set the visibility to the desired value.
- *
- * Note that these methods should not be called in the pre-init phase,
- * since the {@link li.cil.oc.api.API#fileSystem} may not have been initialized
- * at that time. Only start calling these methods in the init phase or later.
- */
-public final class FileSystem {
- /**
- * Creates a new file system based on the location of a class.
- *
- * This can be used to wrap a folder in the assets folder of your mod's JAR.
- * The actual path is built like this:
- *
"/assets/" + domain + "/" + root
- *
- * If the class is located in a JAR file, this will create a read-only file
- * system based on that JAR file. If the class file is located in the native
- * file system, this will create a read-only file system first trying from
- * the actual location of the class file, and failing that by searching the
- * class path (i.e. it'll look for a path constructed as described above).
- *
- * If the specified path cannot be located, the creation fails and this
- * returns null.
- *
- * @param clazz the class whose containing JAR to wrap.
- * @param domain the domain, usually your mod's ID.
- * @param root an optional subdirectory.
- * @return a file system wrapping the specified folder.
- */
- public static li.cil.oc.api.fs.FileSystem fromClass(final Class> clazz, final String domain, final String root) {
- if (API.fileSystem != null)
- return API.fileSystem.fromClass(clazz, domain, root);
- return null;
- }
-
- /**
- * Creates a new writable file system in the save folder.
- *
- * This will create a folder, if necessary, and create a writable virtual
- * file system based in that folder. The actual path is based in a sub-
- * folder of the save folder. The actual path is built like this:
- *
"saves/" + WORLD_NAME + "/opencomputers/" + root
- * The first part may differ, in particular for servers.
- *
- * Usually the name will be the address of the node used to represent the
- * file system.
- *
- * Note that by default file systems are "buffered", meaning that any
- * changes made to them are only saved to disk when the world is saved. This
- * ensured that the file system contents do not go "out of sync" when the
- * game crashes, but introduces additional memory overhead, since all files
- * in the file system have to be kept in memory.
- *
- * @param root the name of the file system.
- * @param capacity the amount of space in bytes to allow being used.
- * @param buffered whether data should only be written to disk when saving.
- * @return a file system wrapping the specified folder.
- */
- public static li.cil.oc.api.fs.FileSystem fromSaveDirectory(final String root, final long capacity, final boolean buffered) {
- if (API.fileSystem != null)
- return API.fileSystem.fromSaveDirectory(root, capacity, buffered);
- return null;
- }
-
- /**
- * Same as {@link #fromSaveDirectory(String, long, boolean)} with the
- * buffered parameter being true, i.e. will always create a
- * buffered file system.
- *
- * @param root the name of the file system.
- * @param capacity the amount of space in bytes to allow being used.
- * @return a file system wrapping the specified folder.
- */
- public static li.cil.oc.api.fs.FileSystem fromSaveDirectory(final String root, final long capacity) {
- return fromSaveDirectory(root, capacity, true);
- }
-
- /**
- * Creates a new writable file system that resides in memory.
- *
- * Any contents created and written on this file system will be lost when
- * the node is removed from the network.
- *
- * This is used for computers' /tmp mount, for example.
- *
- * @param capacity the capacity of the file system.
- * @return a file system residing in memory.
- */
- public static li.cil.oc.api.fs.FileSystem fromMemory(final long capacity) {
- if (API.fileSystem != null)
- return API.fileSystem.fromMemory(capacity);
- return null;
- }
-
- /**
- * Wrap a file system retrieved via one of the from??? methods to
- * make it read-only.
- *
- * @param fileSystem the file system to wrap.
- * @return the specified file system wrapped to be read-only.
- */
- public static li.cil.oc.api.fs.FileSystem asReadOnly(final li.cil.oc.api.fs.FileSystem fileSystem) {
- if (API.fileSystem != null)
- return API.fileSystem.asReadOnly(fileSystem);
- return null;
- }
-
- /**
- * Creates a network node that makes the specified file system available via
- * the common file system driver.
- *
- * This can be useful for providing some data if you don't wish to implement
- * your own driver. Which will probably be most of the time. If you need
- * more control over the node, implement your own, and connect this one to
- * it. In that case you will have to forward any disk driver messages to the
- * node, though.
- *
- * The container parameter is used to give the file system some physical
- * relation to the world, for example this is used by hard drives to send
- * the disk event notifications to the client that are used to play disk
- * access sounds.
- *
- * The container may be null, if no such context can be provided.
- *
- * The access sound is the name of the sound effect to play when the file
- * system is accessed, for example by listing a directory or reading from
- * a file. It may be null to create a silent file system.
- *
- * The speed multiplier controls how fast read and write operations on the
- * file system are. It must be a value in [1,6], and controls the access
- * speed, with the default being one.
- * For reference, floppies are using the default, hard drives scale with
- * their tiers, i.e. a tier one hard drive uses speed two, tier three uses
- * speed four.
- *
- * @param fileSystem the file system to wrap.
- * @param label the label of the file system.
- * @param host the tile entity containing the file system.
- * @param accessSound the name of the sound effect to play when the file
- * system is accessed. This has to be the fully
- * qualified resource name, e.g.
- * opencomputers:floppy_access.
- * @param speed the speed multiplier for this file system.
- * @return the network node wrapping the file system.
- */
- public static ManagedEnvironment asManagedEnvironment(final li.cil.oc.api.fs.FileSystem fileSystem, final Label label, final EnvironmentHost host, final String accessSound, int speed) {
- if (API.fileSystem != null)
- return API.fileSystem.asManagedEnvironment(fileSystem, label, host, accessSound, speed);
- return null;
- }
-
- /**
- * Creates a network node that makes the specified file system available via
- * the common file system driver.
- *
- * Creates a file system with the a read-only label and the specified
- * access sound and file system speed.
- *
- * @param fileSystem the file system to wrap.
- * @param label the label of the file system.
- * @param host the tile entity containing the file system.
- * @param accessSound the name of the sound effect to play when the file
- * system is accessed. This has to be the fully
- * qualified resource name, e.g.
- * opencomputers:floppy_access.
- * @param speed the speed multiplier for this file system.
- * @return the network node wrapping the file system.
- */
- public static ManagedEnvironment asManagedEnvironment(final li.cil.oc.api.fs.FileSystem fileSystem, final String label, final EnvironmentHost host, final String accessSound, int speed) {
- if (API.fileSystem != null)
- return API.fileSystem.asManagedEnvironment(fileSystem, label, host, accessSound, speed);
- return null;
- }
-
- /**
- * Creates a network node that makes the specified file system available via
- * the common file system driver.
- *
- * Creates a file system with the specified label and the specified access
- * sound, using the default file system speed.
- *
- * @param fileSystem the file system to wrap.
- * @param label the label of the file system.
- * @param host the tile entity containing the file system.
- * @param accessSound the name of the sound effect to play when the file
- * system is accessed. This has to be the fully
- * qualified resource name, e.g.
- * opencomputers:floppy_access.
- * @return the network node wrapping the file system.
- */
- public static ManagedEnvironment asManagedEnvironment(final li.cil.oc.api.fs.FileSystem fileSystem, final Label label, final EnvironmentHost host, final String accessSound) {
- return asManagedEnvironment(fileSystem, label, host, accessSound, 1);
- }
-
- /**
- * Creates a network node that makes the specified file system available via
- * the common file system driver.
- *
- * Creates a file system with a read-only label and the specified access
- * sound, using the default file system speed.
- *
- * @param fileSystem the file system to wrap.
- * @param label the read-only label of the file system.
- * @param host the tile entity containing the file system.
- * @param accessSound the name of the sound effect to play when the file
- * system is accessed. This has to be the fully
- * qualified resource name, e.g.
- * opencomputers:floppy_access.
- * @return the network node wrapping the file system.
- */
- public static ManagedEnvironment asManagedEnvironment(final li.cil.oc.api.fs.FileSystem fileSystem, final String label, final EnvironmentHost host, final String accessSound) {
- return asManagedEnvironment(fileSystem, label, host, accessSound, 1);
- }
-
- /**
- * Creates a network node that makes the specified file system available via
- * the common file system driver.
- *
- * Creates a file system with the specified label, without an environment
- * and access sound, using the default file system speed.
- *
- * @param fileSystem the file system to wrap.
- * @param label the label of the file system.
- * @return the network node wrapping the file system.
- */
- public static ManagedEnvironment asManagedEnvironment(final li.cil.oc.api.fs.FileSystem fileSystem, final Label label) {
- return asManagedEnvironment(fileSystem, label, null, null, 1);
- }
-
- /**
- * Creates a network node that makes the specified file system available via
- * the common file system driver.
- *
- * Creates a file system with a read-only label, without an environment and
- * access sound, using the default file system speed.
- *
- * @param fileSystem the file system to wrap.
- * @param label the read-only label of the file system.
- * @return the network node wrapping the file system.
- */
- public static ManagedEnvironment asManagedEnvironment(final li.cil.oc.api.fs.FileSystem fileSystem, final String label) {
- return asManagedEnvironment(fileSystem, label, null, null, 1);
- }
-
- /**
- * Creates a network node that makes the specified file system available via
- * the common file system driver.
- *
- * Creates an unlabeled file system (i.e. the label can neither be read nor
- * written), without an environment and access sound, using the default
- * file system speed.
- *
- * @param fileSystem the file system to wrap.
- * @return the network node wrapping the file system.
- */
- public static ManagedEnvironment asManagedEnvironment(final li.cil.oc.api.fs.FileSystem fileSystem) {
- return asManagedEnvironment(fileSystem, (Label) null, null, null, 1);
- }
-
- // ----------------------------------------------------------------------- //
-
- private FileSystem() {
- }
-}
\ No newline at end of file
diff --git a/src/api/java/li/cil/oc/api/IMC.java b/src/api/java/li/cil/oc/api/IMC.java
deleted file mode 100755
index e1632093b..000000000
--- a/src/api/java/li/cil/oc/api/IMC.java
+++ /dev/null
@@ -1,362 +0,0 @@
-package li.cil.oc.api;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraftforge.fml.common.event.FMLInterModComms;
-import org.apache.commons.lang3.tuple.Pair;
-
-/**
- * This is a pure utility class to more comfortably register things that can
- * only be registered using IMC.
- *
- * Use this if you have some kind of abstraction layer in place anyway, and can
- * safely use the API without class not found exceptions and such, and don't
- * want to put together the IMC messages manually.
- *
- * This also servers to document of all IMC messages OpenComputers handles.
- *
- * Feel free to copy these functions into your own code, just please don't
- * copy this class while keeping the package name, to avoid conflicts if this
- * class gets updated.
- */
-public final class IMC {
- /**
- * Register a callback that is used as a filter for assembler templates.
- * Any templates that require a base item that is rejected by any
- * registered filter will be disabled. For example, if a filter rejects the
- * computer case item stacks, robots can not be assembled.
- *
- * Signature of callbacks must be:
- *
- * boolean callback(ItemStack stack)
- *
- *
- * Callbacks must be declared as packagePath.className.methodName.
- * For example: com.example.Integration.callbackMethod.
- *
- * @param callback the callback to register as a filtering method.
- */
- public static void registerAssemblerFilter(String callback) {
- FMLInterModComms.sendMessage(MOD_ID, "registerAssemblerFilter", callback);
- }
-
- /**
- * Register a new template for the assembler.
- *
- * Signature of callbacks must be:
- *
- * Values in the array returned by validate must be one of the following:
- *
- * // Valid or not.
- * new Object[]{Boolean}
- * // Valid or not, text for progess bar.
- * new Object[]{Boolean, IChatComponent}
- * // Valid or not, text for progess bar, warnings for start button tooltip (one per line).
- * new Object[]{Boolean, IChatComponent, IChatComponent[]}
- *
- * Values in the array returned by assemble must be one of the following:
- *
- * // The assembled device.
- * new Object[]{ItemStack}
- * // The assembled device and energy cost (which also determines assembly duration).
- * new Object[]{ItemStack, Number}
- *
- *
- * Callbacks must be declared as packagePath.className.methodName.
- * For example: com.example.Integration.callbackMethod.
- *
- * @param name the name of the device created using the
- * template. Optional, only used in logging.
- * @param select callback used to determine if the template
- * applies to a base item. For example, the robot
- * template returns true from this if the passed
- * item stack is a computer case.
- * @param validate callback used to determine if the template
- * configuration is valid. Once a template is
- * valid assembly can be started, but not before.
- * @param assemble callback used to apply a template and create a
- * device from it.
- * @param host the class of the device being assembled, i.e.
- * the host class for the components being
- * installed in the device. Used for filtering
- * eligible components. See {@link #blacklistHost}.
- * @param containerTiers the tiers of the container slots provided by the
- * template. The length determines the number of
- * containers. Maximum number is three.
- * @param upgradeTiers the tiers of the upgrade slots provided by the
- * template. The length determines the number of
- * upgrades. Maximum number is nine.
- * @param componentSlots the types and tiers of component slots provided by
- * this template. May contain null entries
- * to skip slots (slots are ordered top-to-bottom,
- * left-to-right). For example, a robot template
- * with only two card slots will pass null
- * for the third component slot. Up to nine.
- */
- public static void registerAssemblerTemplate(String name, String select, String validate, String assemble, Class host, int[] containerTiers, int[] upgradeTiers, Iterable> componentSlots) {
- final NBTTagCompound nbt = new NBTTagCompound();
- if (name != null) {
- nbt.setString("name", name);
- }
- nbt.setString("select", select);
- nbt.setString("validate", validate);
- nbt.setString("assemble", assemble);
- if (host != null) {
- nbt.setString("hostClass", host.getName());
- }
-
- final NBTTagList containersNbt = new NBTTagList();
- if (containerTiers != null) {
- for (int tier : containerTiers) {
- final NBTTagCompound slotNbt = new NBTTagCompound();
- slotNbt.setInteger("tier", tier);
- containersNbt.appendTag(slotNbt);
- }
- }
- if (containersNbt.tagCount() > 0) {
- nbt.setTag("containerSlots", containersNbt);
- }
-
- final NBTTagList upgradesNbt = new NBTTagList();
- if (upgradeTiers != null) {
- for (int tier : upgradeTiers) {
- final NBTTagCompound slotNbt = new NBTTagCompound();
- slotNbt.setInteger("tier", tier);
- upgradesNbt.appendTag(slotNbt);
- }
- }
- if (upgradesNbt.tagCount() > 0) {
- nbt.setTag("upgradeSlots", upgradesNbt);
- }
-
- final NBTTagList componentsNbt = new NBTTagList();
- if (componentSlots != null) {
- for (Pair slot : componentSlots) {
- if (slot == null) {
- componentsNbt.appendTag(new NBTTagCompound());
- } else {
- final NBTTagCompound slotNbt = new NBTTagCompound();
- slotNbt.setString("type", slot.getLeft());
- slotNbt.setInteger("tier", slot.getRight());
- componentsNbt.appendTag(slotNbt);
- }
- }
- }
- if (componentsNbt.tagCount() > 0) {
- nbt.setTag("componentSlots", componentsNbt);
- }
-
- FMLInterModComms.sendMessage(MOD_ID, "registerAssemblerTemplate", nbt);
- }
-
- /**
- * Register a new template for the disassembler.
- *
- * The disassemble callback gets passed the item stack to
- * disassemble, and a list of inferred ingredients (based on crafting
- * recipes). This is useful for not having to compute those yourself when
- * you just want to add a number of items from an internal inventory to
- * the output (e.g. for servers it's the components in the server).
- *
- * Signature of callbacks must be:
- *
- *
- * Callbacks must be declared as packagePath.className.methodName.
- * For example: com.example.Integration.callbackMethod.
- *
- * @param name the name of the handler (e.g. name of the item
- * being handled). Optional, only used in logging.
- * @param select callback used to determine if the template
- * applies to an item.
- * @param disassemble callback used to apply a template and extract
- * ingredients from an item.
- */
- public static void registerDisassemblerTemplate(String name, String select, String disassemble) {
- final NBTTagCompound nbt = new NBTTagCompound();
- if (name != null) {
- nbt.setString("name", name);
- }
- nbt.setString("select", select);
- nbt.setString("disassemble", disassemble);
-
- FMLInterModComms.sendMessage(MOD_ID, "registerDisassemblerTemplate", nbt);
- }
-
- /**
- * Register a callback for providing tool durability information.
- *
- * If your provider does not handle a tool/item, return Double.NaN
- * to indicate that another provider should be queried. The first value
- * that isn't NaN will be used as the durability.
- *
- * The returned value must be the relative durability of the tool,
- * in a range of [0,1], with 0 being broken, 1 being new/fully repaired.
- *
- * Signature of callbacks must be:
- *
- * double callback(ItemStack stack)
- *
- *
- * Callbacks must be declared as packagePath.className.methodName.
- * For example: com.example.Integration.callbackMethod.
- *
- * @param callback the callback to register as a durability provider.
- */
- public static void registerToolDurabilityProvider(String callback) {
- FMLInterModComms.sendMessage(MOD_ID, "registerToolDurabilityProvider", callback);
- }
-
- /**
- * Register a callback handling a wrench tool.
- *
- * These are used when determining whether an item is a wrench tool, when
- * interacting with certain blocks while the player is holding such an item,
- * for example to avoid rotating blocks when opening their GUI.
- *
- * The returned value must be true if the wrench was used/usable,
- * false otherwise.
- *
- * Signature of callbacks must be:
- *
- *
- * Callbacks must be declared as packagePath.className.methodName.
- * For example: com.example.Integration.callbackMethod.
- *
- * @param callback the callback to register as a wrench tool handler.
- */
- public static void registerWrenchTool(String callback) {
- FMLInterModComms.sendMessage(MOD_ID, "registerWrenchTool", callback);
- }
-
- /**
- * Register a callback for checking if an item is a wrench.
- *
- * This is used to determine whether certain item stacks are wrench items,
- * which is used, for example, when "itemizing" a drone.
- *
- * The returned value must true if the item stack is a wrench,
- * false otherwise.
- *
- * Signature of callbacks must be:
- *
- * boolean callback(ItemStack stack)
- *
- *
- * Callbacks must be declared as packagePath.className.methodName.
- * For example: com.example.Integration.callbackMethod.
- *
- * @param callback the callback to register as a wrench tool tester.
- */
- public static void registerWrenchToolCheck(String callback) {
- FMLInterModComms.sendMessage(MOD_ID, "registerWrenchToolCheck", callback);
- }
-
- /**
- * Register a handler for items that can be charged.
- *
- * This is used by the charger to determine whether items can be charged
- * by it (canCharge) and to actually charge them (charge).
- *
- * Note that OpenComputers comes with a few built-in handlers for third-
- * party charged items, such as Redstone Flux and IndustrialCraft 2.
- *
- * Signature of callbacks must be:
- *
- *
- * Callbacks must be declared as packagePath.className.methodName.
- * For example: com.example.Integration.callbackMethod.
- *
- * @param name the name of the energy system/item type handled.
- * @param canCharge the callback to register for checking chargeability.
- * @param charge the callback to register for charging items.
- */
- public static void registerItemCharge(String name, String canCharge, String charge) {
- final NBTTagCompound nbt = new NBTTagCompound();
- nbt.setString("name", name);
- nbt.setString("canCharge", canCharge);
- nbt.setString("charge", charge);
- FMLInterModComms.sendMessage(MOD_ID, "registerItemCharge", nbt);
- }
-
- /**
- * Register a provider for ink usable in the 3D printer.
- *
- * Default providers in OpenComputers are one for the ink cartridges as
- * well as one for arbitrary dyes (via the OreDictionary).
- *
- * Use this to make other items usable as ink in the 3D printer. Return a
- * value larger than zero to indicate you handled the provided item stack,
- * with the value being the amount of ink provided by the stack.
- *
- * Signature of callbacks must be:
- *
- * int callback(ItemStack stack)
- *
- *
- * Callbacks must be declared as packagePath.className.methodName.
- * For example: com.example.Integration.callbackMethod.
- *
- * @param callback the callback to register as an ink provider.
- */
- public static void registerInkProvider(String callback) {
- FMLInterModComms.sendMessage(MOD_ID, "registerInkProvider", callback);
- }
-
- /**
- * Blacklist a ComputerCraft peripheral from being wrapped by OpenComputers'
- * built-in driver for ComputerCraft peripherals.
- *
- * Use this if you provide a driver for something that is a peripheral and
- * wish to avoid conflicts in the registered callbacks, for example.
- *
- * @param peripheral the class of the peripheral to blacklist.
- */
- public static void blacklistPeripheral(Class peripheral) {
- FMLInterModComms.sendMessage(MOD_ID, "blacklistPeripheral", peripheral.getName());
- }
-
- /**
- * Blacklist an item for a specified host.
- *
- * This can be used to prevent certain components to be installed in select
- * devices, via the devices class. For example, this is used to prevent
- * components that would not be functional in certain devices to be
- * installed in those devices, such as graphics cards in micro-controllers.
- *
- * The host class is the class of the environment the component would be
- * installed in, e.g. {@link li.cil.oc.api.internal.Tablet}.
- *
- * @param name the name of the component being blacklisted.
- * @param host the class of the host to blacklist the component for.
- * @param stack the item stack representing the blacklisted component.
- */
- public static void blacklistHost(String name, Class host, ItemStack stack) {
- final NBTTagCompound nbt = new NBTTagCompound();
- nbt.setString("name", name);
- nbt.setString("host", host.getName());
- final NBTTagCompound stackNbt = new NBTTagCompound();
- stack.writeToNBT(stackNbt);
- nbt.setTag("item", stackNbt);
- FMLInterModComms.sendMessage(MOD_ID, "blacklistHost", nbt);
- }
-
- // ----------------------------------------------------------------------- //
-
- private static final String MOD_ID = "OpenComputers";
-
- private IMC() {
- }
-}
diff --git a/src/api/java/li/cil/oc/api/Items.java b/src/api/java/li/cil/oc/api/Items.java
deleted file mode 100755
index 81a10bc2f..000000000
--- a/src/api/java/li/cil/oc/api/Items.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package li.cil.oc.api;
-
-import li.cil.oc.api.detail.ItemInfo;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.item.ItemStack;
-
-import java.util.concurrent.Callable;
-
-/**
- * Access to item definitions for all blocks and items provided by
- * OpenComputers.
- */
-public final class Items {
- /**
- * Get a descriptor object for the block or item with the specified name.
- *
- * The names are the same as the ones used in the recipe files. An info
- * object can be used to retrieve both the block and item instance of the
- * item, if available. It can also be used to create a new item stack of
- * the item.
- *
- * Note that these methods should not be called in the pre-init phase,
- * since the {@link li.cil.oc.api.API#items} may not have been initialized
- * at that time. Only start calling these methods in the init phase or later.
- *
- * @param name the name of the item to get the descriptor for.
- * @return the descriptor for the item with the specified name, or
- * null if there is no such item.
- */
- public static ItemInfo get(String name) {
- if (API.items != null)
- return API.items.get(name);
- return null;
- }
-
- /**
- * Get a descriptor object for the block or item represented by the
- * specified item stack.
- *
- * @param stack the stack to get the descriptor for.
- * @return the descriptor for the specified item stack, or null
- * if the stack is not a valid OpenComputers item or block.
- */
- public static ItemInfo get(ItemStack stack) {
- if (API.items != null)
- return API.items.get(stack);
- return null;
- }
-
- /**
- * Register a single loot floppy disk.
- *
- * The disk will be listed in the creative tab of OpenComputers.
- *
- * The specified factory callable will be used to generate a new file
- * system when the loot disk is used as a component. The specified name
- * will be used as the label for the loot disk, as well as the identifier
- * to select the corresponding factory method, so choose wisely.
- *
- * To use some directory in your mod JAR as the directory provided by the
- * loot disk, use {@link FileSystem#fromClass} in your callable.
- *
- * @param name the label and identifier to use for the loot disk.
- * @param color the color of the disk, as a Minecraft color.
- * @param factory the callable to call for creating file system instances.
- * @return an item stack representing the registered loot disk, to allow
- * adding a recipe for your loot disk, for example.
- */
- public static ItemStack registerFloppy(String name, EnumDyeColor color, Callable factory) {
- if (API.items != null)
- return API.items.registerFloppy(name, color, factory);
- return null;
- }
-
- /**
- * Register a single custom EEPROM.
- *
- * The EEPROM will be listed in the creative tab of OpenComputers.
- *
- * The EEPROM will be initialized with the specified code and data byte
- * arrays. For script code (e.g. a Lua script) use String.getBytes("UTF-8").
- * You can omit any of the arguments by passing null.
- *
- * @param name the label of the EEPROM.
- * @param code the code section of the EEPROM.
- * @param data the data section of the EEPROM.
- * @param readonly whether the code section is read-only.
- * @return an item stack representing the registered EEPROM, to allow
- * adding a recipe for your custom BIOS, for example.
- */
- public static ItemStack registerEEPROM(String name, byte[] code, byte[] data, boolean readonly) {
- if (API.items != null)
- return API.items.registerEEPROM(name, code, data, readonly);
- return null;
- }
-
- // ----------------------------------------------------------------------- //
-
- private Items() {
- }
-}
diff --git a/src/api/java/li/cil/oc/api/Machine.java b/src/api/java/li/cil/oc/api/Machine.java
deleted file mode 100755
index ddb412d59..000000000
--- a/src/api/java/li/cil/oc/api/Machine.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package li.cil.oc.api;
-
-import li.cil.oc.api.machine.Architecture;
-import li.cil.oc.api.machine.MachineHost;
-
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * This API is intended for people who would like to implement custom computer
- * blocks or anything else hosting a computer.
- *
- * It also allows registering new {@link li.cil.oc.api.machine.Architecture}s,
- * which are implementations of specific languages (e.g. assembler). The built-
- * in ones are available as static fields in this class.
- *
- * Note that registration of architectures is optional and only intended as a
- * convenience feature to make architectures usable via the built-in CPUs.
- *
- * Note that these methods should not be called in the pre-init phase,
- * since the {@link li.cil.oc.api.API#machine} may not have been initialized
- * at that time. Only start calling these methods in the init phase or later.
- */
-public final class Machine {
- /**
- * Register an architecture that can be used to create new machines.
- *
- * Registering an architecture will make it possible to configure CPUs to
- * run that architecture. This allows providing architectures without
- * implementing a custom CPU item.
- *
- * @param architecture the architecture to register.
- */
- public static void add(Class extends Architecture> architecture) {
- if (API.machine != null)
- API.machine.add(architecture);
- }
-
- /**
- * A list of all registered architectures.
- */
- public static Collection> architectures() {
- if (API.machine != null)
- return API.machine.architectures();
- return Collections.emptyList();
- }
-
- /**
- * Get the name of the specified architecture.
- *
- * @param architecture the architecture to get the name for.
- * @return the name of the specified architecture.
- */
- public static String getArchitectureName(Class extends Architecture> architecture) {
- if (API.machine != null)
- return API.machine.getArchitectureName(architecture);
- return null;
- }
-
- /**
- * Creates a new machine for the specified host.
- *
- * You are responsible for calling update and save / load functions on the
- * machine for it to work correctly.
- *
- * @param host the owner object of the machine, providing context.
- * @return the newly created machine.
- */
- public static li.cil.oc.api.machine.Machine create(MachineHost host) {
- if (API.machine != null)
- return API.machine.create(host);
- return null;
- }
-
- // ----------------------------------------------------------------------- //
-
- private Machine() {
- }
-
- /**
- * The built-in Lua architecture. This will be set to the native Lua
- * implementation when possible, to the LuaJ fallback, otherwise.
- */
- public static Class extends Architecture> LuaArchitecture = null;
-}
diff --git a/src/api/java/li/cil/oc/api/Manual.java b/src/api/java/li/cil/oc/api/Manual.java
deleted file mode 100755
index 5096202c7..000000000
--- a/src/api/java/li/cil/oc/api/Manual.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package li.cil.oc.api;
-
-import li.cil.oc.api.manual.ContentProvider;
-import li.cil.oc.api.manual.ImageProvider;
-import li.cil.oc.api.manual.ImageRenderer;
-import li.cil.oc.api.manual.PathProvider;
-import li.cil.oc.api.manual.TabIconRenderer;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-/**
- * This API allows interfacing with the in-game manual of OpenComputers.
- *
- * It allows opening the manual at a desired specific page, as well as
- * registering custom tabs and content callback handlers.
- *
- * Note: this is a client side only API. It will do nothing on
- * dedicated servers (i.e. API.manual will be null).
- */
-public class Manual {
- /**
- * Register a tab to be displayed next to the manual.
- *
- * These are intended to link to index pages, and for the time being there
- * a relatively low number of tabs that can be displayed, so I'd ask you to
- * only register as many tabs as actually, technically *needed*. Which will
- * usually be one, for your main index page.
- *
- * @param renderer the renderer used to render the icon on your tab.
- * @param tooltip the unlocalized tooltip of the tab, or null.
- * @param path the path to the page to open when the tab is clicked.
- */
- public static void addTab(TabIconRenderer renderer, String tooltip, String path) {
- if (API.manual != null)
- API.manual.addTab(renderer, tooltip, path);
- }
-
- /**
- * Register a path provider.
- *
- * Path providers are used to find documentation entries for item stacks
- * and blocks in the world.
- *
- * @param provider the provider to register.
- */
- public static void addProvider(PathProvider provider) {
- if (API.manual != null)
- API.manual.addProvider(provider);
- }
-
- /**
- * Register a content provider.
- *
- * Content providers are used to resolve paths to page content, if the
- * standard system (using Minecraft's resource loading facilities) fails.
- *
- * This can be useful for providing dynamic content, for example.
- *
- * @param provider the provider to register.
- */
- public static void addProvider(ContentProvider provider) {
- if (API.manual != null)
- API.manual.addProvider(provider);
- }
-
- /**
- * Register an image provider.
- *
- * Image providers are used to render custom content in a page. These are
- * selected via the standard image tag of Markdown, based on the prefix of
- * the image URL, i.e.  will select the
- * image provider registered for the prefix prefix, and pass to
- * it the argument data, then use the returned renderer to draw
- * an element in the place of the tag. The provided prefix is expected to
- * be without the colon (:).
- *
- * Custom providers are only selected if a prefix is matched, otherwise
- * it'll treat it as a relative path to an image to load via Minecraft's
- * resource providing facilities, and display that.
- *
- * @param prefix the prefix on which to use the provider.
- * @param provider the provider to register.
- */
- public static void addProvider(String prefix, ImageProvider provider) {
- if (API.manual != null)
- API.manual.addProvider(prefix, provider);
- }
-
- /**
- * Get the image renderer for the specified image path.
- *
- * This will look for {@link ImageProvider}s registered for a prefix in the
- * specified path. If there is no match, or the matched content provider
- * does not provide a renderer, this will return null.
- *
- * @param path the path to the image to get the renderer for.
- * @return the custom renderer for that path.
- */
- public static ImageRenderer imageFor(String path) {
- if (API.manual != null)
- return API.manual.imageFor(path);
- return null;
- }
-
- // ----------------------------------------------------------------------- //
-
- /**
- * Look up the documentation path for the specified item stack.
- *
- * @param stack the stack to find the documentation path for.
- * @return the path to the page, null if none is known.
- */
- public static String pathFor(ItemStack stack) {
- if (API.manual != null)
- return API.manual.pathFor(stack);
- return null;
- }
-
- /**
- * Look up the documentation for the specified block in the world.
- *
- * @param world the world containing the block.
- * @param pos the position of the block.
- * @return the path to the page, null if none is known.
- */
- public static String pathFor(World world, BlockPos pos) {
- if (API.manual != null)
- return API.manual.pathFor(world, pos);
- return null;
- }
-
- /**
- * Get the content of the documentation page at the specified location.
- *
- * @param path the path of the page to get the content of.
- * @return the content of the page, or null if none exists.
- */
- public static Iterable contentFor(String path) {
- if (API.manual != null)
- return API.manual.contentFor(path);
- return null;
- }
-
- // ----------------------------------------------------------------------- //
-
- /**
- * Open the manual for the specified player.
- *
- * If you wish to display a specific page, call {@link #navigate(String)}
- * after this function returns, with the path to the page to show.
- *
- * @param player the player to open the manual for.
- */
- public static void openFor(EntityPlayer player) {
- if (API.manual != null)
- API.manual.openFor(player);
- }
-
- /**
- * Reset the history of the manual.
- */
- public static void reset() {
- if (API.manual != null)
- API.manual.reset();
- }
-
- /**
- * Navigate to a page in the manual.
- *
- * @param path the path to navigate to.
- */
- public static void navigate(String path) {
- if (API.manual != null)
- API.manual.navigate(path);
- }
-
- // ----------------------------------------------------------------------- //
-
- private Manual() {
- }
-}
diff --git a/src/api/java/li/cil/oc/api/Nanomachines.java b/src/api/java/li/cil/oc/api/Nanomachines.java
deleted file mode 100755
index afa239b8d..000000000
--- a/src/api/java/li/cil/oc/api/Nanomachines.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package li.cil.oc.api;
-
-import li.cil.oc.api.nanomachines.BehaviorProvider;
-import li.cil.oc.api.nanomachines.Controller;
-import net.minecraft.entity.player.EntityPlayer;
-
-import java.util.Collections;
-
-/**
- * This API allows interfacing with nanomachines.
- *
- * It allows registering custom behavior providers as well as querying for all
- * presently registered providers and getting a controller for a player.
- */
-public class Nanomachines {
- /**
- * Register a new behavior provider.
- *
- * When a controller is reconfigured it will draw behaviors from all
- * registered providers and build a new random connection graph to
- * those behaviors.
- *
- * @param provider the provider to add.
- */
- public static void addProvider(BehaviorProvider provider) {
- if (API.nanomachines != null)
- API.nanomachines.addProvider(provider);
- }
-
- /**
- * Get a list of all currently registered providers.
- *
- * @return the list of all currently registered providers.
- */
- public static Iterable getProviders() {
- if (API.nanomachines != null)
- return API.nanomachines.getProviders();
- return Collections.emptyList();
- }
-
- /**
- * Check whether a player has a nanomachine controller installed.
- *
- * @param player the player to check for.
- * @return true if the player has a controller, false otherwise.
- */
- public static boolean hasController(EntityPlayer player) {
- if (API.nanomachines != null)
- return API.nanomachines.hasController(player);
- return false;
- }
-
- /**
- * Get the nanomachine controller of the specified player.
- *
- * If the player has a controller installed, this will initialize the
- * controller if it has not already been loaded. If the player has no
- * controller, this will return null.
- *
- * @param player the player to get the controller for.
- * @return the controller for the specified player.
- */
- public static Controller getController(EntityPlayer player) {
- if (API.nanomachines != null)
- return API.nanomachines.getController(player);
- return null;
- }
-
- /**
- * Install a controller for the specified player if it doesn't already
- * have one.
- *
- * This will also initialize the controller if it has not already been
- * initialized.
- *
- * @param player the player to install a nanomachine controller for.
- */
- public static Controller installController(EntityPlayer player) {
- if (API.nanomachines != null)
- return API.nanomachines.installController(player);
- return null;
- }
-
- /**
- * Uninstall a controller from the specified player if it has one.
- *
- * This will disable all active behaviors before disposing the controller.
- *
- * @param player the player to uninstall a nanomachine controller from.
- */
- public static void uninstallController(EntityPlayer player) {
- if (API.nanomachines != null)
- API.nanomachines.uninstallController(player);
- }
-
- // ----------------------------------------------------------------------- //
-
- private Nanomachines() {
- }
-}
diff --git a/src/api/java/li/cil/oc/api/Network.java b/src/api/java/li/cil/oc/api/Network.java
deleted file mode 100755
index 5db80f8e5..000000000
--- a/src/api/java/li/cil/oc/api/Network.java
+++ /dev/null
@@ -1,246 +0,0 @@
-package li.cil.oc.api;
-
-import li.cil.oc.api.detail.Builder;
-import li.cil.oc.api.network.Environment;
-import li.cil.oc.api.network.Node;
-import li.cil.oc.api.network.Packet;
-import li.cil.oc.api.network.Visibility;
-import li.cil.oc.api.network.WirelessEndpoint;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-
-/**
- * This class provides factories for networks and nodes.
- *
- * The first two functions provided provided by this API are to allow existing
- * environments - implemented in a tile entity for example - to join an existing
- * network or create new ones. The third one is used to create nodes that may
- * then be connected to an existing network. It is not possible to create
- * networks that do not belong to at least one tile entity or node.
- *
- * It is important to understand that component networks only exist on the
- * server side. It is impossible to create nodes, and therefore networks, on
- * the client side. This is to enforce a clear distinction of where the actual
- * logic lies - since user code only runs on the server.
- *
- * Note that these methods should not be called in the pre-init phase,
- * since the {@link li.cil.oc.api.API#network} may not have been initialized
- * at that time. Only start calling these methods in the init phase or later.
- */
-public final class Network {
- /**
- * Convenience overload for {@link #joinOrCreateNetwork(IBlockAccess, BlockPos)}.
- *
- * If the tile entity implements {@link Environment} its one node will be
- * connected to any existing adjacent tile entity nodes. If none exist a
- * new network with the specified tile entity's node as its sole entry.
- *
- * If the tile entity is a {@link li.cil.oc.api.network.SidedEnvironment}
- * the same rules as for simple environments apply, except that the
- * respective for each side is used when connecting, and each side's node
- * is added to its own new network, if necessary.
- *
- * @param tileEntity the tile entity to initialize.
- */
- public static void joinOrCreateNetwork(final TileEntity tileEntity) {
- if (API.network != null)
- API.network.joinOrCreateNetwork(tileEntity);
- }
-
- /**
- * Tries to add network node(s) at the specified coordinates to adjacent
- * networks.
- *
- * @param world the world containing the location to connect.
- * @param pos the position at which to update the network.
- */
- public static void joinOrCreateNetwork(final IBlockAccess world, final BlockPos pos) {
- if (API.network != null)
- API.network.joinOrCreateNetwork(world, pos);
- }
-
- /**
- * Creates a new network with the specified node as its initial node.
- *
- * This can be used to create networks that are not bound to any tile
- * entity. For example, this is used to create the internal networks of
- * robots.
- *
- * @param node the node to create the network for.
- * @throws IllegalArgumentException if the node already is in a network.
- */
- public static void joinNewNetwork(final Node node) {
- if (API.network != null)
- API.network.joinNewNetwork(node);
- }
-
- // ----------------------------------------------------------------------- //
-
- /**
- * Makes a wireless endpoint join the wireless network defined by the mod.
- *
- * OpenComputers tracks endpoints to which to send wireless packets sent
- * via the {@link #sendWirelessPacket(WirelessEndpoint, double, Packet)}
- * method. The packets will only be sent to endpoints registered
- * with the network.
- *
- * Important: when your endpoint is removed from the world,
- * you must ensure it is also removed from the network!
- *
- * @param endpoint the endpoint to register with the network.
- */
- public static void joinWirelessNetwork(final WirelessEndpoint endpoint) {
- if (API.network != null)
- API.network.joinWirelessNetwork(endpoint);
- }
-
- /**
- * Updates a wireless endpoint in the wireless network.
- *
- * This is more efficient than removing and then adding the node again, as
- * it only performs the update if the position significantly changed since
- * the last time the position was updated (more than 0.5 along any axis).
- *
- * Calling this for an endpoint that was not added before does nothing.
- *
- * @param endpoint the endpoint for which to update the position.
- */
- public static void updateWirelessNetwork(final WirelessEndpoint endpoint) {
- if (API.network != null)
- API.network.updateWirelessNetwork(endpoint);
- }
-
- /**
- * Removes a wireless endpoint from the wireless network.
- *
- * This must be called when an endpoint becomes invalid, otherwise it will
- * remain in the network!
- *
- * Calling this for an endpoint that was not added before does nothing.
- *
- * @param endpoint the endpoint to remove from the wireless network.
- */
- public static void leaveWirelessNetwork(final WirelessEndpoint endpoint) {
- if (API.network != null)
- API.network.leaveWirelessNetwork(endpoint);
- }
-
- /**
- * Removes a wireless endpoint from the wireless network of a specific dimension.
- *
- * This may be useful if the dimension of an endpoint changed and you can only
- * react to that change (e.g. a player changing dimensions).
- *
- * Calling this for an endpoint that was not added before does nothing.
- *
- * @param endpoint the endpoint to remove from the wireless network.
- * @param dimension the dimension with the wireless network to remove the endpoint from.
- */
- public static void leaveWirelessNetwork(final WirelessEndpoint endpoint, final int dimension) {
- if (API.network != null)
- API.network.leaveWirelessNetwork(endpoint, dimension);
- }
-
- /**
- * Sends a packet via the wireless network.
- *
- * This will look for all other registered wireless endpoints in range of
- * the sender and submit the packets to them. Whether another end point is
- * reached depends on the distance and potential obstacles between the
- * sender and the receiver (harder blocks require a stronger signal to be
- * penetrated).
- *
- * @param source the endpoint that is sending the message.
- * @param strength the signal strength with which to send the packet.
- * @param packet the packet to send.
- */
- public static void sendWirelessPacket(final WirelessEndpoint source, final double strength, final Packet packet) {
- if (API.network != null)
- API.network.sendWirelessPacket(source, strength, packet);
- }
-
- // ----------------------------------------------------------------------- //
-
- /**
- * Factory function for creating new nodes.
- *
- * Use this to create a node for your environment (e.g. tile entity). This
- * will return a builder that can be used to further specialize the node,
- * making it either a component node (for callbacks), a connector node
- * (for power interaction) or both.
- *
- * Example use:
- *
- *
- * Note that the reachability specified here is the general
- * availability of the created node to other nodes in the network. Special
- * rules apply to components, which have a visibility that is used
- * to control how they can be reached from computers. For example, network
- * cards have a reachability of Visibility.Network, to
- * allow them to communicate with each other, but a visibility of
- * Visibility.Neighbors to avoid other computers in the network
- * to see the card (i.e. only the user programs running on the computer the
- * card installed in can see interact with it).
- *
- * @param host the environment the node is created for.
- * @param reachability the reachability of the node.
- * @return a new node builder.
- */
- public static Builder.NodeBuilder newNode(final Environment host, final Visibility reachability) {
- if (API.network != null)
- return API.network.newNode(host, reachability);
- return null;
- }
-
- /**
- * Creates a new network packet as it would be sent or received by a
- * network card.
- *
- * These packets can be forwarded by switches and access points. For wired
- * transmission they must be sent over a node's send method, with the
- * message name being network.message.
- *
- * @param source the address of the sending node.
- * @param destination the address of the destination, or null
- * for a broadcast.
- * @param port the port to send the packet to.
- * @param data the payload of the packet.
- * @return the new packet.
- */
- public static Packet newPacket(final String source, final String destination, final int port, final Object[] data) {
- if (API.network != null)
- return API.network.newPacket(source, destination, port, data);
- return null;
- }
-
- /**
- * Re-creates a network packet from a previously stored state.
- *
- * @param nbt the tag to load the packet from.
- * @return the loaded packet.
- */
- public static Packet newPacket(final NBTTagCompound nbt) {
- if (API.network != null)
- return API.network.newPacket(nbt);
- return null;
- }
-
- // ----------------------------------------------------------------------- //
-
- private Network() {
- }
-}
diff --git a/src/api/java/li/cil/oc/api/Persistable.java b/src/api/java/li/cil/oc/api/Persistable.java
deleted file mode 100755
index 8ad2b2a45..000000000
--- a/src/api/java/li/cil/oc/api/Persistable.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package li.cil.oc.api;
-
-import net.minecraft.nbt.NBTTagCompound;
-
-/**
- * An object that can be persisted to an NBT tag and restored back from it.
- */
-public interface Persistable {
- /**
- * Restores a previous state of the object from the specified NBT tag.
- *
- * @param nbt the tag to read the state from.
- */
- void load(NBTTagCompound nbt);
-
- /**
- * Saves the current state of the object into the specified NBT tag.
- *
- * This should write the state in such a way that it can be restored when
- * {@link #load} is called with that tag.
- *
- * @param nbt the tag to save the state to.
- */
- void save(NBTTagCompound nbt);
-}
\ No newline at end of file
diff --git a/src/api/java/li/cil/oc/api/README.md b/src/api/java/li/cil/oc/api/README.md
deleted file mode 100755
index f6a454afa..000000000
--- a/src/api/java/li/cil/oc/api/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-The API can be used to either interact with existing implementations in OpenComputers or to implement your own extensions for OpenComputers.
-
-Extending OpenComputers
-========================
-
-Making a tile entity available as a component / peripheral
---------------------------------------------------
-If you simply wish to expose a couple of methods that can be called from a computer if your tile entity's block is 'connected' to the computer, you can use the `SimpleComponent` interface. This interface serves as a marker for OpenComputers to know it has to inject code that converts your tile entity into a component using its class transformer. It is an interface instead of an annotation to allow stripping it, removing any dependencies on OpenComputers. Here is an example implementation:
-```java
-@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")
-public class TileEntityMyFancyThing extends TileEntity
- implements SimpleComponent
-{
- @Override
- public String getComponentName() {
- return "fancy_thing";
- }
-
- @Callback
- @Optional.Method(modid = "OpenComputers")
- public Object[] greet(Context context, Arguments args) {
- return new Object[]{String.format("Hello, %s!", args.checkString(0))};
- }
-}
-```
-
-The `getComponentName` determines with which name the tile entity will be available to computers. The `Callback` annotation tells OpenComputers to make the annotated method available to the computer. See the documentation on the `Callback` annotation for more information, in particular how it can be used to manipulate the call behavior (synchronized to the main thread vs. in the thread driving the calling computer).
-
-So to call the greeter method, in Lua you'd do this:
-```lua
-print(component.fancy_thing.greet("Steve")) -- prints "Hello, Steve!"
-````
-
-More control
-------------
-If you really need more control over how how your tile entity interacts with OpenComputer's internal network, you will have to implement the `Environment` interface on your tile entity. There's a basic implementation in the prefab package, named `TileEntityEnvironment`. Doing so will give you access to the `Node` that connects to the component network, and you must take care of the construction of the node itself (using the factory method in `api.Network`). This allows you to make the node a `Connector` node, which will allow you to draw internal power from OpenComputers or feed energy into it. You will also be able to send messages over the component network, see the `send...` methods in the `Node` interface. See the documentation on those interfaces to get a better idea on how they work together.
-
-Making a third-party block available as component / peripheral
---------------------------------------------------------------
-Blocks from other mods, i.e. blocks where you have no control over the tile entity implementation, can be accessed using the Adapter block as long as there is a driver available that supports the block. If there are multiple drivers they are automatically merged. Please see the [integration][] package for examples, and consider contributing any block drivers you write. Thank you!
-
-Making items available as components
-------------------------------------
-To make items usable as components in computers, such as cards or hard drives, you have to provide a driver for that item. This means you have to implement the `driver.Item` interface on a class and register an instance of it via the `api.Driver` registry. You can base your item drivers on the `DriverItem` prefab. Please see the example project on Github for a working example, and read the documentation of the driver interface for more information.
-
-FileSystem API
-==============
-If you'd like to make some files/scripts you ship with your mod available to a computer, you can do so by wrapping those files using an OpenComputers file system. Use the factory methods in `api.FileSystem` to wrap the location your files are stored at in a file system, use the `asManagedEnvironment` methods to wrap it in a node that can be attached to the component network. For example, in an environment of a tile entity or created by an item driver you could do this in the `onConnect` method whenever a computer is connected (i.e. `node.host() instanceof Context`). Code-wise it may look something like this:
-```java
-public class TileEntityWithFileSystem extends TileEntityEnvironment {
- private final Node fileSystem;
-
- public TileEntityWithFileSystem() {
- node = Network.newNode(this, Visibility.Network).create();
- fileSystem = FileSystem.asManagedEnvironment(FileSystem.fromClass(getClass, "yourmodid/lua"), "my_files");
- }
-
- @Override
- public void onConnect(final Node node) {
- if (node.host() instanceof Context) {
- // Attach our file system to new computers we get connected to.
- // Note that this is also called for all already present computers
- // when we're added to an already existing network, so we don't
- // have to loop through the existing nodes manually.
- node.connect(fileSystem);
- }
- }
-
- @Override
- public void onDisconnect(final Node node) {
- if (node.host() instanceof Context) {
- // Remove our file systems when we get disconnected from a
- // computer.
- node.disconnect(fileSystem);
- } else if (node == this.node) {
- // Remove the file system if we are disconnected, because in that
- // case this method is only called once.
- fileSystem.node.remove();
- }
- }
-}
-```
-
-
-[integration]: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/scala/li/cil/oc/integration
\ No newline at end of file
diff --git a/src/api/java/li/cil/oc/api/component/Keyboard.java b/src/api/java/li/cil/oc/api/component/Keyboard.java
deleted file mode 100755
index d679c03d5..000000000
--- a/src/api/java/li/cil/oc/api/component/Keyboard.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package li.cil.oc.api.component;
-
-/**
- * Not meant to be implemented.
- *
- * @deprecated Use li.cil.oc.api.internal.Keyboard instead.
- */
-@Deprecated
-public interface Keyboard extends li.cil.oc.api.internal.Keyboard {
- /**
- * Not meant to be implemented.
- *
- * @deprecated Use li.cil.oc.api.internal.Keyboard.UsabilityChecker instead.
- */
- interface UsabilityChecker extends li.cil.oc.api.internal.Keyboard.UsabilityChecker {
- }
-}
diff --git a/src/api/java/li/cil/oc/api/component/RackBusConnectable.java b/src/api/java/li/cil/oc/api/component/RackBusConnectable.java
deleted file mode 100755
index 352c9ee3d..000000000
--- a/src/api/java/li/cil/oc/api/component/RackBusConnectable.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package li.cil.oc.api.component;
-
-import li.cil.oc.api.network.Environment;
-import li.cil.oc.api.network.Packet;
-
-/**
- * Use this interface on environments that may receive network messages from a
- * bus in a rack.
- *
- * Specifically, this is checked on environments in servers installed in racks.
- * The server will collect the first three environments of components in it
- * implement this interface, and provide their nodes to the rack via the
- * {@link RackMountable#getConnectableAt(int)} method. This in turn will allow them
- * to be 'connected' to the buses, so that they can receive network messages
- * arriving on the respective side of the rack.
- */
-public interface RackBusConnectable extends Environment {
- /**
- * Called to inject a network packet that arrived on the bus this
- * environment is connected to in the hosting rack.
- *
- * @param packet the packet to handle.
- */
- void receivePacket(Packet packet);
-}
diff --git a/src/api/java/li/cil/oc/api/component/RackMountable.java b/src/api/java/li/cil/oc/api/component/RackMountable.java
deleted file mode 100755
index efe405744..000000000
--- a/src/api/java/li/cil/oc/api/component/RackMountable.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package li.cil.oc.api.component;
-
-import li.cil.oc.api.network.Analyzable;
-import li.cil.oc.api.network.ComponentHost;
-import li.cil.oc.api.network.ManagedEnvironment;
-import li.cil.oc.api.util.StateAware;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumHand;
-
-/**
- * Use this interface on environments provided by drivers for items that can
- * be installed in a server rack.
- *
- * The provided environment can be used for updating the part in its installed
- * state. The nodes provided by the getters in this interface are used to
- * access nodes provided by the environment (e.g. multiple "interfacing"
- * nodes for a switch), and connect the nodes to the corresponding buses as
- * defined by the rack's configuration.
- *
- * Note: mountables may implement the {@link ComponentHost} interface and
- * {@link IInventory}. In this case, if they contain a redstone card and have
- * a state of State.IsWorking the rack will visually connect to
- * redstone, for example. Same goes for abstract bus cards, and potentially
- * more things in the future.
- *
- * Furthermore, implementing {@link Analyzable} will allow specifying more
- * information when the analyzer is used on the mountable while it's in a rack.
- */
-public interface RackMountable extends ManagedEnvironment, StateAware {
- /**
- * Returns some data describing the state of the mountable.
- *
- * This is called on the server side to synchronize data to the client after
- * the rack's {@link li.cil.oc.api.internal.Rack#markChanged(int)}
- * method has been called for the slot this mountable is in. It will there
- * be passed on with the render event to allow state specific rendering of
- * the mountable in the rack.
- *
- * @return the data to synchronize to the clients.
- */
- NBTTagCompound getData();
-
- /**
- * The number of connectables exposed by the environment.
- *
- * Node that only the first three will ever be used.
- */
- int getConnectableCount();
-
- /**
- * Returns the node at the specified index.
- */
- RackBusConnectable getConnectableAt(int index);
-
- /**
- * This gets called when the server rack is activated by a player, and
- * hits the space occupied by this mountable.
- *
- * As per usual, keep in mind that the hit coordinates are comparatively
- * imprecise on the server side, since they'll have been sent in a
- * pointlessly compressed fashion (because MC is a dummy like that).
- *
- * @param player the player activating the mountable.
- * @param hand the hand the player used.
- * @param heldItem the item held in that hand.
- * @param hitX the relative x coordinate of the activation on the mountable.
- * @param hitY the relative y coordinate of the activation on the mountable.
- * @return whether the activation was handled (e.g. GUI opened).
- */
- boolean onActivate(EntityPlayer player, EnumHand hand, ItemStack heldItem, float hitX, float hitY);
-}
diff --git a/src/api/java/li/cil/oc/api/component/TextBuffer.java b/src/api/java/li/cil/oc/api/component/TextBuffer.java
deleted file mode 100755
index a997a00ba..000000000
--- a/src/api/java/li/cil/oc/api/component/TextBuffer.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package li.cil.oc.api.component;
-
-import li.cil.oc.api.Persistable;
-import li.cil.oc.api.network.ManagedEnvironment;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-/**
- * Not meant to be implemented.
- *
- * @deprecated Use li.cil.oc.api.internal.TextBuffer instead.
- */
-@Deprecated
-public interface TextBuffer extends li.cil.oc.api.internal.TextBuffer {
-}
diff --git a/src/api/java/li/cil/oc/api/component/package-info.java b/src/api/java/li/cil/oc/api/component/package-info.java
deleted file mode 100755
index 61c8d8958..000000000
--- a/src/api/java/li/cil/oc/api/component/package-info.java
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * This package contains interfaces to be implemented on components.
- *
- * This will allow OpenComputers to provide some more advanced integration
- * with your components.
- */
-@net.minecraftforge.fml.common.API(
- owner = API.ID_OWNER,
- provides = "OpenComputersAPI|Component",
- apiVersion = API.VERSION)
-package li.cil.oc.api.component;
-
-import li.cil.oc.api.API;
\ No newline at end of file
diff --git a/src/api/java/li/cil/oc/api/detail/Builder.java b/src/api/java/li/cil/oc/api/detail/Builder.java
deleted file mode 100755
index 10affbbac..000000000
--- a/src/api/java/li/cil/oc/api/detail/Builder.java
+++ /dev/null
@@ -1,150 +0,0 @@
-package li.cil.oc.api.detail;
-
-import li.cil.oc.api.network.Component;
-import li.cil.oc.api.network.ComponentConnector;
-import li.cil.oc.api.network.Connector;
-import li.cil.oc.api.network.Node;
-import li.cil.oc.api.network.Visibility;
-
-/**
- * Used for building {@link Node}s via {@link li.cil.oc.api.Network#newNode}.
- *
- * @param the type of the node created by this builder.
- */
-public interface Builder {
- /**
- * Finalizes the construction of the node.
- *
- * This performs the actual creation of the node, initializes it to the
- * settings defined by the current builder and returns it.
- *
- * @return the final node.
- */
- T create();
-
- /**
- * Builder for basic nodes. These nodes merely allow network access and
- * take on no special role.
- */
- public static interface NodeBuilder extends Builder {
- /**
- * Makes the node a component.
- *
- * Nodes that are components can be accessed from computers, methods
- * declared in them marked using the {@link li.cil.oc.api.machine.Callback} annotation can
- * be invoked from computers that can see the component.
- *
- * @param name the name of the component.
- * @param visibility the visibility of the component.
- * @return a builder for a node that is also a component.
- * @see li.cil.oc.api.network.Component
- */
- ComponentBuilder withComponent(String name, Visibility visibility);
-
- /**
- * Makes the node a component.
- *
- * Like {@link #withComponent(String, Visibility)}, but with a default
- * visibility set to the reachability of the node.
- *
- * @param name the name of the component.
- * @return a builder for a node that is also a component.
- * @see li.cil.oc.api.network.Component
- */
- ComponentBuilder withComponent(String name);
-
- /**
- * Makes the node a connector.
- *
- * A connector node can feed power into the network and extract power
- * from the network. This is used both for passive energy drain (such
- * as running screens and computers) and for active power consumption
- * (such as wireless message sending or robot actions).
- *
- * @param bufferSize the size of the local energy buffer.
- * @return a builder for a node that is also a connector.
- * @see li.cil.oc.api.network.Connector
- */
- ConnectorBuilder withConnector(double bufferSize);
-
- /**
- * Makes the node a connector.
- *
- * Like {@link #withConnector(double)}, but with a default buffer size
- * of zero.
- *
- * @return a builder for a node that is also a connector.
- * @see li.cil.oc.api.network.Connector
- */
- ConnectorBuilder withConnector();
- }
-
- /**
- * Builder for component nodes. These node can be interacted with from
- * computers in the same network, that can see the component.
- */
- public static interface ComponentBuilder extends Builder {
- /**
- * Makes the node a connector.
- *
- * A connector node can feed power into the network and extract power
- * from the network. This is used both for passive energy drain (such
- * as running screens and computers) and for active power consumption
- * (such as wireless message sending or robot actions).
- *
- * @param bufferSize the size of the local energy buffer.
- * @return a builder for a node that is also a connector.
- * @see li.cil.oc.api.network.Connector
- */
- ComponentConnectorBuilder withConnector(double bufferSize);
-
- /**
- * Makes the node a connector.
- *
- * Like {@link #withConnector(double)}, but with a default buffer size
- * of zero.
- *
- * @return a builder for a node that is also a connector.
- * @see li.cil.oc.api.network.Connector
- */
- ComponentConnectorBuilder withConnector();
- }
-
- /**
- * Builder for connector nodes. These nodes can interact with the energy
- * stored in the network, i.e. increase or reduce it.
- */
- public static interface ConnectorBuilder extends Builder {
- /**
- * Makes the node a component.
- *
- * Nodes that are components can be accessed from computers, methods
- * declared in them marked using the {@link li.cil.oc.api.machine.Callback} annotation can
- * be invoked from computers that can see the component.
- *
- * @param name the name of the component.
- * @param visibility the visibility of the component.
- * @return a builder for a node that is also a component.
- * @see li.cil.oc.api.network.Component
- */
- ComponentConnectorBuilder withComponent(String name, Visibility visibility);
-
- /**
- * Makes the node a component.
- *
- * Like {@link #withComponent(String, Visibility)}, but with a default
- * visibility set to the reachability of the node.
- *
- * @param name the name of the component.
- * @return a builder for a node that is also a component.
- * @see li.cil.oc.api.network.Component
- */
- ComponentConnectorBuilder withComponent(String name);
- }
-
- /**
- * Builder for nodes that are both component and connector node.
- */
- public static interface ComponentConnectorBuilder extends Builder {
- }
-}
diff --git a/src/api/java/li/cil/oc/api/detail/DriverAPI.java b/src/api/java/li/cil/oc/api/detail/DriverAPI.java
deleted file mode 100755
index 1bdab9120..000000000
--- a/src/api/java/li/cil/oc/api/detail/DriverAPI.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package li.cil.oc.api.detail;
-
-import li.cil.oc.api.driver.Block;
-import li.cil.oc.api.driver.Converter;
-import li.cil.oc.api.driver.EnvironmentProvider;
-import li.cil.oc.api.driver.InventoryProvider;
-import li.cil.oc.api.driver.Item;
-import li.cil.oc.api.driver.SidedBlock;
-import li.cil.oc.api.network.EnvironmentHost;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.world.World;
-
-import java.util.Collection;
-
-public interface DriverAPI {
- /**
- * Registers a new driver for a block component.
- *
- * Whenever the neighboring blocks of an Adapter block change, it checks if
- * there exists a driver for the changed block, and if it is configured to
- * interface that block type connects it to the component network.
- *
- * This must be called in the init phase, not the pre- or post-init
- * phases.
- *
- * @param driver the driver for a block component.
- * @deprecated Use {@link SidedBlock} instead.
- */
- @Deprecated // TODO Remove in OC 1.7
- void add(Block driver);
-
- /**
- * Registers a new side-aware block driver.
- *
- * Whenever the neighboring blocks of an Adapter block change, it checks if
- * there exists a driver for the changed block, and if it is configured to
- * interface that block type connects it to the component network.
- *
- * This must be called in the init phase, not the pre- or post-init
- * phases.
- *
- * @param driver the driver to register.
- */
- void add(SidedBlock driver);
-
- /**
- * Registers a new driver for an item component.
- *
- * Item components can inserted into a computers component slots. They have
- * to specify their type, to determine into which slots they can fit.
- *
- * This must be called in the init phase, not the pre- or post-init
- * phases.
- *
- * @param driver the driver for an item component.
- */
- void add(Item driver);
-
- /**
- * Registers a new type converter.
- *
- * Type converters are used to automatically convert values returned from
- * callbacks to a "simple" format that can be pushed to any architecture.
- *
- * This must be called in the init phase, not the pre- or post-init
- * phases.
- *
- * @param converter the converter to register.
- */
- void add(Converter converter);
-
- /**
- * Register a new environment provider.
- *
- * Environment providers are used for mapping item stacks to the type of
- * environment that will be created by the stack, either by it being
- * placed in the world and acting as a block component, or by being
- * placed in an component inventory and created by the item's driver.
- *
- * @param provider the provider to register.
- */
- void add(EnvironmentProvider provider);
-
- /**
- * Register a new inventory provider.
- *
- * Inventory providers are used for accessing item inventories using
- * the inventory controller upgrade, for example.
- *
- * @param provider the provider to register.
- */
- void add(InventoryProvider provider);
-
- /**
- * Looks up a driver for the block at the specified position in the
- * specified world.
- *
- * Note that several drivers for a single block can exist. Because of this
- * block drivers are always encapsulated in a 'compound' driver, which is
- * what will be returned here. In other words, you should will not
- * get actual instances of drivers registered via {@link #add(li.cil.oc.api.driver.Block)}.
- *
- * @param world the world containing the block.
- * @param pos the position of the block.
- * @return a driver for the block, or null if there is none.
- * @deprecated Use {@link #driverFor(World, BlockPos, EnumFacing)},
- * passing null if the side is to be ignored.
- */
- @Deprecated // TODO Remove in OC 1.7
- Block driverFor(World world, BlockPos pos);
-
- /**
- * Looks up a driver for the block at the specified position in the
- * specified world.
- *
- * Note that several drivers for a single block can exist. Because of this
- * block drivers are always encapsulated in a 'compound' driver, which is
- * what will be returned here. In other words, you should will not
- * get actual instances of drivers registered via {@link #add(li.cil.oc.api.driver.Block)}.
- *
- * @param world the world containing the block.
- * @param pos the position of the block.
- * @param side the side of the block.
- * @return a driver for the block, or null if there is none.
- */
- SidedBlock driverFor(World world, BlockPos pos, EnumFacing side);
-
- /**
- * Looks up a driver for the specified item stack.
- *
- * Note that unlike for blocks, there can always only be one item driver
- * per item. If there are multiple ones, the first one that was registered
- * will be used.
- *
- * @param stack the item stack to get a driver for.
- * @param host the type that will host the environment created by returned driver.
- * @return a driver for the item, or null if there is none.
- */
- Item driverFor(ItemStack stack, Class extends EnvironmentHost> host);
-
- /**
- * Looks up a driver for the specified item stack.
- *
- * Note that unlike for blocks, there can always only be one item driver
- * per item. If there are multiple ones, the first one that was registered
- * will be used.
- *
- * This is a context-agnostic variant used mostly for "house-keeping"
- * stuff, such as querying slot types and tier.
- *
- * @param stack the item stack to get a driver for.
- * @return a driver for the item, or null if there is none.
- */
- Item driverFor(ItemStack stack);
-
- /**
- * Looks up the environment associated with the specified item stack.
- *
- * This will use the registered {@link EnvironmentProvider}s to find
- * an environment type for the specified item stack. If none can be
- * found, returns null.
- *
- * @param stack the item stack to get the environment type for.
- * @return the type of environment associated with the stack, or null.
- */
- Class> environmentFor(ItemStack stack);
-
- /**
- * Get an inventory implementation providing access to an item inventory.
- *
- * This will use the registered {@link InventoryProvider}s to find an
- * inventory implementation providing access to the specified stack.
- * If none can be found, returns null.
- *
- * Note that the specified player may be null, but will usually
- * be the fake player of the agent making use of this API.
- *
- * @param stack the item stack to get the inventory access for.
- * @param player the player holding the item. May be null.
- * @return the inventory implementation interfacing the stack, or null.
- */
- IInventory inventoryFor(ItemStack stack, EntityPlayer player);
-
- /**
- * Get a list of all registered block drivers.
- *
- * This is intended to allow checking for particular drivers using more
- * customized logic.
- *
- * The returned collection is read-only.
- *
- * @return the list of all registered block drivers.
- */
- Collection blockDrivers();
-
- /**
- * Get a list of all registered item drivers.
- *
- * This is intended to allow checking for particular drivers using more
- * customized logic.
- *
- * The returned collection is read-only.
- *
- * @return the list of all registered item drivers.
- */
- Collection itemDrivers();
-}
diff --git a/src/api/java/li/cil/oc/api/detail/FileSystemAPI.java b/src/api/java/li/cil/oc/api/detail/FileSystemAPI.java
deleted file mode 100755
index fa58c3b1a..000000000
--- a/src/api/java/li/cil/oc/api/detail/FileSystemAPI.java
+++ /dev/null
@@ -1,167 +0,0 @@
-package li.cil.oc.api.detail;
-
-import li.cil.oc.api.network.EnvironmentHost;
-import li.cil.oc.api.fs.FileSystem;
-import li.cil.oc.api.fs.Label;
-import li.cil.oc.api.network.ManagedEnvironment;
-
-public interface FileSystemAPI {
- /**
- * Creates a new file system based on the location of a class.
- *
- * This can be used to wrap a folder in the assets folder of your mod's JAR.
- * The actual path is built like this:
- *
"/assets/" + domain + "/" + root
- *
- * If the class is located in a JAR file, this will create a read-only file
- * system based on that JAR file. If the class file is located in the native
- * file system, this will create a read-only file system first trying from
- * the actual location of the class file, and failing that by searching the
- * class path (i.e. it'll look for a path constructed as described above).
- *
- * If the specified path cannot be located, the creation fails and this
- * returns null.
- *
- * @param clazz the class whose containing JAR to wrap.
- * @param domain the domain, usually your mod's ID.
- * @param root an optional subdirectory.
- * @return a file system wrapping the specified folder.
- */
- FileSystem fromClass(Class> clazz, String domain, String root);
-
- /**
- * Creates a new writable file system in the save folder.
- *
- * This will create a folder, if necessary, and create a writable virtual
- * file system based in that folder. The actual path is based in a sub-
- * folder of the save folder. The actual path is built like this:
- *
"saves/" + WORLD_NAME + "/opencomputers/" + root
- * The first part may differ, in particular for servers.
- *
- * Usually the name will be the address of the node used to represent the
- * file system.
- *
- * Note that by default file systems are "buffered", meaning that any
- * changes made to them are only saved to disk when the world is saved. This
- * ensured that the file system contents do not go "out of sync" when the
- * game crashes, but introduces additional memory overhead, since all files
- * in the file system have to be kept in memory.
- *
- * @param root the name of the file system.
- * @param capacity the amount of space in bytes to allow being used.
- * @param buffered whether data should only be written to disk when saving.
- * @return a file system wrapping the specified folder.
- */
- FileSystem fromSaveDirectory(String root, long capacity, boolean buffered);
-
- /**
- * Creates a new writable file system that resides in memory.
- *
- * Any contents created and written on this file system will be lost when
- * the node is removed from the network.
- *
- * This is used for computers' /tmp mount, for example.
- *
- * @param capacity the capacity of the file system.
- * @return a file system residing in memory.
- */
- FileSystem fromMemory(long capacity);
-
- /**
- * Wrap a file system retrieved via one of the from??? methods to
- * make it read-only.
- *
- * @param fileSystem the file system to wrap.
- * @return the specified file system wrapped to be read-only.
- */
- FileSystem asReadOnly(final FileSystem fileSystem);
-
- /**
- * Creates a network node that makes the specified file system available via
- * the common file system driver.
- *
- * This can be useful for providing some data if you don't wish to implement
- * your own driver. Which will probably be most of the time. If you need
- * more control over the node, implement your own, and connect this one to
- * it. In that case you will have to forward any disk driver messages to the
- * node, though.
- *
- * The container parameter is used to give the file system some physical
- * relation to the world, for example this is used by hard drives to send
- * the disk event notifications to the client that are used to play disk
- * access sounds.
- *
- * The container may be null, if no such context can be provided.
- *
- * The access sound is the name of the sound effect to play when the file
- * system is accessed, for example by listing a directory or reading from
- * a file. It may be null to create a silent file system.
- *
- * The speed multiplier controls how fast read and write operations on the
- * file system are. It must be a value in [1,6], and controls the access
- * speed, with the default being one.
- * For reference, floppies are using the default, hard drives scale with
- * their tiers, i.e. a tier one hard drive uses speed two, tier three uses
- * speed four.
- *
- * @param fileSystem the file system to wrap.
- * @param label the label of the file system.
- * @param host the tile entity containing the file system.
- * @param accessSound the name of the sound effect to play when the file
- * system is accessed. This has to be the fully
- * qualified resource name, e.g.
- * opencomputers:floppy_access.
- * @param speed the speed multiplier for this file system.
- * @return the network node wrapping the file system.
- */
- ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, Label label, EnvironmentHost host, String accessSound, int speed);
-
- /**
- * Creates a network node that makes the specified file system available via
- * the common file system driver.
- *
- * Creates a file system with the a read-only label and the specified
- * access sound and file system speed.
- *
- * @param fileSystem the file system to wrap.
- * @param label the read-only label of the file system.
- * @param host the tile entity containing the file system.
- * @param accessSound the name of the sound effect to play when the file
- * system is accessed. This has to be the fully
- * qualified resource name, e.g.
- * opencomputers:floppy_access.
- * @param speed the speed multiplier for this file system.
- * @return the network node wrapping the file system.
- */
- ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, String label, EnvironmentHost host, String accessSound, int speed);
-
- /**
- * @deprecated Don't use this directly, use the wrapper in {@link li.cil.oc.api.FileSystem}.
- */
- @Deprecated
- ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, Label label, EnvironmentHost host, String accessSound);
-
- /**
- * @deprecated Don't use this directly, use the wrapper in {@link li.cil.oc.api.FileSystem}.
- */
- @Deprecated
- ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, String label, EnvironmentHost host, String accessSound);
-
- /**
- * @deprecated Don't use this directly, use the wrapper in {@link li.cil.oc.api.FileSystem}.
- */
- @Deprecated
- ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, Label label);
-
- /**
- * @deprecated Don't use this directly, use the wrapper in {@link li.cil.oc.api.FileSystem}.
- */
- @Deprecated
- ManagedEnvironment asManagedEnvironment(FileSystem fileSystem, String label);
-
- /**
- * @deprecated Don't use this directly, use the wrapper in {@link li.cil.oc.api.FileSystem}.
- */
- @Deprecated
- ManagedEnvironment asManagedEnvironment(FileSystem fileSystem);
-}
\ No newline at end of file
diff --git a/src/api/java/li/cil/oc/api/detail/ItemAPI.java b/src/api/java/li/cil/oc/api/detail/ItemAPI.java
deleted file mode 100755
index 358472c48..000000000
--- a/src/api/java/li/cil/oc/api/detail/ItemAPI.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package li.cil.oc.api.detail;
-
-import li.cil.oc.api.FileSystem;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.item.ItemStack;
-
-import java.util.concurrent.Callable;
-
-public interface ItemAPI {
- /**
- * Get a descriptor object for the block or item with the specified name.
- *
- * The names are the same as the ones used in the recipe files. An info
- * object can be used to retrieve both the block and item instance of the
- * item, if available. It can also be used to create a new item stack of
- * the item.
- *
- * @param name the name of the item to get the descriptor for.
- * @return the descriptor for the item with the specified name, or
- * null if there is no such item.
- */
- ItemInfo get(String name);
-
- /**
- * Get a descriptor object for the block or item represented by the
- * specified item stack.
- *
- * @param stack the stack to get the descriptor for.
- * @return the descriptor for the specified item stack, or null
- * if the stack is not a valid OpenComputers item or block.
- */
- ItemInfo get(ItemStack stack);
-
- /**
- * Register a single loot floppy disk.
- *
- * The disk will be listed in the creative tab of OpenComputers.
- *
- * The specified factory callable will be used to generate a new file
- * system when the loot disk is used as a component. The specified name
- * will be used as the label for the loot disk, as well as the identifier
- * to select the corresponding factory method, so choose wisely.
- *
- * To use some directory in your mod JAR as the directory provided by the
- * loot disk, use {@link FileSystem#fromClass} in your callable.
- *
- * Call this in the init phase or later, not in pre-init.
- *
- * @param name the label and identifier to use for the loot disk.
- * @param color the color of the disk, as a Minecraft color.
- * @param factory the callable to call for creating file system instances.
- * @return an item stack representing the registered loot disk, to allow
- * adding a recipe for your loot disk, for example.
- */
- ItemStack registerFloppy(String name, EnumDyeColor color, Callable factory);
-
- /**
- * Register a single custom EEPROM.
- *
- * The EEPROM will be listed in the creative tab of OpenComputers.
- *
- * The EEPROM will be initialized with the specified code and data byte
- * arrays. For script code (e.g. a Lua script) use String.getBytes("UTF-8").
- * You can omit any of the arguments by passing null.
- *
- * Call this in the init phase or later, not in pre-init.
- *
- * @param name the label of the EEPROM.
- * @param code the code section of the EEPROM.
- * @param data the data section of the EEPROM.
- * @param readonly whether the code section is read-only.
- * @return an item stack representing the registered EEPROM, to allow
- * adding a recipe for your custom BIOS, for example.
- */
- ItemStack registerEEPROM(String name, byte[] code, byte[] data, boolean readonly);
-}
diff --git a/src/api/java/li/cil/oc/api/detail/ItemInfo.java b/src/api/java/li/cil/oc/api/detail/ItemInfo.java
deleted file mode 100755
index 4decd85a5..000000000
--- a/src/api/java/li/cil/oc/api/detail/ItemInfo.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package li.cil.oc.api.detail;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-
-public interface ItemInfo {
- /**
- * The name of this item descriptor.
- *
- * This is the name that yields this instance when passed to
- * {@link li.cil.oc.api.Items#get(String)}. Useful for reverse-lookup when
- * retrieving the descriptor via an item stack.
- *
- * @return the name of this item descriptor.
- */
- String name();
-
- /**
- * Returns the block type of the represented item. In case the item is not
- * a block this will return null.
- *
- * Note that OpenComputers represents most of its items using just a few
- * actual Block instances, so descriptors for different blocks may
- * return the same object here.
- *
- * @return the block type of the represented block.
- */
- Block block();
-
- /**
- * Returns the item type of the represented item. In case the item is a
- * blocks this will return null.
- *
- * Note that OpenComputers represents most of its items using just a few
- * actual Item instances, so descriptors for different items may
- * return the same object here.
- *
- * @return the item type of the represented item.
- */
- Item item();
-
- /**
- * Creates a new item stack of the item represended by this descriptor.
- *
- * @param size the size of the item stack to create.
- * @return the created item stack.
- */
- ItemStack createItemStack(int size);
-}
diff --git a/src/api/java/li/cil/oc/api/detail/MachineAPI.java b/src/api/java/li/cil/oc/api/detail/MachineAPI.java
deleted file mode 100755
index 458f7cd03..000000000
--- a/src/api/java/li/cil/oc/api/detail/MachineAPI.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package li.cil.oc.api.detail;
-
-import li.cil.oc.api.machine.Architecture;
-import li.cil.oc.api.machine.Machine;
-import li.cil.oc.api.machine.MachineHost;
-
-import java.util.Collection;
-
-public interface MachineAPI {
- /**
- * Register an architecture that can be used to create new machines.
- *
- * Note that although registration is optional, it is strongly recommended
- * to allow {@link #architectures()} to be useful.
- *
- * @param architecture the architecture to register.
- * @throws IllegalArgumentException if the specified architecture is invalid.
- */
- void add(Class extends Architecture> architecture);
-
- /**
- * A list of all registered architectures.
- *
- * Note that registration is optional, although automatic when calling
- * {@link #create(li.cil.oc.api.machine.MachineHost)} with a not yet
- * registered architecture. What this means is that unless a mod providing
- * a custom architecture also registers it, you may not see it in this list
- * until it also created a new machine using that architecture.
- */
- Collection> architectures();
-
- /**
- * Get the name of the specified architecture.
- *
- * @param architecture the architecture to get the name for.
- * @return the name of the specified architecture.
- */
- String getArchitectureName(Class extends Architecture> architecture);
-
- /**
- * Creates a new machine for the specified host.
- *
- * You are responsible for calling update and save / load functions on the
- * machine for it to work correctly.
- *
- * @param host the owner object of the machine, providing context.
- * @return the newly created machine.
- * @throws IllegalArgumentException if the specified architecture is invalid.
- */
- Machine create(MachineHost host);
-}
diff --git a/src/api/java/li/cil/oc/api/detail/ManualAPI.java b/src/api/java/li/cil/oc/api/detail/ManualAPI.java
deleted file mode 100755
index 605955472..000000000
--- a/src/api/java/li/cil/oc/api/detail/ManualAPI.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package li.cil.oc.api.detail;
-
-import li.cil.oc.api.manual.ContentProvider;
-import li.cil.oc.api.manual.ImageProvider;
-import li.cil.oc.api.manual.ImageRenderer;
-import li.cil.oc.api.manual.PathProvider;
-import li.cil.oc.api.manual.TabIconRenderer;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public interface ManualAPI {
- /**
- * Register a tab to be displayed next to the manual.
- *
- * These are intended to link to index pages, and for the time being there
- * a relatively low number of tabs that can be displayed, so I'd ask you to
- * only register as many tabs as actually, technically *needed*. Which will
- * usually be one, for your main index page.
- *
- * @param renderer the renderer used to render the icon on your tab.
- * @param tooltip the unlocalized tooltip of the tab, or null.
- * @param path the path to the page to open when the tab is clicked.
- */
- void addTab(TabIconRenderer renderer, String tooltip, String path);
-
- /**
- * Register a path provider.
- *
- * Path providers are used to find documentation entries for item stacks
- * and blocks in the world.
- *
- * @param provider the provider to register.
- */
- void addProvider(PathProvider provider);
-
- /**
- * Register a content provider.
- *
- * Content providers are used to resolve paths to page content, if the
- * standard system (using Minecraft's resource loading facilities) fails.
- *
- * This can be useful for providing dynamic content, for example.
- *
- * @param provider the provider to register.
- */
- void addProvider(ContentProvider provider);
-
- /**
- * Register an image provider.
- *
- * Image providers are used to render custom content in a page. These are
- * selected via the standard image tag of Markdown, based on the prefix of
- * the image URL, i.e.  will select the
- * image provider registered for the prefix prefix, and pass to
- * it the argument data, then use the returned renderer to draw
- * an element in the place of the tag.
- *
- * Custom providers are only selected if a prefix is matched, otherwise
- * it'll treat it as a relative path to an image to load via Minecraft's
- * resource providing facilities, and display that.
- *
- * @param prefix the prefix on which to use the provider.
- * @param provider the provider to register.
- */
- void addProvider(String prefix, ImageProvider provider);
-
- // ----------------------------------------------------------------------- //
-
- /**
- * Look up the documentation path for the specified item stack.
- *
- * @param stack the stack to find the documentation path for.
- * @return the path to the page, null if none is known.
- */
- String pathFor(ItemStack stack);
-
- /**
- * Look up the documentation for the specified block in the world.
- *
- * @param world the world containing the block.
- * @param pos the position of the block.
- * @return the path to the page, null if none is known.
- */
- String pathFor(World world, BlockPos pos);
-
- /**
- * Get the content of the documentation page at the specified location.
- *
- * The provided path may contain the special variable %LANGUAGE%,
- * which will be resolved to the currently set language, falling back to
- * en_US.
- *
- * @param path the path of the page to get the content of.
- * @return the content of the page, or null if none exists.
- */
- Iterable contentFor(String path);
-
- /**
- * Get the image renderer for the specified image path.
- *
- * This will look for {@link ImageProvider}s registered for a prefix in the
- * specified path. If there is no match, or the matched content provider
- * does not provide a renderer, this will return null.
- *
- * @param path the path to the image to get the renderer for.
- * @return the custom renderer for that path.
- */
- ImageRenderer imageFor(String path);
-
- // ----------------------------------------------------------------------- //
-
- /**
- * Open the manual for the specified player.
- *
- * If you wish to display a specific page, call {@link #navigate(String)}
- * after this function returns, with the path to the page to show.
- *
- * @param player the player to open the manual for.
- */
- void openFor(EntityPlayer player);
-
- /**
- * Reset the history of the manual.
- */
- void reset();
-
- /**
- * Navigate to a page in the manual.
- *
- * @param path the path to navigate to.
- */
- void navigate(String path);
-}
diff --git a/src/api/java/li/cil/oc/api/detail/NanomachinesAPI.java b/src/api/java/li/cil/oc/api/detail/NanomachinesAPI.java
deleted file mode 100755
index 4a85f5fcf..000000000
--- a/src/api/java/li/cil/oc/api/detail/NanomachinesAPI.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package li.cil.oc.api.detail;
-
-import li.cil.oc.api.nanomachines.BehaviorProvider;
-import li.cil.oc.api.nanomachines.Controller;
-import net.minecraft.entity.player.EntityPlayer;
-
-public interface NanomachinesAPI {
- /**
- * Register a new behavior provider.
- *
- * When a controller is reconfigured it will draw behaviors from all
- * registered providers and build a new random connection graph to
- * those behaviors.
- *
- * @param provider the provider to add.
- */
- void addProvider(BehaviorProvider provider);
-
- /**
- * Get a list of all currently registered providers.
- *
- * @return the list of all currently registered providers.
- */
- Iterable getProviders();
-
- /**
- * Check whether a player has a nanomachine controller installed.
- *
- * @param player the player to check for.
- * @return true if the player has a controller, false otherwise.
- */
- boolean hasController(EntityPlayer player);
-
- /**
- * Get the nanomachine controller of the specified player.
- *
- * If the player has a controller installed, this will initialize the
- * controller if it has not already been loaded. If the player has no
- * controller, this will return null.
- *
- * @param player the player to get the controller for.
- * @return the controller for the specified player.
- */
- Controller getController(EntityPlayer player);
-
- /**
- * Install a controller for the specified player if it doesn't already
- * have one.
- *
- * This will also initialize the controller if it has not already been
- * initialized.
- *
- * @param player the player to install a nanomachine controller for.
- * @return the controller for the specified player.
- */
- Controller installController(EntityPlayer player);
-
- /**
- * Uninstall a controller from the specified player if it has one.
- *
- * This will disable all active behaviors before disposing the controller.
- *
- * @param player the player to uninstall a nanomachine controller from.
- */
- void uninstallController(EntityPlayer player);
-}
diff --git a/src/api/java/li/cil/oc/api/detail/NetworkAPI.java b/src/api/java/li/cil/oc/api/detail/NetworkAPI.java
deleted file mode 100755
index 967f4f1fd..000000000
--- a/src/api/java/li/cil/oc/api/detail/NetworkAPI.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package li.cil.oc.api.detail;
-
-import li.cil.oc.api.network.Environment;
-import li.cil.oc.api.network.Node;
-import li.cil.oc.api.network.Packet;
-import li.cil.oc.api.network.Visibility;
-import li.cil.oc.api.network.WirelessEndpoint;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-
-public interface NetworkAPI {
- /**
- * Convenience overload for {@link #joinOrCreateNetwork(IBlockAccess, BlockPos)}.
- *
- * If the tile entity implements {@link Environment} its one node will be
- * connected to any existing adjacent tile entity nodes. If none exist a
- * new network with the specified tile entity's node as its sole entry.
- *
- * If the tile entity is a {@link li.cil.oc.api.network.SidedEnvironment}
- * the same rules as for simple environments apply, except that the
- * respective for each side is used when connecting, and each side's node
- * is added to its own new network, if necessary.
- *
- * @param tileEntity the tile entity to initialize.
- */
- void joinOrCreateNetwork(TileEntity tileEntity);
-
- /**
- * Tries to add network node(s) at the specified coordinates to adjacent
- * networks.
- *
- * @param world the world containing the location to connect.
- * @param pos the position at which to update the network.
- */
- void joinOrCreateNetwork(IBlockAccess world, BlockPos pos);
-
- /**
- * Creates a new network with the specified node as its initial node.
- *
- * This can be used to create networks that are not bound to any tile
- * entity. For example, this is used to create the internal networks of
- * robots.
- *
- * @param node the node to create the network for.
- * @throws IllegalArgumentException if the node already is in a network.
- */
- void joinNewNetwork(Node node);
-
- // ----------------------------------------------------------------------- //
-
- /**
- * Makes a wireless endpoint join the wireless network defined by the mod.
- *
- * OpenComputers tracks endpoints to which to send wireless packets sent
- * via the {@link #sendWirelessPacket(WirelessEndpoint, double, Packet)}
- * method. The packets will only be sent to endpoints registered
- * with the network.
- *
- * Important: when your endpoint is removed from the world,
- * you must ensure it is also removed from the network!
- *
- * @param endpoint the endpoint to register with the network.
- */
- void joinWirelessNetwork(WirelessEndpoint endpoint);
-
- /**
- * Updates a wireless endpoint in the wireless network.
- *
- * This is more efficient than removing and then adding the node again, as
- * it only performs the update if the position significantly changed since
- * the last time the position was updated (more than 0.5 along any axis).
- *
- * Calling this for an endpoint that was not added before does nothing.
- *
- * @param endpoint the endpoint for which to update the position.
- */
- void updateWirelessNetwork(WirelessEndpoint endpoint);
-
- /**
- * Removes a wireless endpoint from the wireless network.
- *
- * This must be called when an endpoint becomes invalid, otherwise it will
- * remain in the network!
- *
- * Calling this for an endpoint that was not added before does nothing.
- *
- * @param endpoint the endpoint to remove from the wireless network.
- */
- void leaveWirelessNetwork(WirelessEndpoint endpoint);
-
- /**
- * Removes a wireless endpoint from the wireless network of a specific dimension.
- *
- * This may be useful if the dimension of an endpoint changed and you can only
- * react to that change (e.g. a player changing dimensions).
- *
- * Calling this for an endpoint that was not added before does nothing.
- *
- * @param endpoint the endpoint to remove from the wireless network.
- * @param dimension the dimension with the wireless network to remove the endpoint from.
- */
- void leaveWirelessNetwork(WirelessEndpoint endpoint, int dimension);
-
- /**
- * Sends a packet via the wireless network.
- *
- * This will look for all other registered wireless endpoints in range of
- * the sender and submit the packets to them. Whether another end point is
- * reached depends on the distance and potential obstacles between the
- * sender and the receiver (harder blocks require a stronger signal to be
- * penetrated).
- *
- * @param source the endpoint that is sending the message.
- * @param strength the signal strength with which to send the packet.
- * @param packet the packet to send.
- */
- void sendWirelessPacket(WirelessEndpoint source, double strength, Packet packet);
-
- // ----------------------------------------------------------------------- //
-
- /**
- * Factory function for creating new nodes.
- *
- * Use this to create a node for your environment (e.g. tile entity). This
- * will return a builder that can be used to further specialize the node,
- * making it either a component node (for callbacks), a connector node
- * (for power interaction) or both.
- *
- * Example use:
- *
- *
- * Note that the reachability specified here is the general
- * availability of the created node to other nodes in the network. Special
- * rules apply to components, which have a visibility that is used
- * to control how they can be reached from computers. For example, network
- * cards have a reachability of Visibility.Network, to
- * allow them to communicate with each other, but a visibility of
- * Visibility.Neighbors to avoid other computers in the network
- * to see the card (i.e. only the user programs running on the computer the
- * card installed in can see interact with it).
- *
- * @param host the environment the node is created for.
- * @param reachability the reachability of the node.
- * @return a new node builder.
- */
- Builder.NodeBuilder newNode(Environment host, Visibility reachability);
-
- /**
- * Creates a new network packet as it would be sent or received by a
- * network card.
- *
- * These packets can be forwarded by switches and access points. For wired
- * transmission they must be sent over a node's send method, with the
- * message name being network.message.
- *
- * @param source the address of the sending node.
- * @param destination the address of the destination, or null
- * for a broadcast.
- * @param port the port to send the packet to.
- * @param data the payload of the packet.
- * @return the new packet.
- */
- Packet newPacket(String source, String destination, int port, Object[] data);
-
- /**
- * Re-creates a network packet from a previously stored state.
- *
- * @param nbt the tag to load the packet from.
- * @return the loaded packet.
- */
- Packet newPacket(NBTTagCompound nbt);
-}
\ No newline at end of file
diff --git a/src/api/java/li/cil/oc/api/detail/package-info.java b/src/api/java/li/cil/oc/api/detail/package-info.java
deleted file mode 100755
index d33ae2f40..000000000
--- a/src/api/java/li/cil/oc/api/detail/package-info.java
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * This package contains implementation detail interfaces. You will not have to
- * interact with these interfaces directly (except for the Builder),
- * and you particularly should not implement these interfaces yourself.
- */
-package li.cil.oc.api.detail;
\ No newline at end of file
diff --git a/src/api/java/li/cil/oc/api/driver/Block.java b/src/api/java/li/cil/oc/api/driver/Block.java
deleted file mode 100755
index c30d7d544..000000000
--- a/src/api/java/li/cil/oc/api/driver/Block.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package li.cil.oc.api.driver;
-
-import li.cil.oc.api.network.ManagedEnvironment;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-/**
- * Interface for block component drivers.
- *
- * This driver type is used for components that are blocks, i.e. that can be
- * placed in the world, but cannot be modified to or don't want to have their
- * {@link net.minecraft.tileentity.TileEntity} implement one of the interfaces
- * for environments ({@link li.cil.oc.api.network.Environment} or
- * {@link li.cil.oc.api.network.SidedEnvironment}).
- *
- * A block driver is used by Adapter blocks to check its neighbors and
- * whether those neighbors should be treated as components or not. If a driver
- * is present, it will be used to create a {@link ManagedEnvironment} that is
- * managed by the adapter.
- *
- * Note that it is possible to write one driver that supports as many different
- * blocks as you wish. I'd recommend writing one per device (type), though, to
- * keep things modular.
- *
- * @deprecated Use {@link SidedBlock} instead, ignoring the side argument if
- * the side doesn't matter.
- */
-@Deprecated // TODO Remove in OC 1.7
-public interface Block {
- /**
- * Used to determine the block types this driver handles.
- *
- * This is used to determine which driver to use for a block placed next to
- * an Adapter block. Note that the return value should not change
- * over time; if it does, though, an already installed component will not
- * be removed, since this value is only checked when scanning blocks. You
- * can force this by sending a neighbor block change notification.
- *
- * @param world the world in which the block to check lives.
- * @param pos the position coordinate of the block to check.
- * @return true if the block is supported; false otherwise.
- */
- boolean worksWith(World world, BlockPos pos);
-
- /**
- * Create a new managed environment interfacing the specified block.
- *
- * This is used to connect the component to the component network when it
- * is detected next to an Adapter. Components that are not part of
- * the component network probably don't make much sense (can't think of any
- * uses at this time), but you may still opt to not implement this - i.e.
- * it is safe to return null here.
- *
- * This is expected to return a new instance each time it is
- * called. The created instance's life cycle is managed by the
- * Adapter block that caused its creation.
- *
- * @param world the world containing the block to get the environment for.
- * @param pos the position of the block to get the environment for.
- * @return the environment for the block at that location.
- */
- ManagedEnvironment createEnvironment(World world, BlockPos pos);
-}
\ No newline at end of file
diff --git a/src/api/java/li/cil/oc/api/driver/Converter.java b/src/api/java/li/cil/oc/api/driver/Converter.java
deleted file mode 100755
index 8eccc321c..000000000
--- a/src/api/java/li/cil/oc/api/driver/Converter.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package li.cil.oc.api.driver;
-
-import java.util.Map;
-
-/**
- * A converter is a callback that can be used to transparently convert Java
- * types to something that can be pushed to a machine's architecture.
- *
- * Note that converters operating on the same object type may override each
- * other when using the same keys in the resulting Map. The order in
- * which converters are called depends on the order they were registered in.
- */
-public interface Converter {
- /**
- * Converts a type to a Map.
- *
- * The keys and values in the resulting map will be converted in turn.
- * If after those conversions the map still contains unsupported values,
- * they will not be retained.
- *
- * The conversion result should be placed into the the passed map, i.e. the
- * map will represent the original object. For example, if the value had a
- * field name, add a key name to the map with the value
- * of that field.
- *
- * @param value the value to convert.
- * @param output the map conversion results are accumulated into.
- */
- void convert(Object value, Map