Implement Jikoo's data duplication glitch fix

This commit is contained in:
ShadowRanger
2016-05-04 14:38:10 +10:00
parent 90ea073089
commit ba9396ad5c
8 changed files with 137 additions and 114 deletions

View File

@@ -123,6 +123,7 @@ public class OpenInvCommand implements CommandExecutor {
}
private void openInventory(Player player, Player target) {
// Null target check
if (target == null) {
player.sendMessage(ChatColor.RED + "Player not found!");
return;
@@ -149,13 +150,8 @@ public class OpenInvCommand implements CommandExecutor {
// Record the target
openInvHistory.put(player.getUniqueId(), target.getUniqueId());
// Create the inventory
SpecialPlayerInventory inv = OpenInv.inventories.get(target.getUniqueId());
if (inv == null) {
inv = new SpecialPlayerInventory(target, target.isOnline());
}
// Open the inventory
player.openInventory(inv.getBukkitInventory());
// Get the inventory and open it
SpecialPlayerInventory inventory = plugin.getPlayerInventory(target, true);
player.openInventory(inventory.getBukkitInventory());
}
}