Dieser Commit ist enthalten in:
Ursprung
92c4d7a7e2
Commit
2c58329ca2
@ -21,6 +21,7 @@ package de.steamwar.bausystem.config;
|
||||
|
||||
import de.steamwar.bausystem.linkage.LinkageType;
|
||||
import de.steamwar.bausystem.linkage.Linked;
|
||||
import de.steamwar.providers.BauServerInfo;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -35,30 +36,19 @@ public class BauServer {
|
||||
|
||||
public BauServer() {
|
||||
instance = this;
|
||||
|
||||
try {
|
||||
owner = UUID.fromString(Bukkit.getWorlds().get(0).getName());
|
||||
} catch (IllegalArgumentException e) {
|
||||
owner = null;
|
||||
}
|
||||
}
|
||||
|
||||
private UUID owner;
|
||||
private Integer owner;
|
||||
|
||||
public UUID getOwner() {
|
||||
//Lazy loading to improve startup time of the server in 1.15
|
||||
if (owner == null) {
|
||||
try {
|
||||
owner = SteamwarUser.get(Integer.parseInt(Bukkit.getWorlds().get(0).getName())).getUUID();
|
||||
} catch (NumberFormatException e) {
|
||||
Bukkit.shutdown();
|
||||
throw new SecurityException("owner is not a UserID", e);
|
||||
}
|
||||
}
|
||||
return owner;
|
||||
return SteamwarUser.get(getOwnerID()).getUUID();
|
||||
}
|
||||
|
||||
public int getOwnerID() {
|
||||
return SteamwarUser.get(getOwner()).getId();
|
||||
//Lazy loading to improve startup time of the server in 1.15
|
||||
if (owner == null) {
|
||||
owner = BauServerInfo.getOwnerId();
|
||||
}
|
||||
return owner;
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren