Jump to content

Recommended Posts

Posted

hallo ich will ein player inv in einer datei abspeichern,und das geht ja auch aber das auslesen bereitet probleme 

	public void loadinv(Player p) {
		String uuid = p.getUniqueId().toString();
		File file = new File("plugins/System/XXX/" + uuid + ".yml");
		FileConfiguration conf = YamlConfiguration.loadConfiguration(file);
		
		ItemStack[] items = null;
		for(int i = 0; i<36;i++) {
			if(conf.contains("inv.Slot." + 1)) {
				items[i] = conf.getItemStack("inv.Slot." + i);
			}else {
				items[i] = new ItemStack(Material.AIR);
			}
		}
		
		p.getInventory().clear();
		p.getInventory().setContents(items);
		
	}

ich spichere die item so ab wie ich sie auslese und kann den Fehler einfach nicht finden vielleicht aber ihr?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
B
B