Migrate to UUID usage
This commit is contained in:
@@ -18,6 +18,7 @@ package com.lishid.openinv;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -28,12 +29,14 @@ import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.lishid.openinv.commands.*;
|
||||
import com.lishid.openinv.internal.IAnySilentChest;
|
||||
import com.lishid.openinv.internal.IInventoryAccess;
|
||||
import com.lishid.openinv.internal.IPlayerDataManager;
|
||||
import com.lishid.openinv.internal.ISpecialEnderChest;
|
||||
import com.lishid.openinv.internal.ISpecialPlayerInventory;
|
||||
import com.lishid.openinv.internal.InternalAccessor;
|
||||
import com.lishid.openinv.internal.AnySilentChest;
|
||||
import com.lishid.openinv.internal.InventoryAccess;
|
||||
import com.lishid.openinv.internal.PlayerDataManager;
|
||||
import com.lishid.openinv.internal.SpecialEnderChest;
|
||||
import com.lishid.openinv.internal.SpecialPlayerInventory;
|
||||
import com.lishid.openinv.listeners.OpenInvEntityListener;
|
||||
import com.lishid.openinv.listeners.OpenInvInventoryListener;
|
||||
import com.lishid.openinv.listeners.OpenInvPlayerListener;
|
||||
|
||||
/**
|
||||
* Open other player's inventory
|
||||
@@ -43,32 +46,23 @@ import com.lishid.openinv.internal.InternalAccessor;
|
||||
public class OpenInv extends JavaPlugin {
|
||||
public static final Logger logger = Logger.getLogger("Minecraft.OpenInv");
|
||||
|
||||
public static Map<String, ISpecialPlayerInventory> inventories = new HashMap<String, ISpecialPlayerInventory>();
|
||||
public static Map<String, ISpecialEnderChest> enderChests = new HashMap<String, ISpecialEnderChest>();
|
||||
public static final Map<UUID, SpecialPlayerInventory> inventories = new HashMap<UUID, SpecialPlayerInventory>();
|
||||
public static final Map<UUID, SpecialEnderChest> enderChests = new HashMap<UUID, SpecialEnderChest>();
|
||||
|
||||
public static OpenInv mainPlugin;
|
||||
|
||||
public static IPlayerDataManager playerLoader;
|
||||
public static IInventoryAccess inventoryAccess;
|
||||
public static IAnySilentChest anySilentChest;
|
||||
public static PlayerDataManager playerLoader;
|
||||
public static InventoryAccess inventoryAccess;
|
||||
public static AnySilentChest anySilentChest;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Get plugin manager
|
||||
PluginManager pm = getServer().getPluginManager();
|
||||
|
||||
// Version check
|
||||
boolean success = InternalAccessor.Initialize(this.getServer());
|
||||
|
||||
if (!success) {
|
||||
OpenInv.log("Your version of CraftBukkit is not supported.");
|
||||
OpenInv.log("Please look for an updated version of OpenInv.");
|
||||
pm.disablePlugin(this);
|
||||
return;
|
||||
}
|
||||
|
||||
playerLoader = InternalAccessor.Instance.newPlayerDataManager();
|
||||
inventoryAccess = InternalAccessor.Instance.newInventoryAccess();
|
||||
anySilentChest = InternalAccessor.Instance.newAnySilentChest();
|
||||
playerLoader = new PlayerDataManager();
|
||||
inventoryAccess = new InventoryAccess();
|
||||
anySilentChest = new AnySilentChest();
|
||||
|
||||
mainPlugin = this;
|
||||
FileConfiguration config = getConfig();
|
||||
@@ -90,8 +84,8 @@ public class OpenInv extends JavaPlugin {
|
||||
getCommand("openinv").setExecutor(new OpenInvPluginCommand(this));
|
||||
getCommand("searchinv").setExecutor(new SearchInvPluginCommand());
|
||||
getCommand("toggleopeninv").setExecutor(new ToggleOpenInvPluginCommand());
|
||||
getCommand("silentchest").setExecutor(new SilentChestPluginCommand(this));
|
||||
getCommand("anychest").setExecutor(new AnyChestPluginCommand(this));
|
||||
getCommand("silentchest").setExecutor(new SilentChestPluginCommand());
|
||||
getCommand("anychest").setExecutor(new AnyChestPluginCommand());
|
||||
getCommand("openender").setExecutor(new OpenEnderPluginCommand(this));
|
||||
}
|
||||
|
||||
@@ -195,4 +189,4 @@ public class OpenInv extends JavaPlugin {
|
||||
}
|
||||
return player.hasPermission(permission);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user