Fix improper caching causing duplications, closes #10
* Implemented a universal cache for loaded players * Reworked a significant amount of my API additions * Simplified join/quit handling * Cleaned up ISpecialEnderChest/ISpecialPlayerInventory implementations * Fixed OpenInv.* permission not granting access to commands
This commit is contained in:
@@ -18,6 +18,10 @@ package com.lishid.openinv.commands;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.lishid.openinv.OpenInv;
|
||||
import com.lishid.openinv.Permissions;
|
||||
import com.lishid.openinv.internal.ISpecialEnderChest;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
@@ -26,10 +30,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import com.lishid.openinv.OpenInv;
|
||||
import com.lishid.openinv.Permissions;
|
||||
import com.lishid.openinv.internal.ISpecialEnderChest;
|
||||
|
||||
public class OpenEnderPluginCommand implements CommandExecutor {
|
||||
private final OpenInv plugin;
|
||||
public static HashMap<Player, String> openEnderHistory = new HashMap<Player, String>();
|
||||
@@ -103,7 +103,7 @@ public class OpenEnderPluginCommand implements CommandExecutor {
|
||||
|
||||
if (!online) {
|
||||
// Try loading the player's data
|
||||
onlineTarget = plugin.getPlayerLoader().loadPlayer(plugin, target);
|
||||
onlineTarget = plugin.loadPlayer(target);
|
||||
|
||||
if (onlineTarget == null) {
|
||||
player.sendMessage(ChatColor.RED + "Player not found!");
|
||||
@@ -123,7 +123,7 @@ public class OpenEnderPluginCommand implements CommandExecutor {
|
||||
openEnderHistory.put(player, onlineTarget.getName());
|
||||
|
||||
// Create the inventory
|
||||
ISpecialEnderChest chest = plugin.getOrCreateEnderChestFor(onlineTarget, online);
|
||||
ISpecialEnderChest chest = plugin.getEnderChestFor(onlineTarget, online);
|
||||
|
||||
// Open the inventory
|
||||
player.openInventory(chest.getBukkitInventory());
|
||||
|
Reference in New Issue
Block a user