RndTp mod

**rndtp (RaNDom TelePort)** is a **Minecraft Forge 1.7.10 server-side mod** that you can use for randomly teleporting players into specific areas.

It's designed for server operators to be used in server signs / pressure plates / command blocks in a server spawn in order to spread players on their chosen faction territory.

It contains 3 commands :

* **pretp (PrecisionTeleport)** is a mvtp (Multiverse-Core) / mwtp (ForgeEssentials) like command that can teleport a player at a specific location in a chosen dimension. It automatically aborts if the teleportation is unsafe.
* **rndtp (RandomTeleport)** will teleport a player at a random location within the rectangle defined by 2 sets of (block/chunk/region) X/Z coordinates. It will automatically adjust the Y coordinate to a safe above ground location
* **geotp (GeographicalTeleport)**, the most interesting one, will teleport a player at a random location chosen in a list of (block/chunk/region/custom) sets of X/Z coordinates stored in directories/files. Again it will automatically adjust the Y coordinate to a safe place (more on this later).

While not specifically dedicated to the **Lord of the Rings mod (LOTRmod)**, this mod has a companion set of directories/files enabling you to **teleport a player from the Overworld to the Middle-Earth dimension in predefined areas such as specific LOTR mod biomes / factions territories / waypoints / places of interest** / etc. **Or to the Utumno dimension at a chosen level/layer**.

Furthermore, you can choose to teleport the player above or underground (for races like dwarves...), in bottom up or top down direction (the latest being useful for teleporting into the Nether or Utumno dimensions).

Unsafe blocks from other mods can be specified in the config file, and directories/files sets for other fixed map mods can be produced...

The documentation below outlines available functions:

## Installation

Just grab the **current jar** file for the mod and drop it in your server's "mods" folder.

Then restart your server.

## Main configuration

On the first run the mod will automatically create its configuration directory and default config file in "config/rndtp/rndtp.cfg" with the following content:

```
# Configuration file

general {
    # Values: 0 = None, 1 = Normal, 2+ = Verbose
    S:DebugLevel=0

    # Values: 3 to 10 should be good
    S:MaxTeleportAttempts=5

    # List of non vanilla unsafe blocks to stand upon
    S:UnsafeBlocks <
        lotr:tile.coralReef
        lotr:tile.hearth
        lotr:tile.marshLights
        lotr:tile.mobSpawner
        lotr:tile.morgulFlower
        lotr:tile.mordorThorn
        lotr:tile.quagmire
        lotr:tile.rhunFire
        lotr:tile.rhunFireJar
        lotr:tile.stalactite
        lotr:tile.stalactiteIce
        lotr:tile.stalactiteObsidian
        lotr:tile.termiteMound:0
        lotr:tile.webUngoliant
     >
}

```

The MaxTeleportAttempts setting defines how many tentatives the mod will attempt to teleport a player to a safe place (it generates chunks on the intended destinations on the fly...). It it doesn't succeed the player will stay where he is and hear a MilleniumFalcon-failed-hyperspace-jump sound (kind of)...

As you can see, the mod comes with ready-to-use configuration for v34.3 of the LOTR mod (listing all unsafe blocks to place a player upon). If you use more recent (future) versions of the LOTR mod, just add new dangerous blocks to your local config.

You can add other blocks from the LOTR mod or other mods in that configuration file...

Notice the ability to specify data values to check against (ex: lotr:tile.termiteMound**:0** for the infested variant).

Then if you intend to use it with the LOTRmod, you should grab the **Companion pack of configuration files** for the mod version you use, plus the **GenStructures Companion pack** if you use builds from that project.

Then restart your server.

## Permissions

The mod's commands are only available to players of Operator level.

You can however use some kind of permission management system (I use the excellent PermissionsEx plugin) to grant the permission nodes to selected players. The available nodes are:

```
org.tournier.rndtp.PretpCommand
org.tournier.rndtp.RndtpCommand
org.tournier.rndtp.GeotpCommand

```

As mentioned above, this mod is meant to be used in a server spawn though some kind of operator setup device (I use server signs from the excellent ServerSigns plugin), so you shouldn't need to use the permission nodes at all.

## Usage & examples

### Operator accessible commands

#### Usage

```
/pretp [Player] DimensionID X Y Z
/rndtp [Player] DimensionID CoordinatesType X1 Z1 X2 Z2
/geotp [Player] Directory:File [VerticalPosition]

```
The mod comes with full TAB completion for the Player, DimensionID, CoordinatesType, Directory:File and VerticalPosition parameters. A must in interactive use!

#### Arguments explanation

 DimensionID
 X Y Z
 CoordinatesType
 X1 Z1 X2 Z2
 Directory:File
 [VerticalPosition]

#### Examples

```
/pretp HubTou 100 -5601 77 1045
  => a precise teleportation somewhere in The Shire

/rndtp HubTou 0 Region -2 -2 2 2
  => a random teleportation in the Overworld in a 5x5 region files area centered around the spawn point

/geotp HubTou lotr-biomes:MistyMountains Underground
  => a random teleportation underground in the Misty Mountains to mine Mithril

/geotp HubTou lotr-waypoints:Hobbiton
  => a random teleportation in a 128x128 area around the Hobbiton waypoint in The Shire for a party with some friends

/geotp HubTou harda2-factions:Mordor-Nurn
  => a random teleportation in my chosen faction territory

/geotp HubTou lotr-utumno-1:IceLevel 228-231
  => a random (within the blocks defined) teleportation in the first layer of the Utumno Ice level

/geotp HubTou lotr-Utumno-3:FireLevel TopDown
  => a random teleportation to the Utumno Fire level starting from the upper ones

/geotp HubTou lotr-biomes:Ocean UnderGround
  => a random teleportation in a cave under The Sea (may be you want to be a sunken Numenorean?)

/geotp HubTou genstructures:Gondor-MinasTirith
  => a random teleportation around the Minas Tirith build

```

## Specific configuration

In each Directory you can use a specific configuration file to explain the kind of coordinates contained in the Files.

* Example for the predefined lotr-biomes directory (which uses special X and Z offsets to find the blocks X/Z coordinates):

```
# Configuration file

general {
    # Width in blocks of a coordinate unit
    S:BlocksWidth=128

    # Type of coordinates (Block, Chunk, Region, LotrMapPixel, Custom)
    S:CoordinatesType=LotrMapPixel

    # Dimension ID
    S:Dimension=100

    # Is there a X offset compared to Minecraft coordinates (0 = no)
    S:XOffset=-809.5

    # Is there a Z offset compared to Minecraft coordinates (0 = no)
    S:ZOffset=-729.5

    # Is there a Y minimum altitude?
    S:YMin=0

    # Is there a Y maximum altitude?
    S:YMax=255
}

```

* Example for the predefined lotr-utumno-2 directory for the Utumno's Obsidian level (which is located in the dimension 101, between the 92-179 Y coordinates):

```
# Configuration file

general {
    # Width in blocks of a coordinate unit
    S:BlocksWidth=512

    # Type of coordinates (Block, Chunk, Region, LotrMapPixel, Custom)
    S:CoordinatesType=Region

    # Dimension ID
    S:Dimension=101

    # Is there a X offset compared to Minecraft coordinates (0 = no)
    S:XOffset=0

    # Is there a Z offset compared to Minecraft coordinates (0 = no)
    S:ZOffset=0

    # Is there a Y minimum altitude?
    S:YMin=92

    # Is there a Y maximum altitude?
    S:YMax=179
}

```

Please note that the BlocksWidth is only useful if you use the Custom CoordinatesType setting. The Block / Chunk / Region / LotrMapPixel settings indicate 1 / 16 / 512 / 128 BlocksWidth values...

## LOTR mod companion pack

As separate optional downloads, we provide companion packs containing:

* as of v1.0 for LOTRmod v35.3:
	+ 274 LOTR waypoints in lotr-waypoints or lotr-waypoints-by-region directories
	+ 165 LOTR biomes in lotr-biomes directory (as ocean and rivers are separate biomes, you won't risk accidentally dropping your players in water...)
	+ 6 LOTR special places (such as the Mordor Cherry Tree) in lotr-special-places directory
	+ 3 LOTR Utumno levels in lotr-utumno-[1-3] directories
	+ 51 faction territories in harda2-factions directory (including the upcoming Avari elves, Red Mountain Dwarves, Cerinrim, Limwaith, Lossoth, etc.)

* as of General Structures May 11 2019:
	+ 121 major builds

And of course you can build your own ones using the coordinates that will be the more convenient to you...

## Limits and known bugs

1. If you make a TopDown or AboveGround teleportation in an already generated chunk, you might end up on top of a tree (doesn't happen in ungenerated chunks as trees are generated later)
2. If you make a UnderGround or BottomUp teleportation, you risk getting some falling blocks (gravel, sand, etc.) or fluids (water, lava) on your head. Be sure to react quickly if you hear the sound of these events...
3. In some rare cases of AboveGround teleportation, you could end up under ground if the LOTR mod decides to build a structure just above you...

## Download and contribution

The mod binary Jar file is available for download on CurseForge.

Its Companion pack for LOTRmod v35.3 and General Structures v20190511 are available for download from our web site.

This mod's source code is available on GitHub for download or community improvement. Create a *new branch* with your edits and ask for a *pull request* to merge them in the *master branch* (check this tutorial to understand GitHub concepts).