New permission node for openself.

This commit is contained in:
lishid 2012-10-24 16:00:52 -04:00
parent 62c005d1af
commit ab04e461a8
4 changed files with 11 additions and 2 deletions

View file

@ -12,4 +12,5 @@ public class Permissions
public static final String PERM_SEARCH = "OpenInv.search"; public static final String PERM_SEARCH = "OpenInv.search";
public static final String PERM_EDITINV = "OpenInv.editinv"; public static final String PERM_EDITINV = "OpenInv.editinv";
public static final String PERM_EDITENDER = "OpenInv.editender"; public static final String PERM_EDITENDER = "OpenInv.editender";
public static final String PERM_OPENSELF = "OpenInv.openself";
} }

View file

@ -166,12 +166,20 @@ public class OpenInvPluginCommand implements CommandExecutor
return true; return true;
} }
// Crosswork check
if ((!player.hasPermission(Permissions.PERM_CROSSWORLD) && !player.hasPermission(Permissions.PERM_OVERRIDE)) && target.getWorld() != player.getWorld()) if ((!player.hasPermission(Permissions.PERM_CROSSWORLD) && !player.hasPermission(Permissions.PERM_OVERRIDE)) && target.getWorld() != player.getWorld())
{ {
sender.sendMessage(ChatColor.RED + target.getDisplayName() + " is not in your world!"); sender.sendMessage(ChatColor.RED + target.getDisplayName() + " is not in your world!");
return true; return true;
} }
// Self-open check
if (!player.hasPermission(Permissions.PERM_OPENSELF) && target.equals(player))
{
sender.sendMessage(ChatColor.RED + "You're not allowed to openinv yourself.");
return true;
}
// Record the target // Record the target
history = target.getName(); history = target.getName();
openInvHistory.put(player, history); openInvHistory.put(player, history);

View file

@ -1,6 +1,6 @@
name: OpenInv name: OpenInv
main: lishid.openinv.OpenInv main: lishid.openinv.OpenInv
version: 1.8.7 version: 1.8.8
author: lishid author: lishid
website: http://forums.bukkit.org/threads/15379/ website: http://forums.bukkit.org/threads/15379/
description: > description: >