Package dan200.computercraft.api.network
Interface PacketNetwork
- All Known Subinterfaces:
WiredNode
public interface PacketNetwork
A packet network represents a collection of devices which can send and receive packets.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addReceiver
(PacketReceiver receiver) Add a receiver to the network.boolean
Determine whether this network is wireless.void
removeReceiver
(PacketReceiver receiver) Remove a receiver from the network.void
transmitInterdimensional
(Packet packet) Submit a packet for transmitting across the network.void
transmitSameDimension
(Packet packet, double range) Submit a packet for transmitting across the network.
-
Method Details
-
addReceiver
Add a receiver to the network.- Parameters:
receiver
- The receiver to register to the network.
-
removeReceiver
Remove a receiver from the network.- Parameters:
receiver
- The device to remove from the network.
-
isWireless
boolean isWireless()Determine whether this network is wireless.- Returns:
- Whether this network is wireless.
-
transmitSameDimension
Submit a packet for transmitting across the network. This will route the packet through the network, sending it to all receivers within range (or any interdimensional ones).- Parameters:
packet
- The packet to send.range
- The maximum distance this packet will be sent.- See Also:
-
transmitInterdimensional
Submit a packet for transmitting across the network. This will route the packet through the network, sending it to all receivers across all dimensions.- Parameters:
packet
- The packet to send.- See Also:
-