Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-07 12:00:07 +01:00
Fix permissions
Dieser Commit ist enthalten in:
Ursprung
9b31f39219
Commit
85382ad109
@ -210,7 +210,9 @@ public class BukkitPlayer extends AbstractPlayerActor {
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(String perm) {
|
||||
return (!plugin.getLocalConfiguration().noOpPermissions && player.isOp());
|
||||
return (!plugin.getLocalConfiguration().noOpPermissions && player.isOp())
|
||||
|| plugin.getPermissionsResolver().hasPermission(
|
||||
player.getWorld().getName(), player, perm);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -74,6 +74,7 @@ import org.enginehub.piston.annotation.param.ArgFlag;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
import org.jetbrains.annotations.Range;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -137,12 +138,9 @@ public class RegionCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.region.test")
|
||||
@Logging(REGION)
|
||||
public void test(Player player, EditSession editSession, @Arg(desc = "test") @Confirm(RADIUS) BlockVector3 radius) throws WorldEditException {
|
||||
// editSession.addProcessor(new ChunkSendProcessor(editSession.getWorld(), () -> Collections.singleton(player)));
|
||||
// editSession.addProcessor(NullProcessor.INSTANCE);
|
||||
// FlatRegionFunction replace = new BiomeReplace(editSession, biome);
|
||||
// FlatRegionVisitor visitor = new FlatRegionVisitor(Regions.asFlatRegion(region), replace);
|
||||
// Operations.completeLegacy(visitor);
|
||||
public void test(Player player, EditSession editSession, @Arg(desc = "test") String world, BlockVector2 mcaFile) throws WorldEditException {
|
||||
file = new File(world, "region" + File.separator)
|
||||
|
||||
}
|
||||
|
||||
@Command(
|
||||
|
@ -24,6 +24,7 @@ import com.boydti.fawe.command.AnvilCommands;
|
||||
import com.boydti.fawe.command.AnvilCommandsRegistration;
|
||||
import com.boydti.fawe.command.CFICommands;
|
||||
import com.boydti.fawe.command.CFICommandsRegistration;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.brush.visualization.cfi.HeightMapMCAGenerator;
|
||||
@ -729,24 +730,18 @@ public final class PlatformCommandManager {
|
||||
}
|
||||
} catch (ConditionFailedException e) {
|
||||
if (e.getCondition() instanceof PermissionCondition) {
|
||||
actor.printError("You are not permitted to do that. Are you in the right mode?");
|
||||
actor.printError(TranslatableComponent.of("fawe.error.no.perm", StringMan.getString(((PermissionCondition) e.getCondition()).getPermissions())));
|
||||
} else {
|
||||
actor.print(e.getRichMessage());
|
||||
}
|
||||
} catch (FaweException e) {
|
||||
actor.printError(TextComponent.builder().append("Edit cancelled: ").append(e.getComponent()).build());
|
||||
actor.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", e.getComponent()));
|
||||
} catch (UsageException e) {
|
||||
ImmutableList<Command> cmd = e.getCommands();
|
||||
if (!cmd.isEmpty()) {
|
||||
actor.print(TextComponent.builder("Usage: ")
|
||||
.color(TextColor.RED)
|
||||
.append(HelpGenerator.create(e.getCommandParseResult()).getUsage())
|
||||
.build());
|
||||
actor.printError(TranslatableComponent.of("fawe.error.command.syntax", HelpGenerator.create(e.getCommandParseResult()).getUsage()));
|
||||
}
|
||||
actor.print(TextComponent.builder("")
|
||||
.color(TextColor.RED)
|
||||
.append(e.getRichMessage())
|
||||
.build());
|
||||
actor.printError(e.getRichMessage());
|
||||
} catch (CommandExecutionException e) {
|
||||
handleUnknownException(actor, e.getCause());
|
||||
} catch (CommandException e) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren