Major update of the code #3
@@ -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<String, String> replace = new HashMap<String, String>();
|
||||
@@ -112,6 +112,7 @@ public class InventoryManager {
|
||||
+ ChatColor.RED + " can't be found.");
|
||||
}
|
||||
openInv(sender, target, true);
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user