public interface Casing
This is implemented by the tile entity of TIS-3D casings.
| Modifier and Type | Method and Description |
|---|---|
net.minecraft.world.World |
getCasingWorld()
The world this casing resides in.
|
Module |
getModule(Face face)
Get the module installed on the specified face of the casing.
|
net.minecraft.util.math.BlockPos |
getPosition()
The position of the casing in the world it exists in.
|
Pipe |
getReceivingPipe(Face face,
Port port)
Get the receiving pipe on the specified port of a module in this casing.
|
Pipe |
getSendingPipe(Face face,
Port port)
Get the sending pipe on the specified port of a module in this casing.
|
boolean |
isLocked()
Get whether the casing is locked.
|
void |
markDirty()
Flag the casing as dirty so it is saved when the chunk containing it
saved next.
|
void |
sendData(Face face,
io.netty.buffer.ByteBuf data)
Call this to send some data from a module to it's other representation.
|
void |
sendData(Face face,
io.netty.buffer.ByteBuf data,
byte type)
Call this to send some data from a module to it's other representation.
|
void |
sendData(Face face,
net.minecraft.nbt.NBTTagCompound data)
Call this to send some data from a module to it's other representation.
|
void |
sendData(Face face,
net.minecraft.nbt.NBTTagCompound data,
byte type)
Call this to send some data from a module to it's other representation.
|
@Nullable net.minecraft.world.World getCasingWorld()
net.minecraft.util.math.BlockPos getPosition()
void markDirty()
boolean isLocked()
Casings can be locked, preventing players to remove modules from the
casing or add modules to the casing. Some modules may choose to also
ignore Module.onActivate(EntityPlayer, EnumHand, ItemStack, float, float, float)
calls while their casing is locks (such as the execution module to
prevent reprogramming).
@Nullable Module getModule(Face face)
face - the face to get the module for.Pipe getReceivingPipe(Face face, Port port)
There are two Pipes between every pair of Modules
in a case. Specifically, each edge of a Casing has two
Pipes, going into opposite directions. This method is used
to to get a Pipe based on its sink.
face - the face to get the port for.port - the port for which to get the port.Pipe getSendingPipe(Face face, Port port)
There are two Pipes between every pair of Modules
in a case. Specifically, each edge of a Casing has two
Pipes, going into opposite directions. This method is used
to to get a Pipe based on its source.
face - the face to get the port for.port - the port for which to get the port.void sendData(Face face, net.minecraft.nbt.NBTTagCompound data, byte type)
That is, when called from the client, it will send the data to the instance representing the module on the specified face on the server, when called on the server it will send the data to the client.
Data is collected each tick, and sent in one big packet. If more than one send request is performed in one tick with the same type, the data will replace the previously queued data. A negative value indicates that no specific type is set and data should not be replaced in the send queue.
Note that this is a convenience alternative for sendData(Face, ByteBuf, byte)
that is meant to be used for non-frequent data, i.e. data
that's only sent every so often. For data you expect may be sent
each tick, prefer using the more light-weight ByteBuf.
face - the face the module is installed in.data - the data to send to the client.type - the type of the data being sent.void sendData(Face face, net.minecraft.nbt.NBTTagCompound data)
This behaves like sendData(Face, ByteBuf, byte), except
with no specific type associated, so new data will never replace old
data. Where at all possible, providing a type is strongly recommended,
to reduce generated network traffic.
Note that this is a convenience alternative for sendData(Face, ByteBuf)
that is meant to be used for non-frequent data, i.e. data
that's only sent every so often. For data you expect may be sent
each tick, prefer using the more light-weight ByteBuf.
face - the face the module is installed in.data - the data to send to the client.void sendData(Face face, io.netty.buffer.ByteBuf data, byte type)
That is, when called from the client, it will send the data to the instance representing the module on the specified face on the server, when called on the server it will send the data to the client.
Data is collected each tick, and sent in one big packet. If more than one send request is performed in one tick with the same type, the data will replace the previously queued data. A negative value indicates that no specific type is set and data should not be replaced in the send queue.
face - the face the module is installed in.data - the data to send to the client.type - the type of the data being sent.void sendData(Face face, io.netty.buffer.ByteBuf data)
This behaves like sendData(Face, ByteBuf, byte), except
with no specific type associated, so new data will never replace old
data. Where at all possible, providing a type is strongly recommended,
to reduce generated network traffic.
face - the face the module is installed in.data - the data to send to the client.