Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.leluckyyde.test.utils;
- import org.bukkit.configuration.file.YamlConfiguration;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.ItemStack;
- import java.io.File;
- import java.io.IOException;
- import java.util.HashMap;
- public class Inventory {
- public static void saveInventoryByLeave(Player player, File file) throws IOException {
- if (file.exists()) {
- YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
- cfg.set("Items", player.getInventory().getContents());
- cfg.set("Armor", player.getInventory().getArmorContents());
- cfg.save(file);
- player.getInventory().clear();
- player.getInventory().setArmorContents(null);
- }
- }
- public static void getInventoryByJoin(Player player, File file) {
- if (file.exists()) {
- YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment