-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathConfigReader.java
37 lines (32 loc) · 1.28 KB
/
ConfigReader.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Copyright (c) 2021-2025 GeyserMC
* Licensed under the MIT license
* @link https://github.com/GeyserMC/GlobalLinkServer
*/
package org.geysermc.globallinkserver.config;
import org.bukkit.plugin.java.JavaPlugin;
public class ConfigReader {
public static Config readConfig(JavaPlugin plugin) {
plugin.saveDefaultConfig();
var config = plugin.getConfig();
plugin.saveConfig();
var database = config.getConfigurationSection("database");
var util = config.getConfigurationSection("util");
return new Config(new Config.Database(
database.getString("hostname"),
database.getString("username"),
database.getString("password"),
database.getString("database")
), new Config.Util(
util.getBoolean("hide-join-leave-messages"),
util.getBoolean("hide-death-messages"),
util.getBoolean("hide-players"),
util.getBoolean("disable-chat"),
util.getBoolean("void-teleport"),
util.getBoolean("prevent-hunger"),
util.getBoolean("respawn-on-join"),
util.getBoolean("hide-player-count"),
util.getBoolean("disable-recipe-discover")
));
}
}