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