diff --git a/README.md b/README.md index f3904d1..99816b7 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Permission: `randomteleport.use` Usage | Description --------------------------------------------|------------------------------- `/rtp` | uses the default preset -`/rtp []` | uses a specific preset +`/rtp []` | uses a specific or random preset `/rtp []` | `minRange` - minimum distance to the center point (square shaped)
`maxRange` - maximum distance to the center point (square shaped) `/rtp --stat` | shows a statistic of the teleports since the last restart `/rtp --reload` | reloads the config diff --git a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleportCommand.java b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleportCommand.java index 9586cfd..a3f58c7 100644 --- a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleportCommand.java +++ b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleportCommand.java @@ -78,7 +78,8 @@ public class RandomTeleportCommand implements CommandExecutor { plugin.sendMessage(sender, "error.player-not-found", "what", args[1]); return true; } - runPreset(args[0].toLowerCase(), sender, target, target.getLocation()); + String[] presets = args[0].split(","); + runPreset(presets[RandomTeleport.RANDOM.nextInt(presets.length)].toLowerCase(), sender, target, target.getLocation()); return true; } sender.sendMessage(e.getMessage()); diff --git a/randomteleport-plugin/src/main/resources/plugin.yml b/randomteleport-plugin/src/main/resources/plugin.yml index dfe3132..b12e0af 100644 --- a/randomteleport-plugin/src/main/resources/plugin.yml +++ b/randomteleport-plugin/src/main/resources/plugin.yml @@ -14,13 +14,13 @@ commands: permission: randomteleport.use usage: | / - uses the default preset - / [] - uses a specific preset + / [] - uses a specific or random preset / [-p, -w, -x, -z, -c, -f] minRange - minimum distance to the center point (square shaped) maxRange - maximum distance to the center point (square shaped) Options: > -p,-player - teleports other players - > -w,-world - teleports the player in a specific world + > -w,-world - teleports the player in a specific or random world > -b,-biome [ ...] - only teleport to this biome (multiple allowed, Bukkit biome names!) > -x,-xPos - x axis of the center point, if not set the player's x axis is used > -z,-zPos - z axis of the center point, if not set the player's z axis is used