Teleporter

The Teleporter is a travel-aiding device sold by the Steampunker, which can be used to create safe ways into an hermetically closed base and to quickly and safely travel to distant locations. Teleporting is always instant, and has neither load time nor cooldown.

In order to function, pair of teleporters must be connected by a line of Wire, which must also contain at least one trigger Mechanism.

Like most mechanisms, the travel range is limited by the maximum length of a wire line, which is approximately 4,000 feet (2,000 blocks): to travel from one end of the map to the other, several teleportations will be required, though with precise pressure plate placing they could be stacked in one continous jump. A large map is 2,400 tiles tall, so the range may not quite be enough to jump from the underworld to a Floating Island.

A single unbroken line of wire will only activate two teleporter pads at a time, and the others will not function; see the section below for more details. However, through the use of differently-coloured wire a single Teleporter can lead to up to six different places within its range. When making the connections, wires can touch any of the three blocks that compose the device: while the use of a single-coloured wire forces players to use the left and right "nodes" to connect to two different places, single-target Teleporters or those using multiple colours of wire can be connected at the middle block as well, and the only thing determining the actual direction of travel is the wire line.

Teleporting is always two-way: when a connection is activated, both ends will exchange all players, NPCs, and hostile mobs, that at least partially occupying any square of 3x3 space above teleporter pads (that relative occupation will be preserved upon teleportation). Because of this, players should take security measures to ensure they will not be letting hostiles inside their base when teleporting outside, and that universal pressure plates are not used to trigger Teleporters if hostile mobs or NPCs are liable to step on them.

Teleporters are solid blocks: they cannot be traversed through like Wood Platforms, furniture can be placed on top of them (including Pressure Plates for less trigger clicking). This also means that a passage containing a Teleporter must either be at least four blocks tall, use the Teleporter itself as the floor, or Teleporter blocks should be de-actuated (which mean that nothing could be placed on them anymore). However, Teleporters can't be floating in mid-air: they must be placed on top of other solid blocks or platforms.

The three blocks composing the teleporter can, like other solid blocks, be shaped using a Hammer. This doesn't affect the teleporter's function, except that the 3x3 space to be teleported and the position of the teleported entity are both relative to the teleporter's surface; if the teleporter is flattened to half blocks, they will both move down half a block (if the three blocks are different shapes, the height is determined by the first block encountered in the algorithm below). Note that pressure plates can only be placed on full blocks.

Multiple pads on a single network
When a wire network is activated with more than two teleports, the following algorithm determines which pair will activate.
 * Start at the trigger mechanism which caused the wire to activate.
 * Explore the network one square at a time, moving to an adjacent unexplored wire if one is available, backtracking otherwise (in other words, perform a depth first search).
 * When there is a choice of adjacent wires to explore, move left as the first choice, then right, then up, then down.
 * Keep track of the order in which the teleporters on the network are first encountered (in other words, order them by preorder).
 * The first and last teleporter in this order will activate, and the rest will do nothing.

This algorithm is deterministic, so a fixed wiring layout will always activate the same teleporters. The wiring layout can be chosen to target the desired teleporter. In the example below, each pressure plate connects the teleporter below it to the top teleporter.