Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-09 21:10:05 +01:00
Changed CommandPermissionsHandler to use Actor.
Dieser Commit ist enthalten in:
Ursprung
5347cd4e34
Commit
109150f348
@ -20,8 +20,8 @@
|
|||||||
package com.sk89q.worldedit.internal.command;
|
package com.sk89q.worldedit.internal.command;
|
||||||
|
|
||||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||||
|
import com.sk89q.worldedit.extension.platform.Actor;
|
||||||
import com.sk89q.worldedit.util.command.parametric.PermissionsHandler;
|
import com.sk89q.worldedit.util.command.parametric.PermissionsHandler;
|
||||||
import com.sk89q.worldedit.LocalPlayer;
|
|
||||||
|
|
||||||
public class CommandPermissionsHandler extends PermissionsHandler {
|
public class CommandPermissionsHandler extends PermissionsHandler {
|
||||||
|
|
||||||
@ -30,9 +30,9 @@ public class CommandPermissionsHandler extends PermissionsHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasPermission(CommandContext context, String permission) {
|
protected boolean hasPermission(CommandContext context, String permission) {
|
||||||
LocalPlayer sender = context.getLocals().get(LocalPlayer.class);
|
Actor sender = context.getLocals().get(Actor.class);
|
||||||
if (sender == null) {
|
if (sender == null) {
|
||||||
return true;
|
throw new RuntimeException("Uh oh! No 'Actor' specified so that we can check permissions");
|
||||||
} else {
|
} else {
|
||||||
return sender.hasPermission(permission);
|
return sender.hasPermission(permission);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren