bug fixes.

This commit is contained in:
boy0001 2014-10-18 13:24:47 +11:00
parent 9ba5e3f91b
commit cb8822cd6a
2 changed files with 5 additions and 8 deletions

View File

@ -132,7 +132,7 @@ public class PlotMain extends JavaPlugin {
* @return * @return
*/ */
public static int hasPermissionRange(Player player, String stub, int range) { public static int hasPermissionRange(Player player, String stub, int range) {
if (player.isOp()) { if (player==null || player.isOp()) {
return range; return range;
} }
if (player.hasPermission(stub + ".*")) { if (player.hasPermission(stub + ".*")) {
@ -157,10 +157,7 @@ public class PlotMain extends JavaPlugin {
*/ */
public static boolean hasPermissions(Player player, String[] perms) { public static boolean hasPermissions(Player player, String[] perms) {
// Assumes null player is console. // Assumes null player is console.
if (player==null) { if (player==null || player.isOp()) {
return true;
}
if (player.isOp()) {
return true; return true;
} }
for (String perm : perms) { for (String perm : perms) {
@ -205,7 +202,7 @@ public class PlotMain extends JavaPlugin {
* @return * @return
*/ */
public static boolean hasPermission(Player player, String perm) { public static boolean hasPermission(Player player, String perm) {
if (player.isOp()) { if (player==null || player.isOp()) {
return true; return true;
} }
if (player.hasPermission(perm)) { if (player.hasPermission(perm)) {

View File

@ -29,7 +29,7 @@ public class MainCommand implements CommandExecutor {
private static SubCommand[] _subCommands = new SubCommand[] { new Claim(), new Paste(), new Copy(), new Clipboard(), new Auto(), new Home(), new Visit(), private static SubCommand[] _subCommands = new SubCommand[] { new Claim(), new Paste(), new Copy(), new Clipboard(), new Auto(), new Home(), new Visit(),
new TP(), new Set(), new Clear(), new Delete(), new SetOwner(), new Denied(), new Helpers(), new Trusted(), new TP(), new Set(), new Clear(), new Delete(), new SetOwner(), new Denied(), new Helpers(), new Trusted(),
new Info(), new list(), new Help(), new Debug(), new Schematic(), new plugin(), new Inventory(), new Info(), new list(), new Help(), new Debug(), new Schematic(), new plugin(), new Inventory(), new Purge(),
new Reload(), new Merge(), new Unlink(), new Kick(), new Setup() }; new Reload(), new Merge(), new Unlink(), new Kick(), new Setup() };
public static ArrayList<SubCommand> subCommands = new ArrayList<SubCommand>() { public static ArrayList<SubCommand> subCommands = new ArrayList<SubCommand>() {
@ -52,7 +52,7 @@ public class MainCommand implements CommandExecutor {
else { else {
player = null; player = null;
} }
if (PlotMain.hasPermission(player, "plots.use")) { if (!PlotMain.hasPermission(player, "plots.use")) {
return no_permission(player); return no_permission(player);
} }
if ((args.length < 1) if ((args.length < 1)