Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void kit_save(Player player, String inventory) {
- if (!sectionExists(player.getUniqueId() + "." + inventory)){
- this.getConfig().createSection(player.getUniqueId() + "." + inventory);
- }else{
- ItemStack[] contents = player.getInventory().getContents();
- for (int i = 0; i < contents.length; i++) {
- if (contents[i] != null && contents[i].getType() != Material.AIR) {
- this.getConfig().set(player.getUniqueId() + "." + inventory + "." + i, contents[i]);
- }
- }
- this.getConfig().set(player.getUniqueId() + "." + inventory + ".armour.helmet", player.getInventory().getHelmet());
- this.getConfig().set(player.getUniqueId() + "." + inventory + ".armour.chestplate", player.getInventory().getChestplate());
- this.getConfig().set(player.getUniqueId() + "." + inventory + ".armour.leggings", player.getInventory().getLeggings());
- this.getConfig().set(player.getUniqueId() + "." + inventory + ".armour.boots", player.getInventory().getBoots());
- player.sendMessage(ChatColor.RED + "KIT: " + ChatColor.GRAY + "Saving kit " + ChatColor.AQUA + inventory);
- this.saveConfig();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement