From 656a40abb235d8129165942e3d197d36751938fd Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 13 Apr 2013 23:50:17 +0100 Subject: [PATCH] Remove duplicate perm. --- .../src/com/earth2me/essentials/Essentials.java | 4 ++-- .../com/earth2me/essentials/MetaItemStack.java | 17 +++++------------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 07ca89c53..b4f226a8a 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -459,14 +459,14 @@ public class Essentials extends JavaPlugin implements IEssentials return true; } } - + public void cleanupOpenInventories() { for (Player player : getServer().getOnlinePlayers()) { User user = getUser(player); if (user.isRecipeSee()) - { + { user.getPlayer().getOpenInventory().getTopInventory().clear(); user.getPlayer().getOpenInventory().close(); user.setRecipeSee(false); diff --git a/Essentials/src/com/earth2me/essentials/MetaItemStack.java b/Essentials/src/com/earth2me/essentials/MetaItemStack.java index 5958839b5..665302dfb 100644 --- a/Essentials/src/com/earth2me/essentials/MetaItemStack.java +++ b/Essentials/src/com/earth2me/essentials/MetaItemStack.java @@ -156,23 +156,16 @@ public class MetaItemStack throw new Exception(_("onlyPlayerSkulls")); } } - else if (split.length > 1 && split[0].equalsIgnoreCase("book") && stack.getType() == Material.WRITTEN_BOOK && hasMetaPermission(sender, "book", false, true, ess)) + else if (split.length > 1 && split[0].equalsIgnoreCase("book") && stack.getType() == Material.WRITTEN_BOOK + && (hasMetaPermission(sender, "book", true, true, ess) || hasMetaPermission(sender, "chapter-" + split[1].toLowerCase(Locale.ENGLISH), true, true, ess))) { final BookMeta meta = (BookMeta)stack.getItemMeta(); final IText input = new BookInput("book", true, ess); final BookPager pager = new BookPager(input); - if (hasMetaPermission(sender, "chapter", true, true, ess) || hasMetaPermission(sender, "chapter-" + split[1].toLowerCase(Locale.ENGLISH), true, true, ess)) - { - List pages = pager.getPages(split[1]); - meta.setPages(pages); - stack.setItemMeta(meta); - } - else - { - throw new Exception(_("noChapterMeta")); - } - + List pages = pager.getPages(split[1]); + meta.setPages(pages); + stack.setItemMeta(meta); } else if (split.length > 1 && split[0].equalsIgnoreCase("author") && stack.getType() == Material.WRITTEN_BOOK && hasMetaPermission(sender, "author", false, true, ess)) {