Fixing sections.yml
Dieser Commit ist enthalten in:
Ursprung
a389fa9756
Commit
94a138b9ec
@ -37,14 +37,21 @@ public class BauSystem extends JavaPlugin implements Listener {
|
||||
String worldName = Bukkit.getWorlds().get(0).getName();
|
||||
try{
|
||||
owner = UUID.fromString(worldName);
|
||||
sections = ArenaSection.loadFromFile(new File(Bukkit.getWorldContainer().getPath() + '/' + owner.toString() + "/sections.yml"));
|
||||
}catch(IllegalArgumentException e){
|
||||
try{
|
||||
owner = SteamwarUser.get(Integer.parseInt(worldName)).getUUID();
|
||||
}catch(NumberFormatException ex){
|
||||
getLogger().log(Level.SEVERE, "owner is no UUID", e);
|
||||
int ownerID = Integer.parseInt(worldName);
|
||||
owner = SteamwarUser.get(ownerID).getUUID();
|
||||
sections = ArenaSection.loadFromFile(new File(Bukkit.getWorldContainer().getPath() + '/' + ownerID + "/sections.yml"));
|
||||
}catch(NumberFormatException | IOException | InvalidConfigurationException ex){
|
||||
getLogger().log(Level.SEVERE, "owner is no UUID / failed to load sections.yml", e);
|
||||
Bukkit.shutdown();
|
||||
return;
|
||||
}
|
||||
} catch (InvalidConfigurationException | IOException e) {
|
||||
getLogger().log(Level.SEVERE, "Failed to load sections.yml", e);
|
||||
Bukkit.shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
@ -58,14 +65,6 @@ public class BauSystem extends JavaPlugin implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
sections = ArenaSection.loadFromFile(new File(Bukkit.getWorldContainer().getPath() + '/' + owner.toString() + "/sections.yml"));
|
||||
} catch (IOException | InvalidConfigurationException e) {
|
||||
getLogger().log(Level.SEVERE, "Failed to load sections.yml", e);
|
||||
Bukkit.shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
getCommand("trace").setExecutor(new CommandTrace());
|
||||
getCommand("nightvision").setExecutor(new CommandNV());
|
||||
getCommand("reset").setExecutor(new CommandReset());
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren