From 6ee71ec50e229033900d3fd9552d1dc91c570b59 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Sat, 27 Jul 2019 15:28:28 +0100 Subject: [PATCH] Set id to preset name if not specified (Fixes #32) --- .../main/java/de/themoep/randomteleport/RandomTeleport.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java index c5dd669..d0aa89a 100644 --- a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java +++ b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java @@ -387,6 +387,9 @@ public class RandomTeleport extends JavaPlugin implements RandomTeleportAPI { */ public RandomSearcher runPreset(CommandSender sender, String preset, Player target, Location center) { String cmd = getConfig().getString("presets." + preset) + " -p " + target.getName(); + if (!cmd.contains("-id")) { + cmd += " -id " + preset; + } if (cmd.startsWith("/")) { cmd = cmd.substring(1); }