public final class Driver
extends java.lang.Object
Environment - no driver is
needed in that case.
Note that these methods should not be called in the pre-init phase,
since the API.driver may not have been initialized
at that time. Only start calling these methods in the init phase or later.| Modifier and Type | Method and Description |
|---|---|
static void |
add(Block driver)
Registers a new block driver.
|
static void |
add(Converter converter)
Registers a new type converter.
|
static void |
add(Item driver)
Registers a new item driver.
|
static java.util.Collection<Block> |
blockDrivers()
Get a list of all registered block drivers.
|
static Item |
driverFor(net.minecraft.item.ItemStack stack)
Looks up a driver for the specified item stack.
|
static Item |
driverFor(net.minecraft.item.ItemStack stack,
java.lang.Class<? extends EnvironmentHost> host)
Looks up a driver for the specified item stack.
|
static Block |
driverFor(net.minecraft.world.World world,
net.minecraft.util.BlockPos pos)
Looks up a driver for the block at the specified position in the
specified world.
|
static java.util.Collection<Item> |
itemDrivers()
Get a list of all registered item drivers.
|
public static void add(Block driver)
driver - the driver to register.public static void add(Item driver)
driver - the driver to register.public static void add(Converter converter)
converter - the converter to register.public static Block driverFor(net.minecraft.world.World world, net.minecraft.util.BlockPos pos)
add(li.cil.oc.api.driver.Block).world - the world containing the block.pos - the position of the block.public static 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.public static Item driverFor(net.minecraft.item.ItemStack stack)
stack - the item stack to get a driver for.public static java.util.Collection<Block> blockDrivers()
EnvironmentAware interface.
The returned collection is read-only.public static java.util.Collection<Item> itemDrivers()
EnvironmentAware interface.
The returned collection is read-only.