Some command fixes

Fix EditSession being created for commands that don't need it
Fix error from schematic list (when there are files in sub directories)
Fix dispatcher redundantly checking a huge number of permissions
This commit is contained in:
Jesse Boyd
2016-12-24 15:56:53 +11:00
committed by wizjany
parent b2fb73582f
commit 4a8bba7a54
15 changed files with 79 additions and 93 deletions

View File

@ -52,7 +52,7 @@ public class HistoryCommands {
max = 2
)
@CommandPermissions("worldedit.history.undo")
public void undo(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
public void undo(Player player, LocalSession session, CommandContext args) throws WorldEditException {
int times = Math.max(1, args.getInteger(0, 1));
for (int i = 0; i < times; ++i) {
EditSession undone;
@ -85,7 +85,7 @@ public class HistoryCommands {
max = 2
)
@CommandPermissions("worldedit.history.redo")
public void redo(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
public void redo(Player player, LocalSession session, CommandContext args) throws WorldEditException {
int times = Math.max(1, args.getInteger(0, 1));
@ -119,7 +119,7 @@ public class HistoryCommands {
max = 0
)
@CommandPermissions("worldedit.history.clear")
public void clearHistory(Player player, LocalSession session, EditSession editSession) throws WorldEditException {
public void clearHistory(Player player, LocalSession session) throws WorldEditException {
session.clearHistory();
player.print("History cleared.");
}