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_EDITINV = "OpenInv.editinv";
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;
}
// Crosswork check
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!");
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
history = target.getName();
openInvHistory.put(player, history);

View file

@ -57,7 +57,7 @@ public class OpenInvPlayerInventory extends PlayerInventory
public void PlayerGoOnline(CraftPlayer p)
{
if(!playerOnline)
if (!playerOnline)
{
p.getHandle().inventory.items = this.items;
p.getHandle().inventory.armor = this.armor;

View file

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