Player data glitch fix and changes #39
							
								
								
									
										146
									
								
								src/main/java/com/lishid/openinv/Configuration.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										146
									
								
								src/main/java/com/lishid/openinv/Configuration.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,146 @@
 | 
				
			|||||||
 | 
					package com.lishid.openinv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.bukkit.Material;
 | 
				
			||||||
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class Configuration {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final OpenInv plugin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private Material openInvItem;
 | 
				
			||||||
 | 
					    private boolean notifySilentChest;
 | 
				
			||||||
 | 
					    private boolean notifyAnyChest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public Configuration(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Check for config updates
 | 
				
			||||||
 | 
					        ConfigUpdater configUpdater = new ConfigUpdater(plugin);
 | 
				
			||||||
 | 
					        configUpdater.checkForUpdates();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Load the config settings
 | 
				
			||||||
 | 
					        load();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Loads OpenInv's config settings.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public void load() {
 | 
				
			||||||
 | 
					        // OpenInv Item
 | 
				
			||||||
 | 
					        if (!plugin.getConfig().isSet("items.open-inv")) {
 | 
				
			||||||
 | 
					            saveToConfig("items.open-inv", "STICK");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        String itemName = plugin.getConfig().getString("items.open-inv", "STICK");
 | 
				
			||||||
 | 
					        Material material = Material.getMaterial(itemName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (material == null) {
 | 
				
			||||||
 | 
					            plugin.getLogger().warning("OpenInv item '" + itemName + "' does not match to a valid item. Defaulting to stick.");
 | 
				
			||||||
 | 
					            material = Material.STICK;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        openInvItem = material;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Other Values
 | 
				
			||||||
 | 
					        notifySilentChest = plugin.getConfig().getBoolean("notify.silent-chest", true);
 | 
				
			||||||
 | 
					        notifyAnyChest = plugin.getConfig().getBoolean("notify.any-chest", true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Saves a value to the plugin config at the specified path.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param path the path to set the value to
 | 
				
			||||||
 | 
					     * @param value the value to set to the path
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public void saveToConfig(String path, Object value) {
 | 
				
			||||||
 | 
					        plugin.getConfig().set(path, value);
 | 
				
			||||||
 | 
					        plugin.saveConfig();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns the OpenInv item Material.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return the OpenInv item Material
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public Material getOpenInvItem() {
 | 
				
			||||||
 | 
					        return openInvItem;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns whether or not notify silent chest is enabled.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return true if notify silent chest is enabled; false otherwise
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public boolean notifySilentChest() {
 | 
				
			||||||
 | 
					        return notifySilentChest;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns whether or not notify any chest is enabled.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return true if notify any chest is enabled; false otherwise
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public boolean notifyAnyChest() {
 | 
				
			||||||
 | 
					        return notifyAnyChest;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns a player's item OpenInv status.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param player the player to get the item OpenInv status of
 | 
				
			||||||
 | 
					     * @return the player's item OpenInv status
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public boolean getPlayerItemOpenInvStatus(Player player) {
 | 
				
			||||||
 | 
					        return plugin.getConfig().getBoolean("toggles.items.open-inv." + player.getUniqueId(), false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns a player's any chest status.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param player the player to get the any chest status of
 | 
				
			||||||
 | 
					     * @return the player's any chest status
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public boolean getPlayerAnyChestStatus(Player player) {
 | 
				
			||||||
 | 
					        return plugin.getConfig().getBoolean("toggles.any-chest." + player.getUniqueId(), true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Sets a player's any chest status.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param player the player to set the any chest status of
 | 
				
			||||||
 | 
					     * @param status the status to set with
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public void setPlayerAnyChestStatus(Player player, boolean status) {
 | 
				
			||||||
 | 
					        saveToConfig("toggles.any-chest." + player.getUniqueId(), status);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Sets a player's item OpenInv status.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param player the player to set the item OpenInv status of
 | 
				
			||||||
 | 
					     * @param status the status to set with
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public void setPlayerItemOpenInvStatus(Player player, boolean status) {
 | 
				
			||||||
 | 
					        saveToConfig("toggles.items.open-inv." + player.getUniqueId(), status);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns a player's silent chest status.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param player the player to get the silent chest status of
 | 
				
			||||||
 | 
					     * @return the player's silent chest status
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public boolean getPlayerSilentChestStatus(Player player) {
 | 
				
			||||||
 | 
					        return plugin.getConfig().getBoolean("toggles.silent-chest." + player.getUniqueId(), false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Sets a player's silent chest status.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param player the player to set the silent chest status of
 | 
				
			||||||
 | 
					     * @param status the status to set with
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public void setPlayerSilentChestStatus(Player player, boolean status) {
 | 
				
			||||||
 | 
					        saveToConfig("toggles.silent-chest." + player.getUniqueId(), status);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -20,9 +20,7 @@ import java.util.HashMap;
 | 
				
			|||||||
import java.util.Map;
 | 
					import java.util.Map;
 | 
				
			||||||
import java.util.UUID;
 | 
					import java.util.UUID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.bukkit.Bukkit;
 | 
					 | 
				
			||||||
import org.bukkit.ChatColor;
 | 
					import org.bukkit.ChatColor;
 | 
				
			||||||
import org.bukkit.Material;
 | 
					 | 
				
			||||||
import org.bukkit.command.CommandSender;
 | 
					import org.bukkit.command.CommandSender;
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
import org.bukkit.permissions.Permissible;
 | 
					import org.bukkit.permissions.Permissible;
 | 
				
			||||||
@@ -50,140 +48,112 @@ public class OpenInv extends JavaPlugin {
 | 
				
			|||||||
    public static final Map<UUID, SpecialPlayerInventory> inventories = new HashMap<UUID, SpecialPlayerInventory>();
 | 
					    public static final Map<UUID, SpecialPlayerInventory> inventories = new HashMap<UUID, SpecialPlayerInventory>();
 | 
				
			||||||
    public static final Map<UUID, SpecialEnderChest> enderChests = new HashMap<UUID, SpecialEnderChest>();
 | 
					    public static final Map<UUID, SpecialEnderChest> enderChests = new HashMap<UUID, SpecialEnderChest>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static OpenInv mainPlugin;
 | 
					    private PlayerDataManager playerLoader;
 | 
				
			||||||
 | 
					    private InventoryAccess inventoryAccess;
 | 
				
			||||||
 | 
					    private AnySilentChest anySilentChest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private static PlayerDataManager playerLoader;
 | 
					    private Configuration configuration;
 | 
				
			||||||
    private static InventoryAccess inventoryAccess;
 | 
					 | 
				
			||||||
    private static AnySilentChest anySilentChest;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void onEnable() {
 | 
					    public void onEnable() {
 | 
				
			||||||
        // Plugin
 | 
					        // Config
 | 
				
			||||||
        mainPlugin = this;
 | 
					        configuration = new Configuration(this);
 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Config Updater
 | 
					 | 
				
			||||||
        ConfigUpdater configUpdater = new ConfigUpdater(this);
 | 
					 | 
				
			||||||
        configUpdater.checkForUpdates();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Initialize
 | 
					        // Initialize
 | 
				
			||||||
        playerLoader = new PlayerDataManager();
 | 
					        playerLoader = new PlayerDataManager(this);
 | 
				
			||||||
        inventoryAccess = new InventoryAccess();
 | 
					        inventoryAccess = new InventoryAccess(this);
 | 
				
			||||||
        anySilentChest = new AnySilentChest();
 | 
					        anySilentChest = new AnySilentChest(this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Save the default config.yml if it doesn't already exist
 | 
					        // Save the default config.yml if it doesn't already exist
 | 
				
			||||||
        saveDefaultConfig();
 | 
					        saveDefaultConfig();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Register the plugin's events & commands
 | 
					        // Register the plugin's events
 | 
				
			||||||
        registerEvents();
 | 
					 | 
				
			||||||
        registerCommands();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private void registerEvents() {
 | 
					 | 
				
			||||||
        PluginManager pm = getServer().getPluginManager();
 | 
					        PluginManager pm = getServer().getPluginManager();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        pm.registerEvents(new OpenInvPlayerListener(), this);
 | 
					        pm.registerEvents(new OpenInvPlayerListener(this), this);
 | 
				
			||||||
        pm.registerEvents(new OpenInvEntityListener(), this);
 | 
					        pm.registerEvents(new OpenInvEntityListener(this), this);
 | 
				
			||||||
        pm.registerEvents(new OpenInvInventoryListener(), this);
 | 
					        pm.registerEvents(new OpenInvInventoryListener(this), this);
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private void registerCommands() {
 | 
					        // Register the plugin's commands
 | 
				
			||||||
        getCommand("openinv").setExecutor(new OpenInvCommand(this));
 | 
					        getCommand("openinv").setExecutor(new OpenInvCommand(this));
 | 
				
			||||||
        getCommand("openender").setExecutor(new OpenEnderCommand(this));
 | 
					        getCommand("openender").setExecutor(new OpenEnderCommand(this));
 | 
				
			||||||
        getCommand("searchinv").setExecutor(new SearchInvCommand());
 | 
					        getCommand("searchinv").setExecutor(new SearchInvCommand(this));
 | 
				
			||||||
        getCommand("searchender").setExecutor(new SearchEnderCommand());
 | 
					        getCommand("searchender").setExecutor(new SearchEnderCommand(this));
 | 
				
			||||||
        getCommand("toggleopeninv").setExecutor(new ToggleOpenInvCommand());
 | 
					        getCommand("toggleopeninv").setExecutor(new ToggleOpenInvCommand(this));
 | 
				
			||||||
        getCommand("anychest").setExecutor(new AnyChestCommand());
 | 
					        getCommand("anychest").setExecutor(new AnyChestCommand(this));
 | 
				
			||||||
        getCommand("silentchest").setExecutor(new SilentChestCommand());
 | 
					        getCommand("silentchest").setExecutor(new SilentChestCommand(this));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static PlayerDataManager getPlayerLoader() {
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns the plugin Configuration.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return the plugin Configuration
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public Configuration getConfiguration() {
 | 
				
			||||||
 | 
					        return configuration;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns an instance of PlayerDataManager.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return an instance of PlayerDataManager
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public PlayerDataManager getPlayerLoader() {
 | 
				
			||||||
        return playerLoader;
 | 
					        return playerLoader;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static InventoryAccess getInventoryAccess() {
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns an instance of InventoryAccess.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return an instance of InventoryAccess
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public InventoryAccess getInventoryAccess() {
 | 
				
			||||||
        return inventoryAccess;
 | 
					        return inventoryAccess;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static AnySilentChest getAnySilentChest() {
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns an instance of AnySilentChest.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return an instance of AnySilentChest
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public AnySilentChest getAnySilentChest() {
 | 
				
			||||||
        return anySilentChest;
 | 
					        return anySilentChest;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static Object getFromConfig(String path, Object defaultValue) {
 | 
					    /**
 | 
				
			||||||
        Object val = mainPlugin.getConfig().get(path);
 | 
					     * Logs a message to console.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
        if (val == null) {
 | 
					     * @param text the message to log
 | 
				
			||||||
            mainPlugin.getConfig().set(path, defaultValue);
 | 
					     */
 | 
				
			||||||
            return defaultValue;
 | 
					    public void log(String text) {
 | 
				
			||||||
        } else {
 | 
					        getLogger().info(text);
 | 
				
			||||||
            return val;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static void saveToConfig(String path, Object value) {
 | 
					    /**
 | 
				
			||||||
        mainPlugin.getConfig().set(path, value);
 | 
					     * Logs a Throwable to console.
 | 
				
			||||||
        mainPlugin.saveConfig();
 | 
					     *
 | 
				
			||||||
    }
 | 
					     * @param e the Throwable to log
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    public static Material getOpenInvItem() {
 | 
					    public void log(Throwable e) {
 | 
				
			||||||
        if (!mainPlugin.getConfig().isSet("items.open-inv")) {
 | 
					        getLogger().severe(e.toString());
 | 
				
			||||||
            saveToConfig("items.open-inv", "STICK");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        String itemName = mainPlugin.getConfig().getString("items.open-inv", "STICK");
 | 
					 | 
				
			||||||
        Material material = Material.getMaterial(itemName);
 | 
					 | 
				
			||||||
        if (material == null) {
 | 
					 | 
				
			||||||
            mainPlugin.getLogger().warning("OpenInv item '" + itemName + "' does not match to a valid item. Defaulting to stick.");
 | 
					 | 
				
			||||||
            material = Material.STICK;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return material;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static boolean notifySilentChest() {
 | 
					 | 
				
			||||||
        return mainPlugin.getConfig().getBoolean("notify.silent-chest", true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static boolean notifyAnyChest() {
 | 
					 | 
				
			||||||
        return mainPlugin.getConfig().getBoolean("notify.any-chest", true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static boolean getPlayerAnyChestStatus(Player player) {
 | 
					 | 
				
			||||||
        return mainPlugin.getConfig().getBoolean("toggles.any-chest." + player.getUniqueId(), true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static void setPlayerAnyChestStatus(Player player, boolean status) {
 | 
					 | 
				
			||||||
        saveToConfig("toggles.any-chest." + player.getUniqueId(), status);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static boolean getPlayerItemOpenInvStatus(Player player) {
 | 
					 | 
				
			||||||
        return mainPlugin.getConfig().getBoolean("toggles.items.open-inv." + player.getUniqueId(), false);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static void setPlayerItemOpenInvStatus(Player player, boolean status) {
 | 
					 | 
				
			||||||
        saveToConfig("toggles.items.open-inv." + player.getUniqueId(), status);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static boolean getPlayerSilentChestStatus(Player player) {
 | 
					 | 
				
			||||||
        return mainPlugin.getConfig().getBoolean("toggles.silent-chest." + player.getUniqueId(), false);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static void setPlayerSilentChestStatus(Player player, boolean status) {
 | 
					 | 
				
			||||||
        saveToConfig("toggles.silent-chest." + player.getUniqueId(), status);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static void log(String text) {
 | 
					 | 
				
			||||||
        mainPlugin.getLogger().info("[OpenInv] " + text);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static void log(Throwable e) {
 | 
					 | 
				
			||||||
        mainPlugin.getLogger().severe("[OpenInv] " + e.toString());
 | 
					 | 
				
			||||||
        e.printStackTrace();
 | 
					        e.printStackTrace();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Sends an OpenInv message to a player.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param sender the CommandSender to message
 | 
				
			||||||
 | 
					     * @param message the message to send
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    public static void sendMessage(CommandSender sender, String message) {
 | 
					    public static void sendMessage(CommandSender sender, String message) {
 | 
				
			||||||
        sender.sendMessage(ChatColor.AQUA + "[OpenInv] " + ChatColor.WHITE + message);
 | 
					        sender.sendMessage(ChatColor.AQUA + "[OpenInv] " + ChatColor.WHITE + message);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Outputs OpenInv help information to a player.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param player the player to show help to
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    public static void showHelp(Player player) {
 | 
					    public static void showHelp(Player player) {
 | 
				
			||||||
        player.sendMessage(ChatColor.GREEN + "/openinv <player> - Open a player's inventory.");
 | 
					        player.sendMessage(ChatColor.GREEN + "/openinv <player> - Open a player's inventory.");
 | 
				
			||||||
        player.sendMessage(ChatColor.GREEN + "   (aliases: oi, inv, open)");
 | 
					        player.sendMessage(ChatColor.GREEN + "   (aliases: oi, inv, open)");
 | 
				
			||||||
@@ -209,6 +179,13 @@ public class OpenInv extends JavaPlugin {
 | 
				
			|||||||
        player.sendMessage(ChatColor.GREEN + "   (aliases: sc, silent)");
 | 
					        player.sendMessage(ChatColor.GREEN + "   (aliases: sc, silent)");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns whether or not a player has a permission.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param player the player to check
 | 
				
			||||||
 | 
					     * @param permission the permission node to check for
 | 
				
			||||||
 | 
					     * @return true if the player has the permission; false otherwise
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    public static boolean hasPermission(Permissible player, String permission) {
 | 
					    public static boolean hasPermission(Permissible player, String permission) {
 | 
				
			||||||
        String[] parts = permission.split("\\.");
 | 
					        String[] parts = permission.split("\\.");
 | 
				
			||||||
        String perm = "";
 | 
					        String perm = "";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,9 @@
 | 
				
			|||||||
package com.lishid.openinv;
 | 
					package com.lishid.openinv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class Permissions {
 | 
					public final class Permissions {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private Permissions() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static final String PERM_OPENINV = "OpenInv.openinv";
 | 
					    public static final String PERM_OPENINV = "OpenInv.openinv";
 | 
				
			||||||
    public static final String PERM_OVERRIDE = "OpenInv.override";
 | 
					    public static final String PERM_OVERRIDE = "OpenInv.override";
 | 
				
			||||||
    public static final String PERM_EXEMPT = "OpenInv.exempt";
 | 
					    public static final String PERM_EXEMPT = "OpenInv.exempt";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,9 +24,18 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
import com.lishid.openinv.Permissions;
 | 
					import com.lishid.openinv.Permissions;
 | 
				
			||||||
 | 
					import com.lishid.openinv.Configuration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class AnyChestCommand implements CommandExecutor {
 | 
					public class AnyChestCommand implements CommandExecutor {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final OpenInv plugin;
 | 
				
			||||||
 | 
					    private final Configuration configuration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public AnyChestCommand(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					        configuration = plugin.getConfiguration();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
					    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
				
			||||||
        if (command.getName().equalsIgnoreCase("anychest")) {
 | 
					        if (command.getName().equalsIgnoreCase("anychest")) {
 | 
				
			||||||
@@ -44,15 +53,15 @@ public class AnyChestCommand implements CommandExecutor {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            if (args.length > 0) {
 | 
					            if (args.length > 0) {
 | 
				
			||||||
                if (args[0].equalsIgnoreCase("check")) {
 | 
					                if (args[0].equalsIgnoreCase("check")) {
 | 
				
			||||||
                    String status = OpenInv.getPlayerAnyChestStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
					                    String status = configuration.getPlayerAnyChestStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
				
			||||||
                    OpenInv.sendMessage(player, "Any Chest is " + status + ChatColor.RESET + ".");
 | 
					                    OpenInv.sendMessage(player, "Any Chest is " + status + ChatColor.RESET + ".");
 | 
				
			||||||
                    return true;
 | 
					                    return true;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            OpenInv.setPlayerAnyChestStatus(player, !OpenInv.getPlayerAnyChestStatus(player));
 | 
					            configuration.setPlayerAnyChestStatus(player, !configuration.getPlayerAnyChestStatus(player));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            String status = OpenInv.getPlayerAnyChestStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
					            String status = configuration.getPlayerAnyChestStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
				
			||||||
            OpenInv.sendMessage(player, "Any Chest is now " + status + ChatColor.RESET + ".");
 | 
					            OpenInv.sendMessage(player, "Any Chest is now " + status + ChatColor.RESET + ".");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -96,7 +96,7 @@ public class OpenEnderCommand implements CommandExecutor {
 | 
				
			|||||||
                    @Override
 | 
					                    @Override
 | 
				
			||||||
                    public void run() {
 | 
					                    public void run() {
 | 
				
			||||||
                        // Try loading the player's data asynchronously
 | 
					                        // Try loading the player's data asynchronously
 | 
				
			||||||
                        final Player target = OpenInv.getPlayerLoader().loadPlayer(uuid);
 | 
					                        final Player target = plugin.getPlayerLoader().loadPlayer(uuid);
 | 
				
			||||||
                        if (target == null) {
 | 
					                        if (target == null) {
 | 
				
			||||||
                            player.sendMessage(ChatColor.RED + "Player not found!");
 | 
					                            player.sendMessage(ChatColor.RED + "Player not found!");
 | 
				
			||||||
                            return;
 | 
					                            return;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,6 +48,7 @@ public class OpenInvCommand implements CommandExecutor {
 | 
				
			|||||||
                sender.sendMessage(ChatColor.RED + "You can't use this command from the console.");
 | 
					                sender.sendMessage(ChatColor.RED + "You can't use this command from the console.");
 | 
				
			||||||
                return true;
 | 
					                return true;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!OpenInv.hasPermission(sender, Permissions.PERM_OPENINV)) {
 | 
					            if (!OpenInv.hasPermission(sender, Permissions.PERM_OPENINV)) {
 | 
				
			||||||
                sender.sendMessage(ChatColor.RED + "You do not have permission to access player inventories.");
 | 
					                sender.sendMessage(ChatColor.RED + "You do not have permission to access player inventories.");
 | 
				
			||||||
                return true;
 | 
					                return true;
 | 
				
			||||||
@@ -90,7 +91,7 @@ public class OpenInvCommand implements CommandExecutor {
 | 
				
			|||||||
                    @Override
 | 
					                    @Override
 | 
				
			||||||
                    public void run() {
 | 
					                    public void run() {
 | 
				
			||||||
                        // Try loading the player's data asynchronously
 | 
					                        // Try loading the player's data asynchronously
 | 
				
			||||||
                        final Player target = OpenInv.getPlayerLoader().loadPlayer(uuid);
 | 
					                        final Player target = plugin.getPlayerLoader().loadPlayer(uuid);
 | 
				
			||||||
                        if (target == null) {
 | 
					                        if (target == null) {
 | 
				
			||||||
                            player.sendMessage(ChatColor.RED + "Player not found!");
 | 
					                            player.sendMessage(ChatColor.RED + "Player not found!");
 | 
				
			||||||
                            return;
 | 
					                            return;
 | 
				
			||||||
@@ -148,14 +149,10 @@ public class OpenInvCommand implements CommandExecutor {
 | 
				
			|||||||
        openInvHistory.put(player.getUniqueId(), target.getUniqueId());
 | 
					        openInvHistory.put(player.getUniqueId(), target.getUniqueId());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Create the inventory
 | 
					        // Create the inventory
 | 
				
			||||||
        /*
 | 
					 | 
				
			||||||
        SpecialPlayerInventory inv = OpenInv.inventories.get(target.getUniqueId());
 | 
					        SpecialPlayerInventory inv = OpenInv.inventories.get(target.getUniqueId());
 | 
				
			||||||
        if (inv == null) {
 | 
					        if (inv == null) {
 | 
				
			||||||
            inv = new SpecialPlayerInventory(target, target.isOnline());
 | 
					            inv = new SpecialPlayerInventory(target, target.isOnline());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        SpecialPlayerInventory inv = new SpecialPlayerInventory(target, target.isOnline());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Open the inventory
 | 
					        // Open the inventory
 | 
				
			||||||
        player.openInventory(inv.getBukkitInventory());
 | 
					        player.openInventory(inv.getBukkitInventory());
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,12 @@ import com.lishid.openinv.Permissions;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class SearchEnderCommand implements CommandExecutor {
 | 
					public class SearchEnderCommand implements CommandExecutor {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private OpenInv plugin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public SearchEnderCommand(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
					    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
				
			||||||
        if (command.getName().equalsIgnoreCase("searchender")) {
 | 
					        if (command.getName().equalsIgnoreCase("searchender")) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,6 +29,12 @@ import com.lishid.openinv.Permissions;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class SearchInvCommand implements CommandExecutor {
 | 
					public class SearchInvCommand implements CommandExecutor {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final OpenInv plugin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public SearchInvCommand(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
					    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
				
			||||||
        if (command.getName().equalsIgnoreCase("searchinv")) {
 | 
					        if (command.getName().equalsIgnoreCase("searchinv")) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,9 +24,18 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
import com.lishid.openinv.Permissions;
 | 
					import com.lishid.openinv.Permissions;
 | 
				
			||||||
 | 
					import com.lishid.openinv.Configuration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class SilentChestCommand implements CommandExecutor {
 | 
					public class SilentChestCommand implements CommandExecutor {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final OpenInv plugin;
 | 
				
			||||||
 | 
					    private final Configuration configuration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public SilentChestCommand(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					        configuration = plugin.getConfiguration();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
					    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
				
			||||||
        if (command.getName().equalsIgnoreCase("silentchest")) {
 | 
					        if (command.getName().equalsIgnoreCase("silentchest")) {
 | 
				
			||||||
@@ -44,16 +53,16 @@ public class SilentChestCommand implements CommandExecutor {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            if (args.length > 0) {
 | 
					            if (args.length > 0) {
 | 
				
			||||||
                if (args[0].equalsIgnoreCase("check")) {
 | 
					                if (args[0].equalsIgnoreCase("check")) {
 | 
				
			||||||
                    String status = OpenInv.getPlayerSilentChestStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
					                    String status = configuration.getPlayerSilentChestStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
				
			||||||
                    OpenInv.sendMessage(player, "Silent Chest is " + status + ChatColor.RESET + ".");
 | 
					                    plugin.sendMessage(player, "Silent Chest is " + status + ChatColor.RESET + ".");
 | 
				
			||||||
                    return true;
 | 
					                    return true;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            OpenInv.setPlayerSilentChestStatus(player, !OpenInv.getPlayerSilentChestStatus(player));
 | 
					            configuration.setPlayerSilentChestStatus(player, !configuration.getPlayerSilentChestStatus(player));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            String status = OpenInv.getPlayerSilentChestStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
					            String status = configuration.getPlayerSilentChestStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
				
			||||||
            OpenInv.sendMessage(player, "Silent Chest is now " + status + ChatColor.RESET + ".");
 | 
					            plugin.sendMessage(player, "Silent Chest is now " + status + ChatColor.RESET + ".");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,9 +24,18 @@ import org.bukkit.entity.Player;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
import com.lishid.openinv.Permissions;
 | 
					import com.lishid.openinv.Permissions;
 | 
				
			||||||
 | 
					import com.lishid.openinv.Configuration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class ToggleOpenInvCommand implements CommandExecutor {
 | 
					public class ToggleOpenInvCommand implements CommandExecutor {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final OpenInv plugin;
 | 
				
			||||||
 | 
					    private final Configuration configuration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public ToggleOpenInvCommand(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					        configuration = plugin.getConfiguration();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
					    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
 | 
				
			||||||
        if (command.getName().equalsIgnoreCase("toggleopeninv")) {
 | 
					        if (command.getName().equalsIgnoreCase("toggleopeninv")) {
 | 
				
			||||||
@@ -44,16 +53,16 @@ public class ToggleOpenInvCommand implements CommandExecutor {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            if (args.length > 0) {
 | 
					            if (args.length > 0) {
 | 
				
			||||||
                if (args[0].equalsIgnoreCase("check")) {
 | 
					                if (args[0].equalsIgnoreCase("check")) {
 | 
				
			||||||
                    String status = OpenInv.getPlayerItemOpenInvStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
					                    String status = configuration.getPlayerItemOpenInvStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
				
			||||||
                    OpenInv.sendMessage(player, "OpenInv with " + ChatColor.GRAY + OpenInv.getOpenInvItem() + ChatColor.RESET + status + ChatColor.RESET + ".");
 | 
					                    plugin.sendMessage(player, "OpenInv with " + ChatColor.GRAY + configuration.getOpenInvItem() + ChatColor.RESET + status + ChatColor.RESET + ".");
 | 
				
			||||||
                    return true;
 | 
					                    return true;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            OpenInv.setPlayerItemOpenInvStatus(player, !OpenInv.getPlayerItemOpenInvStatus(player));
 | 
					            configuration.setPlayerItemOpenInvStatus(player, !configuration.getPlayerItemOpenInvStatus(player));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            String status = OpenInv.getPlayerItemOpenInvStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
					            String status = configuration.getPlayerItemOpenInvStatus(player) ? ChatColor.GREEN + "ON" : ChatColor.RED + "OFF";
 | 
				
			||||||
            OpenInv.sendMessage(player, "OpenInv with " + ChatColor.GRAY + OpenInv.getOpenInvItem() + ChatColor.RESET + " is now " + status + ChatColor.RESET + ".");
 | 
					            plugin.sendMessage(player, "OpenInv with " + ChatColor.GRAY + configuration.getOpenInvItem() + ChatColor.RESET + " is now " + status + ChatColor.RESET + ".");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,18 +18,34 @@ package com.lishid.openinv.internal;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import java.util.Iterator;
 | 
					import java.util.Iterator;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer;
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Volatile
 | 
					import net.minecraft.server.v1_9_R1.AxisAlignedBB;
 | 
				
			||||||
import net.minecraft.server.v1_9_R1.*;
 | 
					import net.minecraft.server.v1_9_R1.Block;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.BlockChest;
 | 
				
			||||||
import net.minecraft.server.v1_9_R1.BlockChest.Type;
 | 
					import net.minecraft.server.v1_9_R1.BlockChest.Type;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.BlockPosition;
 | 
				
			||||||
import org.bukkit.craftbukkit.v1_9_R1.entity.*;
 | 
					import net.minecraft.server.v1_9_R1.Entity;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.EntityOcelot;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.EntityPlayer;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.EnumDirection;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.ITileInventory;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.InventoryLargeChest;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.TileEntity;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.TileEntityChest;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.World;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class AnySilentChest {
 | 
					public class AnySilentChest {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final OpenInv plugin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public AnySilentChest(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public boolean isAnyChestNeeded(Player p, int x, int y, int z) {
 | 
					    public boolean isAnyChestNeeded(Player p, int x, int y, int z) {
 | 
				
			||||||
        // FOR REFERENCE, LOOK AT net.minecraft.server.BlockChest
 | 
					        // FOR REFERENCE, LOOK AT net.minecraft.server.BlockChest
 | 
				
			||||||
        BlockPosition position = new BlockPosition(x, y, z);
 | 
					        BlockPosition position = new BlockPosition(x, y, z);
 | 
				
			||||||
@@ -135,8 +151,8 @@ public class AnySilentChest {
 | 
				
			|||||||
        if (silentChest) {
 | 
					        if (silentChest) {
 | 
				
			||||||
            tileInventory = new SilentInventory(tileInventory);
 | 
					            tileInventory = new SilentInventory(tileInventory);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (OpenInv.notifySilentChest()) {
 | 
					            if (plugin.getConfiguration().notifySilentChest()) {
 | 
				
			||||||
                OpenInv.sendMessage(p, "You are opening a chest silently.");
 | 
					                plugin.sendMessage(p, "You are opening a chest silently.");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            returnValue = false;
 | 
					            returnValue = false;
 | 
				
			||||||
@@ -144,8 +160,8 @@ public class AnySilentChest {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        player.openContainer(tileInventory);
 | 
					        player.openContainer(tileInventory);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (anyChest && OpenInv.notifyAnyChest()) {
 | 
					        if (anyChest && plugin.getConfiguration().notifyAnyChest()) {
 | 
				
			||||||
            OpenInv.sendMessage(p, "You are opening a blocked chest.");
 | 
					            plugin.sendMessage(p, "You are opening a blocked chest.");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return returnValue;
 | 
					        return returnValue;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,19 +18,23 @@ package com.lishid.openinv.internal;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import java.lang.reflect.Field;
 | 
					import java.lang.reflect.Field;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.bukkit.craftbukkit.v1_9_R1.inventory.CraftInventory;
 | 
				
			||||||
import org.bukkit.entity.HumanEntity;
 | 
					import org.bukkit.entity.HumanEntity;
 | 
				
			||||||
import org.bukkit.inventory.Inventory;
 | 
					import org.bukkit.inventory.Inventory;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
import com.lishid.openinv.Permissions;
 | 
					import com.lishid.openinv.Permissions;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Volatile
 | 
					import net.minecraft.server.v1_9_R1.IInventory;
 | 
				
			||||||
import net.minecraft.server.v1_9_R1.*;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import org.bukkit.craftbukkit.v1_9_R1.inventory.*;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class InventoryAccess {
 | 
					public class InventoryAccess {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final OpenInv plugin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public InventoryAccess(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public boolean check(Inventory inventory, HumanEntity player) {
 | 
					    public boolean check(Inventory inventory, HumanEntity player) {
 | 
				
			||||||
        IInventory inv = grabInventory(inventory);
 | 
					        IInventory inv = grabInventory(inventory);
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
@@ -64,7 +68,7 @@ public class InventoryAccess {
 | 
				
			|||||||
                try {
 | 
					                try {
 | 
				
			||||||
                    result = (IInventory) f.get(inventory);
 | 
					                    result = (IInventory) f.get(inventory);
 | 
				
			||||||
                } catch (Exception e) {
 | 
					                } catch (Exception e) {
 | 
				
			||||||
                    OpenInv.log(e);
 | 
					                    plugin.log(e);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,18 +20,24 @@ import java.util.UUID;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import org.bukkit.Bukkit;
 | 
					import org.bukkit.Bukkit;
 | 
				
			||||||
import org.bukkit.OfflinePlayer;
 | 
					import org.bukkit.OfflinePlayer;
 | 
				
			||||||
 | 
					import org.bukkit.craftbukkit.v1_9_R1.CraftServer;
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
import com.mojang.authlib.GameProfile;
 | 
					import com.mojang.authlib.GameProfile;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Volatile
 | 
					import net.minecraft.server.v1_9_R1.EntityPlayer;
 | 
				
			||||||
import net.minecraft.server.v1_9_R1.*;
 | 
					import net.minecraft.server.v1_9_R1.MinecraftServer;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.PlayerInteractManager;
 | 
				
			||||||
import org.bukkit.craftbukkit.v1_9_R1.*;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class PlayerDataManager {
 | 
					public class PlayerDataManager {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private OpenInv plugin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public PlayerDataManager(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public Player loadPlayer(UUID uuid) {
 | 
					    public Player loadPlayer(UUID uuid) {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
 | 
					            OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
 | 
				
			||||||
@@ -55,7 +61,7 @@ public class PlayerDataManager {
 | 
				
			|||||||
                return target;
 | 
					                return target;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } catch (Exception e) {
 | 
					        } catch (Exception e) {
 | 
				
			||||||
            OpenInv.log(e);
 | 
					            plugin.log(e);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return null;
 | 
					        return null;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,8 +16,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
package com.lishid.openinv.internal;
 | 
					package com.lishid.openinv.internal;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Volatile
 | 
					import net.minecraft.server.v1_9_R1.ContainerChest;
 | 
				
			||||||
import net.minecraft.server.v1_9_R1.*;
 | 
					import net.minecraft.server.v1_9_R1.EntityHuman;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.IInventory;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class SilentContainerChest extends ContainerChest {
 | 
					public class SilentContainerChest extends ContainerChest {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,8 +7,14 @@ import org.bukkit.craftbukkit.v1_9_R1.entity.CraftHumanEntity;
 | 
				
			|||||||
import org.bukkit.entity.HumanEntity;
 | 
					import org.bukkit.entity.HumanEntity;
 | 
				
			||||||
import org.bukkit.inventory.InventoryHolder;
 | 
					import org.bukkit.inventory.InventoryHolder;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Volatile
 | 
					import net.minecraft.server.v1_9_R1.ChestLock;
 | 
				
			||||||
import net.minecraft.server.v1_9_R1.*;
 | 
					import net.minecraft.server.v1_9_R1.Container;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.ContainerChest;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.EntityHuman;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.IChatBaseComponent;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.ITileInventory;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.ItemStack;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_9_R1.PlayerInventory;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class SilentInventory implements ITileInventory {
 | 
					public class SilentInventory implements ITileInventory {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,17 +16,17 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
package com.lishid.openinv.internal;
 | 
					package com.lishid.openinv.internal;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.bukkit.craftbukkit.v1_9_R1.entity.CraftHumanEntity;
 | 
				
			||||||
 | 
					import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer;
 | 
				
			||||||
 | 
					import org.bukkit.craftbukkit.v1_9_R1.inventory.CraftInventory;
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
import org.bukkit.inventory.Inventory;
 | 
					import org.bukkit.inventory.Inventory;
 | 
				
			||||||
import org.bukkit.inventory.InventoryHolder;
 | 
					import org.bukkit.inventory.InventoryHolder;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Volatile
 | 
					import net.minecraft.server.v1_9_R1.InventoryEnderChest;
 | 
				
			||||||
import net.minecraft.server.v1_9_R1.*;
 | 
					import net.minecraft.server.v1_9_R1.InventorySubcontainer;
 | 
				
			||||||
 | 
					 | 
				
			||||||
import org.bukkit.craftbukkit.v1_9_R1.entity.*;
 | 
					 | 
				
			||||||
import org.bukkit.craftbukkit.v1_9_R1.inventory.*;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class SpecialEnderChest extends InventorySubcontainer {
 | 
					public class SpecialEnderChest extends InventorySubcontainer {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,8 +25,18 @@ import org.bukkit.event.Listener;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
import com.lishid.openinv.Permissions;
 | 
					import com.lishid.openinv.Permissions;
 | 
				
			||||||
 | 
					import com.lishid.openinv.Configuration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class OpenInvEntityListener implements Listener {
 | 
					public class OpenInvEntityListener implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final OpenInv plugin;
 | 
				
			||||||
 | 
					    private final Configuration configuration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public OpenInvEntityListener(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					        configuration = plugin.getConfiguration();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @EventHandler(priority = EventPriority.LOWEST)
 | 
					    @EventHandler(priority = EventPriority.LOWEST)
 | 
				
			||||||
    public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
 | 
					    public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
 | 
				
			||||||
        Entity attacker = event.getDamager();
 | 
					        Entity attacker = event.getDamager();
 | 
				
			||||||
@@ -38,8 +48,8 @@ public class OpenInvEntityListener implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        Player player = (Player) attacker;
 | 
					        Player player = (Player) attacker;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (player.getInventory().getItemInMainHand().getType() == OpenInv.getOpenInvItem()) {
 | 
					        if (player.getInventory().getItemInMainHand().getType() == configuration.getOpenInvItem()) {
 | 
				
			||||||
            if (!OpenInv.getPlayerItemOpenInvStatus(player) || !OpenInv.hasPermission(player, Permissions.PERM_OPENINV)) {
 | 
					            if (!configuration.getPlayerItemOpenInvStatus(player) || !OpenInv.hasPermission(player, Permissions.PERM_OPENINV)) {
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,12 +25,19 @@ import org.bukkit.inventory.Inventory;
 | 
				
			|||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class OpenInvInventoryListener implements Listener {
 | 
					public class OpenInvInventoryListener implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final OpenInv plugin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public OpenInvInventoryListener(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @EventHandler
 | 
					    @EventHandler
 | 
				
			||||||
    public void onInventoryClick(InventoryClickEvent event) {
 | 
					    public void onInventoryClick(InventoryClickEvent event) {
 | 
				
			||||||
        Inventory inventory = event.getInventory();
 | 
					        Inventory inventory = event.getInventory();
 | 
				
			||||||
        HumanEntity player = event.getWhoClicked();
 | 
					        HumanEntity player = event.getWhoClicked();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!OpenInv.getInventoryAccess().check(inventory, player)) {
 | 
					        if (!plugin.getInventoryAccess().check(inventory, player)) {
 | 
				
			||||||
            event.setCancelled(true);
 | 
					            event.setCancelled(true);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,10 +33,20 @@ import org.bukkit.event.player.PlayerQuitEvent;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.OpenInv;
 | 
					import com.lishid.openinv.OpenInv;
 | 
				
			||||||
import com.lishid.openinv.Permissions;
 | 
					import com.lishid.openinv.Permissions;
 | 
				
			||||||
 | 
					import com.lishid.openinv.Configuration;
 | 
				
			||||||
import com.lishid.openinv.internal.SpecialEnderChest;
 | 
					import com.lishid.openinv.internal.SpecialEnderChest;
 | 
				
			||||||
import com.lishid.openinv.internal.SpecialPlayerInventory;
 | 
					import com.lishid.openinv.internal.SpecialPlayerInventory;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class OpenInvPlayerListener implements Listener {
 | 
					public class OpenInvPlayerListener implements Listener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final OpenInv plugin;
 | 
				
			||||||
 | 
					    private final Configuration configuration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public OpenInvPlayerListener(OpenInv plugin) {
 | 
				
			||||||
 | 
					        this.plugin = plugin;
 | 
				
			||||||
 | 
					        configuration = plugin.getConfiguration();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @EventHandler(priority = EventPriority.LOWEST)
 | 
					    @EventHandler(priority = EventPriority.LOWEST)
 | 
				
			||||||
    public void onPlayerJoin(PlayerJoinEvent event) {
 | 
					    public void onPlayerJoin(PlayerJoinEvent event) {
 | 
				
			||||||
        Player player = event.getPlayer();
 | 
					        Player player = event.getPlayer();
 | 
				
			||||||
@@ -86,7 +96,7 @@ public class OpenInvPlayerListener implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                // Ender Chests
 | 
					                // Ender Chests
 | 
				
			||||||
                if (block.getType() == Material.ENDER_CHEST) {
 | 
					                if (block.getType() == Material.ENDER_CHEST) {
 | 
				
			||||||
                    if (OpenInv.hasPermission(player, Permissions.PERM_SILENT) && OpenInv.getPlayerSilentChestStatus(player)) {
 | 
					                    if (OpenInv.hasPermission(player, Permissions.PERM_SILENT) && configuration.getPlayerSilentChestStatus(player)) {
 | 
				
			||||||
                        event.setCancelled(true);
 | 
					                        event.setCancelled(true);
 | 
				
			||||||
                        player.openInventory(player.getEnderChest());
 | 
					                        player.openInventory(player.getEnderChest());
 | 
				
			||||||
                        return;
 | 
					                        return;
 | 
				
			||||||
@@ -101,13 +111,13 @@ public class OpenInvPlayerListener implements Listener {
 | 
				
			|||||||
                    int y = block.getY();
 | 
					                    int y = block.getY();
 | 
				
			||||||
                    int z = block.getZ();
 | 
					                    int z = block.getZ();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (OpenInv.hasPermission(player, Permissions.PERM_SILENT) && OpenInv.getPlayerSilentChestStatus(player)) {
 | 
					                    if (OpenInv.hasPermission(player, Permissions.PERM_SILENT) && configuration.getPlayerSilentChestStatus(player)) {
 | 
				
			||||||
                        silentChest = true;
 | 
					                        silentChest = true;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (OpenInv.hasPermission(player, Permissions.PERM_ANYCHEST) && OpenInv.getPlayerAnyChestStatus(player)) {
 | 
					                    if (OpenInv.hasPermission(player, Permissions.PERM_ANYCHEST) && configuration.getPlayerAnyChestStatus(player)) {
 | 
				
			||||||
                        try {
 | 
					                        try {
 | 
				
			||||||
                            anyChest = OpenInv.getAnySilentChest().isAnyChestNeeded(player, x, y, z);
 | 
					                            anyChest = plugin.getAnySilentChest().isAnyChestNeeded(player, x, y, z);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        catch (Exception e) {
 | 
					                        catch (Exception e) {
 | 
				
			||||||
                            player.sendMessage(ChatColor.RED + "Error while executing openinv. Unsupported CraftBukkit.");
 | 
					                            player.sendMessage(ChatColor.RED + "Error while executing openinv. Unsupported CraftBukkit.");
 | 
				
			||||||
@@ -117,7 +127,7 @@ public class OpenInvPlayerListener implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                    // If the anyChest or silentChest is active
 | 
					                    // If the anyChest or silentChest is active
 | 
				
			||||||
                    if (anyChest || silentChest) {
 | 
					                    if (anyChest || silentChest) {
 | 
				
			||||||
                        if (!OpenInv.getAnySilentChest().activateChest(player, anyChest, silentChest, x, y, z)) {
 | 
					                        if (!plugin.getAnySilentChest().activateChest(player, anyChest, silentChest, x, y, z)) {
 | 
				
			||||||
                            event.setCancelled(true);
 | 
					                            event.setCancelled(true);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
@@ -128,7 +138,7 @@ public class OpenInvPlayerListener implements Listener {
 | 
				
			|||||||
                // Signs
 | 
					                // Signs
 | 
				
			||||||
                if (block.getState() instanceof Sign) {
 | 
					                if (block.getState() instanceof Sign) {
 | 
				
			||||||
                    try {
 | 
					                    try {
 | 
				
			||||||
                        Sign sign = ((Sign) block.getState());
 | 
					                        Sign sign = (Sign) block.getState();
 | 
				
			||||||
                        if (OpenInv.hasPermission(player, Permissions.PERM_OPENINV) && sign.getLine(0).equalsIgnoreCase("[openinv]")) {
 | 
					                        if (OpenInv.hasPermission(player, Permissions.PERM_OPENINV) && sign.getLine(0).equalsIgnoreCase("[openinv]")) {
 | 
				
			||||||
                            String text = sign.getLine(1).trim() + sign.getLine(2).trim() + sign.getLine(3).trim();
 | 
					                            String text = sign.getLine(1).trim() + sign.getLine(2).trim() + sign.getLine(3).trim();
 | 
				
			||||||
                            player.performCommand("openinv " + text);
 | 
					                            player.performCommand("openinv " + text);
 | 
				
			||||||
@@ -143,7 +153,7 @@ public class OpenInvPlayerListener implements Listener {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            case RIGHT_CLICK_AIR:
 | 
					            case RIGHT_CLICK_AIR:
 | 
				
			||||||
                // OpenInv item
 | 
					                // OpenInv item
 | 
				
			||||||
                if (player.getInventory().getItemInMainHand().getType() == OpenInv.getOpenInvItem() && OpenInv.getPlayerItemOpenInvStatus(player) && OpenInv.hasPermission(player, Permissions.PERM_OPENINV)) {
 | 
					                if (player.getInventory().getItemInMainHand().getType() == configuration.getOpenInvItem() && configuration.getPlayerItemOpenInvStatus(player) && OpenInv.hasPermission(player, Permissions.PERM_OPENINV)) {
 | 
				
			||||||
                    player.performCommand("openinv");
 | 
					                    player.performCommand("openinv");
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@ name: OpenInv
 | 
				
			|||||||
main: com.lishid.openinv.OpenInv
 | 
					main: com.lishid.openinv.OpenInv
 | 
				
			||||||
version: 2.3.6
 | 
					version: 2.3.6
 | 
				
			||||||
author: lishid
 | 
					author: lishid
 | 
				
			||||||
 | 
					authors: [ShadowRanger]
 | 
				
			||||||
description: >
 | 
					description: >
 | 
				
			||||||
             This plugin allows you to open a player's inventory as a chest and interact with it in real time.
 | 
					             This plugin allows you to open a player's inventory as a chest and interact with it in real time.
 | 
				
			||||||
commands:
 | 
					commands:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user