mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 14:38:53 +00:00
Require permission node for coordinate teleporting
This commit is contained in:
1 parent
7add61e3cd
commit
ded86cec94
1 file changed
+7
@@ -51,6 +51,13 @@ public class TpCommand extends CommandBase implements TabCompletable, ConsoleExe
|
|||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
targetPosition = new TeleportCommandTarget(args[1]);
|
targetPosition = new TeleportCommandTarget(args[1]);
|
||||||
} else {
|
} else {
|
||||||
|
// Coordinate teleportation requires a permission node
|
||||||
|
if (!onlineUser.hasPermission(Permission.COMMAND_TP_TO_COORDINATES.node)) {
|
||||||
|
plugin.getLocales().getLocale("error_no_permission").ifPresent(onlineUser::sendMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse the coordinates and set the target position
|
||||||
final Position userPosition = onlineUser.getPosition().join();
|
final Position userPosition = onlineUser.getPosition().join();
|
||||||
final Optional<Position> parsedPosition = Position.parse(userPosition,
|
final Optional<Position> parsedPosition = Position.parse(userPosition,
|
||||||
Arrays.copyOfRange(args, coordinatesIndex, args.length - 1));
|
Arrays.copyOfRange(args, coordinatesIndex, args.length - 1));
|
||||||
|
|||||||
Reference in new issue
Block a user