Skip to content

Commit e1c35d7

Browse files
committed
Clean up Velocity plugin class
1 parent 32b7eed commit e1c35d7

File tree

1 file changed

+5
-7
lines changed
  • commandapi-platforms/commandapi-velocity/commandapi-velocity-plugin/src/main/java/dev/jorel/commandapi

1 file changed

+5
-7
lines changed

commandapi-platforms/commandapi-velocity/commandapi-velocity-plugin/src/main/java/dev/jorel/commandapi/CommandAPIMain.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,17 @@ public class CommandAPIMain {
3939
public CommandAPIMain(ProxyServer server, Logger logger, @DataDirectory Path dataDirectory) {
4040
// Try to find the config file
4141
Path configFile = dataDirectory.resolve("config.yml");
42-
YamlConfigurationLoader loader = YamlConfigurationLoader.builder()
43-
.nodeStyle(NodeStyle.BLOCK)
44-
.path(configFile)
45-
.build();
4642

43+
// Create or update config
4744
new VelocityConfigurationAdapter(null, null, null).saveDefaultConfig(configFile.getParent().toFile(), configFile.toFile(), null);
4845

49-
// If the config doesn't exist, load it from the resources
50-
51-
5246
// Load the file as a yaml node
5347
ConfigurationNode configYAML;
5448
try {
49+
YamlConfigurationLoader loader = YamlConfigurationLoader.builder()
50+
.nodeStyle(NodeStyle.BLOCK)
51+
.path(configFile)
52+
.build();
5553
configYAML = loader.load();
5654
} catch (IOException e) {
5755
throw new RuntimeException(e);

0 commit comments

Comments
 (0)