public interface InfraredPacket
Implement the InfraredReceiver interface to interact with these.
| Modifier and Type | Method and Description |
|---|---|
net.minecraft.util.Vec3 |
getPacketDirection()
Get the normalized direction the packet is currently heading.
|
net.minecraft.util.Vec3 |
getPacketPosition()
Get the current position of the packet.
|
short |
getPacketValue()
Get the value carried by this packet.
|
void |
redirectPacket(net.minecraft.util.Vec3 position,
net.minecraft.util.Vec3 direction,
int addedLifetime)
Instead of consuming the packet, this can be used to redirect the
packet into a new direction.
|
short getPacketValue()
net.minecraft.util.Vec3 getPacketPosition()
net.minecraft.util.Vec3 getPacketDirection()
void redirectPacket(net.minecraft.util.Vec3 position,
net.minecraft.util.Vec3 direction,
int addedLifetime)
When changing the direction of a packet, you may want to set the new
position to the hit position (passed to InfraredReceiver.onInfraredPacket(InfraredPacket, MovingObjectPosition)).
Any changes to the position will be taken into account automatically,
so that packets do not travel further due to this than they otherwise
would. Note that you cannot move a packet further than it would travel
in one tick anyway (4 blocks).
position - the new current position of the packet.direction - the new direction the packet should be heading.addedLifetime - how many ticks to add to the packet's lifetime.