Skip to content

Commit 36a5853

Browse files
committed
put instance of config in the config class
1 parent 9d89f1c commit 36a5853

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

src/main/java/org/polyfrost/example/client/ExampleClient.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,9 @@ public class ExampleClient {
66

77
public static final ExampleClient INSTANCE = new ExampleClient();
88

9-
private ExampleConfig config;
10-
119
public void initialize() {
12-
System.out.println("Initializing Example Client");
13-
14-
config = new ExampleConfig();
10+
ExampleConfig.INSTANCE.preload();
1511
CommandManager.registerCommand(new ExampleCommand());
1612
}
1713

18-
public ExampleConfig getConfig() {
19-
return config;
20-
}
21-
2214
}

src/main/java/org/polyfrost/example/client/ExampleCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class ExampleCommand {
1616

1717
@Command
1818
private void main() {
19-
ScreensKt.openUI(ExampleClient.INSTANCE.getConfig());
19+
ScreensKt.openUI(ExampleConfig.INSTANCE);
2020
}
2121

2222
}

src/main/java/org/polyfrost/example/client/ExampleConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class ExampleConfig extends Config {
2828
)
2929
public static int exampleDropdown = 1; // Default option (in this case "Option 2")
3030

31+
public static final ExampleConfig INSTANCE = new ExampleConfig(); // The instance of the Config.
32+
3133
public ExampleConfig() {
3234
super(ExampleConstants.ID + ".json", ExampleConstants.NAME, Category.OTHER); // TODO: Change your category here.
3335
}

0 commit comments

Comments
 (0)