3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-25 02:20:07 +01:00

Added seperate permissions for jumpto/thru commands and tools

Dieser Commit ist enthalten in:
zml2008 2011-11-11 15:39:42 -08:00
Ursprung 0a4cbd435f
Commit 256897f473
2 geänderte Dateien mit 15 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -1018,7 +1018,8 @@ public class WorldEdit {
LocalSession session = getSession(player); LocalSession session = getSession(player);
if (player.getItemInHand() == config.navigationWand if (player.getItemInHand() == config.navigationWand
&& config.navigationWandMaxDistance > 0 && config.navigationWandMaxDistance > 0
&& player.hasPermission("worldedit.navigation.jumpto")) { && (player.hasPermission("worldedit.navigation.jumpto.tool")
|| player.hasPermission("worldedit.navigation.jumpto"))) { // TODO: Remove old permission
// Bug workaround // Bug workaround
// Blocks this from being used after the thru function // Blocks this from being used after the thru function
// @TODO do this right or make craftbukkit do it right // @TODO do this right or make craftbukkit do it right
@ -1056,7 +1057,8 @@ public class WorldEdit {
if (player.getItemInHand() == config.navigationWand if (player.getItemInHand() == config.navigationWand
&& config.navigationWandMaxDistance > 0 && config.navigationWandMaxDistance > 0
&& player.hasPermission("worldedit.navigation.thru")) { && (player.hasPermission("worldedit.navigation.thru.tool")
|| player.hasPermission("worldedit.navication.thru"))) { // TODO: Remove old permission
if (!player.passThroughForwardWall(40)) { if (!player.passThroughForwardWall(40)) {
player.printError("Nothing to pass through!"); player.printError("Nothing to pass through!");

Datei anzeigen

@ -136,10 +136,14 @@ public class NavigationCommands {
min = 0, min = 0,
max = 0 max = 0
) )
@CommandPermissions("worldedit.navigation.thru") // @CommandPermissions("worldedit.navigation.thru.command") // TODO: Remove old permission
public static void thru(CommandContext args, WorldEdit we, public static void thru(CommandContext args, WorldEdit we,
LocalSession session, LocalPlayer player, EditSession editSession) LocalSession session, LocalPlayer player, EditSession editSession)
throws WorldEditException { throws WorldEditException {
if (!(player.hasPermission("worldedit.navigation.thru") ||
player.hasPermission("worldedit.navigation.thru.command"))) {
throw new WorldEditPermissionException();
}
if (player.passThroughForwardWall(6)) { if (player.passThroughForwardWall(6)) {
player.print("Whoosh!"); player.print("Whoosh!");
@ -155,11 +159,16 @@ public class NavigationCommands {
min = 0, min = 0,
max = 0 max = 0
) )
@CommandPermissions("worldedit.navigation.jumpto") // @CommandPermissions("worldedit.navigation.jumpto.command") //TODO: Remove old permission
public static void jumpTo(CommandContext args, WorldEdit we, public static void jumpTo(CommandContext args, WorldEdit we,
LocalSession session, LocalPlayer player, EditSession editSession) LocalSession session, LocalPlayer player, EditSession editSession)
throws WorldEditException { throws WorldEditException {
if (!(player.hasPermission("worldedit.navigation.jumpto") ||
player.hasPermission("worldedit.navigation.jumpto.command"))) {
throw new WorldEditPermissionException();
}
WorldVector pos = player.getSolidBlockTrace(300); WorldVector pos = player.getSolidBlockTrace(300);
if (pos != null) { if (pos != null) {
player.findFreePosition(pos); player.findFreePosition(pos);