SteamWar/BauSystem
Archiviert
13
0

Allowing UserID as WorldName

Dieser Commit ist enthalten in:
Lixfel 2019-12-31 12:58:55 +01:00
Ursprung 574543c673
Commit a389fa9756

Datei anzeigen

@ -34,12 +34,17 @@ public class BauSystem extends JavaPlugin implements Listener {
public void onEnable() { public void onEnable() {
plugin = this; plugin = this;
String worldName = Bukkit.getWorlds().get(0).getName();
try{ try{
owner = UUID.fromString(Bukkit.getWorlds().get(0).getName()); owner = UUID.fromString(worldName);
}catch(IllegalArgumentException e){ }catch(IllegalArgumentException e){
getLogger().log(Level.SEVERE, "owner is no UUID", e); try{
Bukkit.shutdown(); owner = SteamwarUser.get(Integer.parseInt(worldName)).getUUID();
return; }catch(NumberFormatException ex){
getLogger().log(Level.SEVERE, "owner is no UUID", e);
Bukkit.shutdown();
return;
}
} }
try { try {