| Constructor and Description |
|---|
PipeImpl(PipeHost host,
Face receivingFace,
Face sendingFace,
Port sendingPort) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginRead()
Begin a reading operation on the pipe.
|
void |
beginWrite(short value)
Begin a writing operation on the pipe.
|
void |
cancelRead()
Cancel an active read operation.
|
void |
cancelWrite()
Cancel an active write operation.
|
boolean |
canTransfer()
Whether the pipe can transfer data, i.e.
|
boolean |
isReading()
Whether the pipe is currently being read from.
|
boolean |
isWriting()
Whether the pipe is currently being written to.
|
short |
read()
Finish a read operation by fetching the data that is written by the
write operation running at the same time.
|
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound nbt) |
void |
step()
|
java.lang.String |
toString() |
void |
writeToNBT(net.minecraft.nbt.NBTTagCompound nbt) |
public void step()
public void readFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
public void writeToNBT(net.minecraft.nbt.NBTTagCompound nbt)
public void beginWrite(short value)
Pipe
Make sure not to call this if the pipe is already being written to, or
an exception will be thrown. Use Pipe.isWriting() to check for this.
beginWrite in interface Pipevalue - the value to write to the pipe.public void cancelWrite()
PipeIf the pipe is not currently being written to this does nothing.
cancelWrite in interface Pipepublic boolean isWriting()
Pipe
This is true as soon as Pipe.beginWrite(short) was called and
until Pipe.read() or Pipe.cancelWrite() was called to finish or
cancel the operation.
public void beginRead()
Pipe
Make sure not to call this if the pipe is already being read from, or
an exception will be thrown. Use Pipe.isReading() to check for this.
public void cancelRead()
PipeIf the pipe is not currently being read from this does nothing.
cancelRead in interface Pipepublic boolean isReading()
Pipe
This is true as soon as Pipe.beginRead() was called and
until Pipe.read() or Pipe.cancelRead() was called to finish or
cancel the operation.
public boolean canTransfer()
PipePipe.read() can be called.
Note that this is not equivalent to Pipe.isReading() &&
Pipe.isWriting(). This is only true in the first update
after that has been true and later.
canTransfer in interface Pipepublic short read()
Pipe
Make sure not to call this if the pipe is not in the correct state, or
an exception will be thrown. use Pipe.canTransfer() to check for this.
This will cause Module.onWriteComplete(Port) to be called on the
module currently writing to the pipe, then reset the pipe (i.e. call
Pipe.cancelRead() and Pipe.cancelWrite()) prior to returning the
read value.
public java.lang.String toString()
toString in class java.lang.Object