Search in sources :

Example 11 with CommandPermissions

use of com.sk89q.minecraft.util.commands.CommandPermissions in project WorldGuard by EngineHub.

the class DebuggingCommands method fireDamageEvent.

@Command(aliases = { "testdamage" }, usage = "[player]", desc = "Simulate an entity damage", min = 1, max = 1, flags = "ts")
@CommandPermissions("worldguard.debug.event")
public void fireDamageEvent(CommandContext args, final Actor sender) throws CommandException {
    LocalPlayer target = worldGuard.getPlatform().getMatcher().matchSinglePlayer(sender, args.getString(0));
    worldGuard.getPlatform().getDebugHandler().testDamage(sender, target, args.hasFlag('t'), args.hasFlag('s'));
}
Also used : LocalPlayer(com.sk89q.worldguard.LocalPlayer) Command(com.sk89q.minecraft.util.commands.Command) CommandPermissions(com.sk89q.minecraft.util.commands.CommandPermissions)

Example 12 with CommandPermissions

use of com.sk89q.minecraft.util.commands.CommandPermissions in project WorldGuard by EngineHub.

the class DebuggingCommands method firePlaceEvent.

@Command(aliases = { "testplace" }, usage = "[player]", desc = "Simulate a block place", min = 1, max = 1, flags = "ts")
@CommandPermissions("worldguard.debug.event")
public void firePlaceEvent(CommandContext args, final Actor sender) throws CommandException {
    LocalPlayer target = worldGuard.getPlatform().getMatcher().matchSinglePlayer(sender, args.getString(0));
    worldGuard.getPlatform().getDebugHandler().testPlace(sender, target, args.hasFlag('t'), args.hasFlag('s'));
}
Also used : LocalPlayer(com.sk89q.worldguard.LocalPlayer) Command(com.sk89q.minecraft.util.commands.Command) CommandPermissions(com.sk89q.minecraft.util.commands.CommandPermissions)

Example 13 with CommandPermissions

use of com.sk89q.minecraft.util.commands.CommandPermissions in project WorldGuard by EngineHub.

the class GeneralCommands method stack.

@Command(aliases = { "stack", ";" }, usage = "", desc = "Stack items", max = 0)
@CommandPermissions({ "worldguard.stack" })
public void stack(CommandContext args, Actor sender) throws CommandException {
    LocalPlayer player = worldGuard.checkPlayer(sender);
    WorldGuard.getInstance().getPlatform().stackPlayerInventory(player);
    player.print("Items compacted into stacks!");
}
Also used : LocalPlayer(com.sk89q.worldguard.LocalPlayer) Command(com.sk89q.minecraft.util.commands.Command) CommandPermissions(com.sk89q.minecraft.util.commands.CommandPermissions)

Example 14 with CommandPermissions

use of com.sk89q.minecraft.util.commands.CommandPermissions in project WorldGuard by EngineHub.

the class GeneralCommands method locate.

@Command(aliases = { "locate" }, usage = "[player]", desc = "Locate a player", max = 1)
@CommandPermissions({ "worldguard.locate" })
public void locate(CommandContext args, Actor sender) throws CommandException {
    LocalPlayer player = worldGuard.checkPlayer(sender);
    if (args.argsLength() == 0) {
        player.setCompassTarget(new Location(player.getWorld(), player.getWorld().getSpawnPosition().toVector3()));
        sender.print("Compass reset to spawn.");
    } else {
        LocalPlayer target = worldGuard.getPlatform().getMatcher().matchSinglePlayer(sender, args.getString(0));
        player.setCompassTarget(target.getLocation());
        sender.print("Compass repointed.");
    }
}
Also used : LocalPlayer(com.sk89q.worldguard.LocalPlayer) Location(com.sk89q.worldedit.util.Location) Command(com.sk89q.minecraft.util.commands.Command) CommandPermissions(com.sk89q.minecraft.util.commands.CommandPermissions)

Aggregations

Command (com.sk89q.minecraft.util.commands.Command)14 CommandPermissions (com.sk89q.minecraft.util.commands.CommandPermissions)14 LocalPlayer (com.sk89q.worldguard.LocalPlayer)11 NestedCommand (com.sk89q.minecraft.util.commands.NestedCommand)5 World (com.sk89q.worldedit.world.World)5 CommandException (com.sk89q.minecraft.util.commands.CommandException)3 FutureForwardingTask (com.sk89q.worldedit.util.task.FutureForwardingTask)3 Task (com.sk89q.worldedit.util.task.Task)3 ConfigurationManager (com.sk89q.worldguard.config.ConfigurationManager)3 MessageBox (com.sk89q.worldedit.util.formatting.component.MessageBox)2 TextComponentProducer (com.sk89q.worldedit.util.formatting.component.TextComponentProducer)2 TextComponent (com.sk89q.worldedit.util.formatting.text.TextComponent)2 ReportList (com.sk89q.worldedit.util.report.ReportList)2 SystemInfoReport (com.sk89q.worldedit.util.report.SystemInfoReport)2 TaskStateComparator (com.sk89q.worldedit.util.task.TaskStateComparator)2 WorldConfiguration (com.sk89q.worldguard.config.WorldConfiguration)2 LoggerToChatHandler (com.sk89q.worldguard.util.logging.LoggerToChatHandler)2 ApplicableRegionsReport (com.sk89q.worldguard.util.report.ApplicableRegionsReport)2 ConfigReport (com.sk89q.worldguard.util.report.ConfigReport)2 File (java.io.File)2