Skip to content

Commit

Permalink
put instance of config in the config class
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jan 1, 2025
1 parent 9d89f1c commit 36a5853
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
10 changes: 1 addition & 9 deletions src/main/java/org/polyfrost/example/client/ExampleClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@ public class ExampleClient {

public static final ExampleClient INSTANCE = new ExampleClient();

private ExampleConfig config;

public void initialize() {
System.out.println("Initializing Example Client");

config = new ExampleConfig();
ExampleConfig.INSTANCE.preload();
CommandManager.registerCommand(new ExampleCommand());
}

public ExampleConfig getConfig() {
return config;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ExampleCommand {

@Command
private void main() {
ScreensKt.openUI(ExampleClient.INSTANCE.getConfig());
ScreensKt.openUI(ExampleConfig.INSTANCE);
}

}
2 changes: 2 additions & 0 deletions src/main/java/org/polyfrost/example/client/ExampleConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class ExampleConfig extends Config {
)
public static int exampleDropdown = 1; // Default option (in this case "Option 2")

public static final ExampleConfig INSTANCE = new ExampleConfig(); // The instance of the Config.

public ExampleConfig() {
super(ExampleConstants.ID + ".json", ExampleConstants.NAME, Category.OTHER); // TODO: Change your category here.
}
Expand Down

0 comments on commit 36a5853

Please sign in to comment.