SteamWar/BauSystem2.0
Archiviert
12
0

Update ConfigUpdater

Dieser Commit ist enthalten in:
yoyosource 2021-04-30 21:02:58 +02:00
Ursprung 79ce8bc215
Commit 4bbb8a7abd
2 geänderte Dateien mit 16 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -9,6 +9,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import yapion.hierarchy.types.YAPIONObject; import yapion.hierarchy.types.YAPIONObject;
import yapion.parser.YAPIONParser;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -44,10 +45,20 @@ public class ConfigUpdater implements Listener {
* @return the config object * @return the config object
*/ */
public YAPIONObject get(Player player) { public YAPIONObject get(Player player) {
if (!playerConfigurations.containsKey(player.getUniqueId())) { UUID uuid = player.getUniqueId();
if (!playerConfigurations.containsKey(uuid)) {
// TODO: Load call -> Database // TODO: Load call -> Database
String s = null;
YAPIONObject yapionObject;
if (s == null) {
yapionObject = ConfigCreator.createDefaultConfig();
} else {
yapionObject = YAPIONParser.parse(s);
}
playerConfigurations.put(uuid, yapionObject);
return yapionObject;
} }
return playerConfigurations.get(player.getUniqueId()); return playerConfigurations.get(uuid);
} }
/** /**

Datei anzeigen

@ -79,6 +79,9 @@ allprojects {
dependencies { dependencies {
implementation project(":BauSystem_Main") implementation project(":BauSystem_Main")
// implementation 'org.slf4j:slf4j-log4j12:2.0.0-alpha1'
// implementation 'org.slf4j:slf4j-nop:2.0.0-alpha1'
} }
processResources { processResources {