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;
|
||||
|
||||
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){
|
||||
File configFile = new File(path.toFile(), "config.conf");
|
||||
final HoconConfigurationLoader loader = HoconConfigurationLoader.builder()
|
||||
.defaultOptions(opts -> opts.shouldCopyDefaults(true))
|
||||
final HoconConfigurationLoader loader = configBuilder
|
||||
.file(configFile)
|
||||
.build();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user