public interface InfraredPacket
Use the InfraredReceiver interface to interact with these.
| Modifier and Type | Method and Description |
|---|---|
net.minecraft.util.math.Vec3d |
getPacketDirection()
Get the normalized direction the packet is currently heading.
|
net.minecraft.util.math.Vec3d |
getPacketPosition()
Get the current position of the packet.
|
short |
getPacketValue()
Get the value carried by this packet.
|
void |
redirectPacket(net.minecraft.util.math.Vec3d position,
net.minecraft.util.math.Vec3d 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.math.Vec3d getPacketPosition()
net.minecraft.util.math.Vec3d getPacketDirection()
void redirectPacket(net.minecraft.util.math.Vec3d position,
net.minecraft.util.math.Vec3d 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, RayTraceResult)).
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.