Update ConfigUpdater
Dieser Commit ist enthalten in:
Ursprung
79ce8bc215
Commit
4bbb8a7abd
@ -9,6 +9,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import yapion.hierarchy.types.YAPIONObject;
|
||||
import yapion.parser.YAPIONParser;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -44,10 +45,20 @@ public class ConfigUpdater implements Listener {
|
||||
* @return the config object
|
||||
*/
|
||||
public YAPIONObject get(Player player) {
|
||||
if (!playerConfigurations.containsKey(player.getUniqueId())) {
|
||||
UUID uuid = player.getUniqueId();
|
||||
if (!playerConfigurations.containsKey(uuid)) {
|
||||
// TODO: Load call -> Database
|
||||
String s = null;
|
||||
YAPIONObject yapionObject;
|
||||
if (s == null) {
|
||||
yapionObject = ConfigCreator.createDefaultConfig();
|
||||
} else {
|
||||
yapionObject = YAPIONParser.parse(s);
|
||||
}
|
||||
return playerConfigurations.get(player.getUniqueId());
|
||||
playerConfigurations.put(uuid, yapionObject);
|
||||
return yapionObject;
|
||||
}
|
||||
return playerConfigurations.get(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -79,6 +79,9 @@ allprojects {
|
||||
|
||||
dependencies {
|
||||
implementation project(":BauSystem_Main")
|
||||
|
||||
// implementation 'org.slf4j:slf4j-log4j12:2.0.0-alpha1'
|
||||
// implementation 'org.slf4j:slf4j-nop:2.0.0-alpha1'
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren