public interface DriverAPI
| Modifier and Type | Method and Description |
|---|---|
void |
add(Block driver)
Registers a new driver for a block component.
|
void |
add(Converter converter)
Registers a new type converter.
|
void |
add(EnvironmentProvider provider)
Register a new environment provider.
|
void |
add(InventoryProvider provider)
Register a new inventory provider.
|
void |
add(Item driver)
Registers a new driver for an item component.
|
java.util.Collection<Block> |
blockDrivers()
Get a list of all registered block drivers.
|
Item |
driverFor(net.minecraft.item.ItemStack stack)
Looks up a driver for the specified item stack.
|
Item |
driverFor(net.minecraft.item.ItemStack stack,
java.lang.Class<? extends EnvironmentHost> host)
Looks up a driver for the specified item stack.
|
Block |
driverFor(net.minecraft.world.World world,
int x,
int y,
int z)
Looks up a driver for the block at the specified position in the
specified world.
|
java.lang.Class<?> |
environmentFor(net.minecraft.item.ItemStack stack)
Looks up the environment associated with the specified item stack.
|
net.minecraft.inventory.IInventory |
inventoryFor(net.minecraft.item.ItemStack stack,
net.minecraft.entity.player.EntityPlayer player)
Get an inventory implementation providing access to an item inventory.
|
java.util.Collection<Item> |
itemDrivers()
Get a list of all registered item drivers.
|
void add(Block driver)
driver - the driver for a block component.void add(Item driver)
driver - the driver for an item component.void add(Converter converter)
converter - the converter to register.void add(EnvironmentProvider provider)
provider - the provider to register.void add(InventoryProvider provider)
provider - the provider to register.Block driverFor(net.minecraft.world.World world, int x, int y, int z)
add(li.cil.oc.api.driver.Block).world - the world containing the block.x - the X coordinate of the block.y - the Y coordinate of the block.z - the Z coordinate of the block.Item driverFor(net.minecraft.item.ItemStack stack, java.lang.Class<? extends EnvironmentHost> host)
stack - the item stack to get a driver for.host - the type that will host the environment created by returned driver.Item driverFor(net.minecraft.item.ItemStack stack)
stack - the item stack to get a driver for.java.lang.Class<?> environmentFor(net.minecraft.item.ItemStack stack)
EnvironmentProviders to find
an environment type for the specified item stack. If none can be
found, returns null.stack - the item stack to get the environment type for.net.minecraft.inventory.IInventory inventoryFor(net.minecraft.item.ItemStack stack,
net.minecraft.entity.player.EntityPlayer player)
InventoryProviders 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.stack - the item stack to get the inventory access for.player - the player holding the item. May be null.java.util.Collection<Block> blockDrivers()
java.util.Collection<Item> itemDrivers()