public final class PipeFlowItems extends PipeFlow implements IFlowItems
Modifier and Type | Field and Description |
---|---|
static int |
NET_CREATE_ITEM |
NET_ID_FULL_STATE, NET_ID_UPDATE, pipe
Constructor and Description |
---|
PipeFlowItems(IPipe pipe) |
PipeFlowItems(IPipe pipe,
net.minecraft.nbt.NBTTagCompound nbt) |
Modifier and Type | Method and Description |
---|---|
void |
addDrops(net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> toDrop,
int fortune) |
boolean |
canConnect(net.minecraft.util.EnumFacing face,
PipeFlow other) |
boolean |
canConnect(net.minecraft.util.EnumFacing face,
net.minecraft.tileentity.TileEntity oTile) |
boolean |
canInjectItems(net.minecraft.util.EnumFacing from)
Tests to see if this pipe can accept items from the given direction.
|
java.util.List<TravellingItem> |
getAllItemsForRender() |
<T> T |
getCapability(net.minecraftforge.common.capabilities.Capability<T> capability,
net.minecraft.util.EnumFacing facing) |
net.minecraft.item.ItemStack |
injectItem(net.minecraft.item.ItemStack stack,
boolean doAdd,
net.minecraft.util.EnumFacing from,
net.minecraft.item.EnumDyeColor colour,
double speed)
Offers an ItemStack for addition to the pipe.
|
void |
insertItemsForce(net.minecraft.item.ItemStack stack,
net.minecraft.util.EnumFacing from,
net.minecraft.item.EnumDyeColor colour,
double speed)
Inserts an item directly into the centre of this pipe, going in the given direction.
|
void |
onTick() |
void |
readPayload(int id,
net.minecraft.network.PacketBuffer bufIn,
net.minecraftforge.fml.relauncher.Side msgSide)
Reads a payload with the specified id.
|
void |
sendPhantomItem(net.minecraft.item.ItemStack stack,
net.minecraft.util.EnumFacing from,
net.minecraft.util.EnumFacing to,
net.minecraft.item.EnumDyeColor colour)
Sends a phantom (fake) item from the given facing, to the other facing.
|
int |
tryExtractItems(int count,
net.minecraft.util.EnumFacing from,
net.minecraft.item.EnumDyeColor colour,
IStackFilter filter,
boolean simulate)
Attempts to extract items from the inventory connected to this pipe on the given side.
|
net.minecraft.nbt.NBTTagCompound |
writeToNbt() |
hasCapability, onFlowActivate, sendCustomPayload, sendPayload, writePayload
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
tryExtractItems
public static final int NET_CREATE_ITEM
public PipeFlowItems(IPipe pipe)
public PipeFlowItems(IPipe pipe, net.minecraft.nbt.NBTTagCompound nbt)
public net.minecraft.nbt.NBTTagCompound writeToNbt()
writeToNbt
in class PipeFlow
public void readPayload(int id, net.minecraft.network.PacketBuffer bufIn, net.minecraftforge.fml.relauncher.Side msgSide) throws java.io.IOException
PipeFlow
readPayload
in class PipeFlow
java.io.IOException
public void addDrops(net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> toDrop, int fortune)
public int tryExtractItems(int count, net.minecraft.util.EnumFacing from, net.minecraft.item.EnumDyeColor colour, IStackFilter filter, boolean simulate)
IFlowItems
tryExtractItems
in interface IFlowItems
count
- The maximum number of items to extractfrom
- The direction to extract from.colour
- The colour that extracted items should be painted.filter
- The filter to determine what can be extracted.simulate
- If true then only simulate the extraction.public void sendPhantomItem(net.minecraft.item.ItemStack stack, net.minecraft.util.EnumFacing from, net.minecraft.util.EnumFacing to, net.minecraft.item.EnumDyeColor colour)
IFlowItems
sendPhantomItem
in interface IFlowItems
public <T> T getCapability(@Nonnull net.minecraftforge.common.capabilities.Capability<T> capability, net.minecraft.util.EnumFacing facing)
getCapability
in interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
in class PipeFlow
public boolean canConnect(net.minecraft.util.EnumFacing face, PipeFlow other)
canConnect
in class PipeFlow
public boolean canConnect(net.minecraft.util.EnumFacing face, net.minecraft.tileentity.TileEntity oTile)
canConnect
in class PipeFlow
public boolean canInjectItems(net.minecraft.util.EnumFacing from)
IInjectable
IInjectable.injectItem(ItemStack, boolean, EnumFacing, EnumDyeColor, double)
straight after.canInjectItems
in interface IInjectable
@Nonnull public net.minecraft.item.ItemStack injectItem(@Nonnull net.minecraft.item.ItemStack stack, boolean doAdd, net.minecraft.util.EnumFacing from, net.minecraft.item.EnumDyeColor colour, double speed)
IInjectable
injectItem
in interface IInjectable
stack
- ItemStack offered for addition. Do not manipulate this!doAdd
- If false no actual addition should take place. Implementors should simulate.from
- Orientation the ItemStack is offered from.colour
- The color of the item to be added to the pipe, or null for no color.speed
- The speed of the item to be added (in blocks per tick) or <=0
if a default should be used.public void insertItemsForce(@Nonnull net.minecraft.item.ItemStack stack, net.minecraft.util.EnumFacing from, net.minecraft.item.EnumDyeColor colour, double speed)
IFlowItems
PipeBehaviour
, as otherwise it can lead to problems. (For example crashing if a pipe
contains an item that the pipe behaviour doesn't expect).insertItemsForce
in interface IFlowItems
stack
- ItemStack offered for addition. Do not manipulate this!from
- Orientation the ItemStack should pretend to be coming from.colour
- The colour of the item to be added to the pipe, or null for no colour.speed
- The speed of the item to be added (in blocks per tick) or <=0
if a default should be
used.public java.util.List<TravellingItem> getAllItemsForRender()