Revert "try using onCommand directly instead of dispatching commands."

This reverts commit 684822c0ef.
This commit is contained in:
Sleaker 2012-01-11 16:37:19 -08:00
parent e9c684047a
commit f73694d855

View File

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event.Type;
@ -27,7 +26,6 @@ public class Permission_PermissionsBukkit extends Permission {
private PermissionsPlugin perms = null;
private PermissionServerListener permissionServerListener = null;
private ConsoleCommandSender ccs;
private Command permCommand = null;
public Permission_PermissionsBukkit(Vault plugin) {
this.plugin = plugin;
@ -44,7 +42,6 @@ public class Permission_PermissionsBukkit extends Permission {
Plugin perms = plugin.getServer().getPluginManager().getPlugin("PermissionsBukkit");
if (perms != null) {
perms = (PermissionsPlugin) perms;
permCommand = this.perms.getCommand("permissions");
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
}
}
@ -64,7 +61,6 @@ public class Permission_PermissionsBukkit extends Permission {
if (perms != null) {
if (perms.isEnabled()) {
permission.perms = (PermissionsPlugin) perms;
permCommand = permission.perms.getCommand("permissions");
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
}
}
@ -140,7 +136,7 @@ public class Permission_PermissionsBukkit extends Permission {
if (world != null) {
permission = world + ":" + permission;
}
return perms.onCommand(ccs, permCommand, "permissions", new String[] {"group", "setperm", group, permission, "true"});
return plugin.getServer().dispatchCommand(ccs, "permissions group setperm " + group + " " + permission + " true");
}
@Override
@ -148,7 +144,7 @@ public class Permission_PermissionsBukkit extends Permission {
if (world != null) {
permission = world + ":" + permission;
}
return perms.onCommand(ccs, permCommand, "permissions", new String[] {"group", "unsetperm", group, permission});
return plugin.getServer().dispatchCommand(ccs, "permissions group unsetperm " + group + " " + permission);
}
@Override
@ -169,7 +165,7 @@ public class Permission_PermissionsBukkit extends Permission {
if (world != null) {
return false;
}
return perms.onCommand(ccs, permCommand, "permissions", new String[] {"player", "addgroup", player, group});
return plugin.getServer().dispatchCommand(ccs, "permissions player addgroup " + player + " " + group);
}
@Override
@ -177,7 +173,7 @@ public class Permission_PermissionsBukkit extends Permission {
if (world != null) {
return false;
}
return perms.onCommand(ccs, permCommand, "permissions", new String[] {"player", "removegroup", player, group});
return plugin.getServer().dispatchCommand(ccs, "permissions player removegroup " + player + " " + group);
}
@Override