From 40644e337ac0c13c7490ef21f4dc5a50d50c5255 Mon Sep 17 00:00:00 2001 From: Antoine Aflalo Date: Fri, 25 May 2012 10:19:54 +0200 Subject: [PATCH] OpenOfflineInv return the player target created for opening the inv, to be put in the history. --- src/balor/OpenInv/InventoryManager.java | 3 ++- src/lishid/openinv/commands/OpenInvPluginCommand.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/balor/OpenInv/InventoryManager.java b/src/balor/OpenInv/InventoryManager.java index 88275d6..fd83547 100644 --- a/src/balor/OpenInv/InventoryManager.java +++ b/src/balor/OpenInv/InventoryManager.java @@ -75,7 +75,7 @@ public class InventoryManager { * /openinv/commands/OpenInvPluginCommand.java} * @throws WorldNotFoundException */ - public void openOfflineInv(final Player sender, final String name, final String world) + public Player openOfflineInv(final Player sender, final String name, final String world) throws PlayerNotFound, WorldNotFoundException { Player target = null; final HashMap replace = new HashMap(); @@ -112,6 +112,7 @@ public class InventoryManager { + ChatColor.RED + " can't be found."); } openInv(sender, target, true); + return target; } /** diff --git a/src/lishid/openinv/commands/OpenInvPluginCommand.java b/src/lishid/openinv/commands/OpenInvPluginCommand.java index 695df93..7c185c9 100644 --- a/src/lishid/openinv/commands/OpenInvPluginCommand.java +++ b/src/lishid/openinv/commands/OpenInvPluginCommand.java @@ -84,7 +84,7 @@ public class OpenInvPluginCommand implements CommandExecutor { target = this.plugin.getServer().getPlayer(name); if (target == null) { try { - InventoryManager.INSTANCE.openOfflineInv(player, name, player.getWorld().getName()); + target = InventoryManager.INSTANCE.openOfflineInv(player, name, player.getWorld().getName()); } catch (PlayerNotFound e) { sender.sendMessage(e.getMessage()); } catch (WorldNotFoundException e) {