public interface DriverAPI
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
SidedBlock |
driverFor(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.EnumFacing 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.
|
java.util.Collection<Item> |
itemDrivers()
Get a list of all registered item drivers.
|
net.minecraftforge.items.IItemHandler |
itemHandlerFor(net.minecraft.item.ItemStack stack,
net.minecraft.entity.player.EntityPlayer player)
Get an IItemHandler implementation providing access to an item inventory.
|
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.@Nullable SidedBlock driverFor(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.util.EnumFacing side)
add(li.cil.oc.api.driver.SidedBlock).world - the world containing the block.pos - the position of the block.side - the side of the block.@Nullable 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.@Nullable 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.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.java.util.Set<java.lang.Class<?>> environmentsFor(net.minecraft.item.ItemStack stack)
EnvironmentProviders 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.minecraftforge.items.IItemHandler itemHandlerFor(net.minecraft.item.ItemStack stack,
net.minecraft.entity.player.EntityPlayer player)
InventoryProviders to find an
IItemHandler 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<Item> itemDrivers()