Add VaultHolder class for detection from other plugins
Prior to this commit plugins could not (easily) detect if an inventory a player is using is a Player Vault inventory. This commit changes that by assigning a "VaultHolder" to an inventory when it is created. This new holder allows for plugins to easily detect if the inventory is a player vault due to the new VaultHolder class. The VaultHolder also holds information such as the vault number. The vault number is required for further handling of the vault. Without this addition plugins, such as AntiShare, cannot correctly handle a vault.
This commit is contained in:
@@ -73,7 +73,9 @@ public class Serialization {
|
||||
}
|
||||
|
||||
public static Inventory toInventory(List<String> stringItems, int number, boolean large) {
|
||||
Inventory inv = Bukkit.createInventory(null, (large) ? 54 : 27, ChatColor.RED + "Vault #" + number);
|
||||
VaultHolder holder = new VaultHolder(number);
|
||||
Inventory inv = Bukkit.createInventory(holder, (large) ? 54 : 27, ChatColor.RED + "Vault #" + number);
|
||||
holder.setInventory(inv);
|
||||
List<ItemStack> contents = new ArrayList<ItemStack>();
|
||||
for(String piece:stringItems) {
|
||||
if (piece.equalsIgnoreCase("null")) {
|
||||
|
||||
Reference in New Issue
Block a user