diff --git a/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java b/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java index 325036d..5bd0103 100644 --- a/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java +++ b/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java @@ -106,9 +106,11 @@ public class CommandClaim { return CommandSource.suggestMatching(list, build); }).executes(CommandClaim::removePlayer)))))) .then(CommandManager.literal("teleport").requires(src -> CommandPermission.perm(src, CommandPermission.cmdTeleport)) - .then(CommandManager.literal("self").then(CommandManager.argument("claim", StringArgumentType.word()).suggests((ctx, b) -> CommandClaim.claimSuggestions(ctx, b, ctx.getSource().getPlayer().getUuid())) + .then(CommandManager.literal("self").then(CommandManager.argument("claim", StringArgumentType.string()).suggests((ctx, b) -> CommandClaim.claimSuggestions(ctx, b, ctx.getSource().getPlayer().getUuid())) .executes(CommandClaim::teleport))) - .then(CommandManager.literal("other").then(CommandManager.argument("player", GameProfileArgumentType.gameProfile()).then(CommandManager.argument("claim", StringArgumentType.word()).suggests((ctx, b) -> CommandClaim.claimSuggestions(ctx, b, CommandClaim.singleProfile(ctx, "player").getId())) + .then(CommandManager.literal("admin").then(CommandManager.argument("claim", StringArgumentType.string()).suggests((ctx, b) -> CommandClaim.claimSuggestions(ctx, b, null)) + .executes(CommandClaim::teleportAdminClaims))) + .then(CommandManager.literal("other").then(CommandManager.argument("player", GameProfileArgumentType.gameProfile()).then(CommandManager.argument("claim", StringArgumentType.string()).suggests((ctx, b) -> CommandClaim.claimSuggestions(ctx, b, CommandClaim.singleProfile(ctx, "player").getId())) .executes(src -> CommandClaim.teleport(src, CommandClaim.singleProfile(src, "player").getId())))))) .then(CommandManager.literal("permission").requires(src -> CommandPermission.perm(src, CommandPermission.cmdPermission)) .then(CommandManager.literal("personal").then(CommandManager.argument("group", StringArgumentType.string()).suggests(CommandClaim::personalGroupSuggestion) @@ -762,6 +764,10 @@ public class CommandClaim { return teleport(context, context.getSource().getPlayer().getUuid()); } + public static int teleportAdminClaims(CommandContext context) throws CommandSyntaxException { + return teleport(context, null); + } + public static int teleport(CommandContext context, UUID owner) throws CommandSyntaxException { ServerPlayerEntity player = context.getSource().getPlayer(); String name = StringArgumentType.getString(context, "claim"); diff --git a/common/src/main/java/io/github/flemmli97/flan/config/LangCommands.java b/common/src/main/java/io/github/flemmli97/flan/config/LangCommands.java index 95cfe19..1a40599 100644 --- a/common/src/main/java/io/github/flemmli97/flan/config/LangCommands.java +++ b/common/src/main/java/io/github/flemmli97/flan/config/LangCommands.java @@ -27,7 +27,7 @@ public class LangCommands { map.put("trapped", new String[]{"trapped", "If in a claim not owned by the player attempts to teleport the player out of it after 5 seconds."}); map.put("unlockDrops", new String[]{"unlockDrops ", "Unlocks dropped items from death so other players can pick them up too. Or all of the given players (needs OP)"}); map.put("setHome", new String[]{"setHome", "Standing in a claim with sufficient permission sets that claims home to the players position"}); - map.put("teleport", new String[]{"teleport self | (other ) ( | )", "Teleport to the given claims home position"}); + map.put("teleport", new String[]{"teleport self | admin | (other ) ( | )", "Teleport to the given claims home position. Use admin to teleport to admin claims"}); map.put("name", new String[]{"name self ", "Sets the current claims name"}); map.put("reload", new String[]{"reload", "Reloads the config ingame."});