Added config header
- Cache hocon builder
This commit is contained in:
parent
914e15ff70
commit
4ee6e847e9
@ -14,10 +14,20 @@ import org.spongepowered.configurate.objectmapping.ConfigSerializable;
|
|||||||
import org.spongepowered.configurate.objectmapping.meta.Comment;
|
import org.spongepowered.configurate.objectmapping.meta.Comment;
|
||||||
|
|
||||||
public class AuthMeConfig {
|
public class AuthMeConfig {
|
||||||
|
private static final String HEADER = """
|
||||||
|
AuthmeVelocity Proxy
|
||||||
|
|
||||||
|
Original Developer: xQuickGlare
|
||||||
|
Actual Developer: 4drian3d
|
||||||
|
""";
|
||||||
|
private static final HoconConfigurationLoader.Builder configBuilder = HoconConfigurationLoader.builder()
|
||||||
|
.defaultOptions(opts -> opts
|
||||||
|
.shouldCopyDefaults(true)
|
||||||
|
.header(HEADER)
|
||||||
|
);
|
||||||
public static void loadConfig(@NotNull Path path, @NotNull Logger logger){
|
public static void loadConfig(@NotNull Path path, @NotNull Logger logger){
|
||||||
File configFile = new File(path.toFile(), "config.conf");
|
File configFile = new File(path.toFile(), "config.conf");
|
||||||
final HoconConfigurationLoader loader = HoconConfigurationLoader.builder()
|
final HoconConfigurationLoader loader = configBuilder
|
||||||
.defaultOptions(opts -> opts.shouldCopyDefaults(true))
|
|
||||||
.file(configFile)
|
.file(configFile)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user