mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 10:14:43 +02:00
Added new permission node for party teleportation.
`mcmmo.commands.ptp.send` This permission node will be check before sending a teleport request (or teleporting the sender if no request is required), this allows admins to grant certain groups of users permissions to accept incoming party teleport request without being able to send ptp requests themselves. Closes #927
This commit is contained in:
@ -12,6 +12,7 @@ import com.gmail.nossr50.events.party.McMMOPartyTeleportEvent;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
@ -54,6 +55,11 @@ public class PtpCommand implements CommandExecutor {
|
||||
return ptpAcceptCommand.onCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
if (!Permissions.partyTeleportSend(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
sendTeleportRequest(sender, player, args[0]);
|
||||
return true;
|
||||
|
||||
|
@ -217,6 +217,7 @@ public final class Permissions {
|
||||
public static boolean friendlyFire(Permissible permissible) { return permissible.hasPermission("mcmmo.party.friendlyfire"); }
|
||||
|
||||
/* TELEPORT */
|
||||
public static boolean partyTeleportSend(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.send"); }
|
||||
public static boolean partyTeleportAccept(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.accept"); }
|
||||
public static boolean partyTeleportAcceptAll(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.acceptall"); }
|
||||
public static boolean partyTeleportToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.toggle"); }
|
||||
|
Reference in New Issue
Block a user