public interface DriverAPI
Modifier and Type | Method and Description |
---|---|
void |
add(Block driver)
Deprecated.
Use
SidedBlock instead. |
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.
|
void |
add(SidedBlock driver)
Registers a new side-aware block driver.
|
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)
Deprecated.
Use
driverFor(World, int, int, int, ForgeDirection) ,
passing UNKNOWN if the side is to be ignored. |
SidedBlock |
driverFor(net.minecraft.world.World world,
int x,
int y,
int z,
net.minecraftforge.common.util.ForgeDirection side)
Looks up a driver for the block at the specified position in the
specified world.
|
java.lang.Class<?> |
environmentFor(net.minecraft.item.ItemStack stack)
Deprecated.
Use
environmentsFor(ItemStack) instead. |
java.util.Set<java.lang.Class<?>> |
environmentsFor(net.minecraft.item.ItemStack stack)
Looks up the environments 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.
|
@Deprecated void add(Block driver)
SidedBlock
instead.driver
- the driver for a block component.void add(SidedBlock driver)
driver
- the driver to register.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.@Deprecated Block driverFor(net.minecraft.world.World world, int x, int y, int z)
driverFor(World, int, int, int, ForgeDirection)
,
passing UNKNOWN if the side is to be ignored.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.SidedBlock driverFor(net.minecraft.world.World world, int x, int y, int z, net.minecraftforge.common.util.ForgeDirection side)
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.side
- the side 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.@Deprecated java.lang.Class<?> environmentFor(net.minecraft.item.ItemStack stack)
environmentsFor(ItemStack)
instead.EnvironmentProvider
s 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.java.util.Set<java.lang.Class<?>> environmentsFor(net.minecraft.item.ItemStack stack)
EnvironmentProvider
s to find
environment types for the specified item stack. If none can be
found, returns an empty Set.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)
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.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()