3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 11:00:05 +01:00

Allow remove command to be used from console

Dieser Commit ist enthalten in:
wizjany 2013-03-26 00:50:45 -04:00
Ursprung 0e8508847e
Commit 51515473bc
2 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -1398,6 +1398,8 @@ public class WorldEdit {
} catch (CommandUsageException e) { } catch (CommandUsageException e) {
player.printError(e.getMessage()); player.printError(e.getMessage());
player.printError(e.getUsage()); player.printError(e.getUsage());
} catch (PlayerNeededException e) {
player.printError(e.getMessage());
} catch (WrappedCommandException e) { } catch (WrappedCommandException e) {
throw e.getCause(); throw e.getCause();
} catch (UnhandledCommandException e) { } catch (UnhandledCommandException e) {

Datei anzeigen

@ -450,6 +450,7 @@ public class UtilityCommands {
) )
@CommandPermissions("worldedit.remove") @CommandPermissions("worldedit.remove")
@Logging(PLACEMENT) @Logging(PLACEMENT)
@Console
public void remove(CommandContext args, LocalSession session, LocalPlayer player, public void remove(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException { EditSession editSession) throws WorldEditException {
@ -491,8 +492,15 @@ public class UtilityCommands {
return; return;
} }
int removed = 0;
if (player.isPlayer()) {
Vector origin = session.getPlacementPosition(player); Vector origin = session.getPlacementPosition(player);
int removed = player.getWorld().removeEntities(type, origin, radius); removed = player.getWorld().removeEntities(type, origin, radius);
} else {
for (LocalWorld world : we.getServer().getWorlds()) {
removed += world.removeEntities(type, new Vector(), radius);
}
}
player.print("Marked " + removed + " entit(ies) for removal."); player.print("Marked " + removed + " entit(ies) for removal.");
} }