Added /clearhistory and /clearclipboard.

Dieser Commit ist enthalten in:
sk89q 2010-10-02 16:13:52 -07:00
Ursprung 4c7e14a76b
Commit c70a7914da
2 geänderte Dateien mit 21 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -41,6 +41,7 @@ public class WorldEdit extends Plugin {
commands.put("/editpos2", "Set editing position #2"); commands.put("/editpos2", "Set editing position #2");
commands.put("/editundo", "Undo"); commands.put("/editundo", "Undo");
commands.put("/editredo", "Redo"); commands.put("/editredo", "Redo");
commands.put("/clearhistory", "Clear history");
commands.put("/editsize", "Get size of selected region"); commands.put("/editsize", "Get size of selected region");
commands.put("/editset", "<Type> - Set all blocks inside region"); commands.put("/editset", "<Type> - Set all blocks inside region");
commands.put("/editreplace", "<ID> - Replace all existing blocks inside region"); commands.put("/editreplace", "<ID> - Replace all existing blocks inside region");
@ -230,6 +231,18 @@ public class WorldEdit extends Plugin {
} }
return true; return true;
// Clear undo history
} else if (split[0].equalsIgnoreCase("/clearhistory")) {
session.clearHistory();
player.sendMessage(Colors.LightPurple + "History cleared.");;
return true;
// Clear clipboard
} else if (split[0].equalsIgnoreCase("/clearclipboard")) {
session.setClipboard(null);
player.sendMessage(Colors.LightPurple + "Clipboard cleared.");;
return true;
// Paste // Paste
} else if (split[0].equalsIgnoreCase("/editpasteair") || } else if (split[0].equalsIgnoreCase("/editpasteair") ||
split[0].equalsIgnoreCase("/editpaste")) { split[0].equalsIgnoreCase("/editpaste")) {

Datei anzeigen

@ -34,6 +34,14 @@ public class WorldEditSession {
private int historyPointer = 0; private int historyPointer = 0;
private RegionClipboard clipboard; private RegionClipboard clipboard;
/**
* Clear history.
*/
public void clearHistory() {
history.clear();
historyPointer = 0;
}
/** /**
* Get the edit session. * Get the edit session.
* *