drtshock / PlayerVaults

Player vaults for player players.
GNU General Public License v3.0
89 stars 123 forks source link

Magic (plugin) doesn't work with playervaults (with fix) #395

Closed Floffah closed 4 years ago

Floffah commented 5 years ago

PlayerVaultsX Version

Run /version playervaults and give us your output. The latest from this repo (pom.xml says 4.1.4)

Server Version

Run /version and give us your output. Latest paper build #172 (not an issue that is the build number) (but the issue was tested on the latest spigot too)

Logs

Give use your logs by going to logs/latest.log. i don't have access

Details

Please explain the problem. When a user puts a magic wand into a player vault they can't open the pv unless someone removes it from their user data

i had to create a fix for my server. i changed saveVault in listeners/Listeners to

public void saveVault(Player player, Inventory inventory) {
        if (plugin.getInVault().containsKey(player.getUniqueId().toString())) {

            Inventory inv = Bukkit.createInventory(null, 6 * 9);
            inv.setContents(inventory.getContents().clone());
            ItemStack[] stacks = inv.getContents();
            for (int i = 0; i < stacks.length; ++i) {
                ItemStack item = stacks[i];
                if (item != null) {
                    if (item.getType().equals(Material.WOODEN_HOE)) {
                        stacks[i] = null;
                        player.getInventory().addItem(item);
                        player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&4Due to conflicts in plugins, you can no longer put wands in chests."));
                    }
                }
            }
            inv.setContents(stacks);
            if (inventory.getViewers().size() == 1) {
                VaultViewInfo info = plugin.getInVault().get(player.getUniqueId().toString());
                vaultManager.saveVault(inv, info.getVaultName(), info.getNumber());
                plugin.getOpenInventories().remove(info.toString());
            }

            plugin.getInVault().remove(player.getUniqueId().toString());
        }
    }
Hellcode48 commented 5 years ago

I don't seem to get this issue, odd

Floffah commented 5 years ago

turns out the wands came from magic not slimefun big oof but it still doesn't work and the fix works for me

CmdrKittens commented 4 years ago

This should be resolved in 4.1.6, if you're able to test it.