Hey Leute, ich habe ein kleines Problem mit dem Speichern meiner HashMap.
Meine onEnable Methode:
Meine onDisable Methode:
SpawnL.class
Spawn.class
Die Fehlermeldung:
http://pastebin.com/sqHaZPVn
Hoffe jmd kann mir helfen :/
Danke schön an alle Antworter
Meine onEnable Methode:
Code:
try {
SpawnL.load(this.Lobby, "plugins/MineLeague/lobby.bin");
} catch (Exception lex) {
lex.printStackTrace();
}
Meine onDisable Methode:
Code:
try {
SpawnL.save(this.Lobby, "plugins/MineLeague/lobby.bin");
}
catch (Exception localException) {
}
SpawnL.class
Code:
public class SpawnL
{
public static void save(HashMap<String, Spawn> Lobby, String path)
throws Exception
{
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(path));
oos.writeObject(Lobby);
oos.flush();
oos.close();
}
public static Object load(HashMap<String, Spawn> Lobby,String path) throws Exception {
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(path));
Object result = ois.readObject();
ois.close();
return result;
}
}
Spawn.class
Code:
public class Spawn
implements Serializable
{
private static final long serialVersionUID = 1L;
int x;
int y;
int z;
World world;
public Spawn(Location loc)
{
this.x = loc.getBlockX();
this.y = loc.getBlockY();
this.z = loc.getBlockZ();
this.world = loc.getWorld();
}
public Location getLocation() {
Location loc = new Location(this.world, this.x, this.y, this.z);
return loc;
}
}
Die Fehlermeldung:
http://pastebin.com/sqHaZPVn
Hoffe jmd kann mir helfen :/
Danke schön an alle Antworter