Skip to content

Commit 8df82b6

Browse files
committed
Reorganize according to new Polyfrost code guidelines.
1 parent 3d94198 commit 8df82b6

File tree

7 files changed

+39
-44
lines changed

7 files changed

+39
-44
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.polyfrost.example;
2+
3+
public class ExampleConstants {
4+
5+
// Sets the variables from `gradle.properties`. Depends on the `bloom` DGT plugin.
6+
public static final String ID = "@MOD_ID@";
7+
public static final String NAME = "@MOD_NAME@";
8+
public static final String VERSION = "@MOD_VERSION@";
9+
10+
}

src/main/java/org/polyfrost/example/ExampleMod.java

-33
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package org.polyfrost.example.client;
2+
3+
import net.fabricmc.api.ClientModInitializer;
4+
import org.polyfrost.oneconfig.api.commands.v1.CommandManager;
5+
6+
public class ExampleClient implements ClientModInitializer {
7+
8+
public static ExampleClient INSTANCE;
9+
10+
public ExampleClient() {
11+
INSTANCE = this;
12+
}
13+
14+
@Override
15+
public void onInitializeClient() {
16+
ExampleConfig.INSTANCE.preload();
17+
CommandManager.registerCommand(new ExampleCommand());
18+
}
19+
20+
}

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
package org.polyfrost.example.command;
1+
package org.polyfrost.example.client;
22

3-
import org.polyfrost.example.ExampleMod;
4-
import org.polyfrost.example.config.ExampleConfig;
3+
import org.polyfrost.example.ExampleConstants;
54
import org.polyfrost.oneconfig.api.commands.v1.factories.annotated.Command;
65
import org.polyfrost.oneconfig.utils.v1.dsl.ScreensKt;
76

@@ -10,9 +9,9 @@
109
* Registered in ExampleMod.java with `CommandManager.INSTANCE.registerCommand(new ExampleCommand());`
1110
*
1211
* @see Command
13-
* @see ExampleMod
12+
* @see ExampleClient
1413
*/
15-
@Command(value = ExampleMod.ID, description = "Access the " + ExampleMod.NAME + " GUI.")
14+
@Command(value = ExampleConstants.ID, description = "Access the " + ExampleConstants.NAME + " GUI.")
1615
public class ExampleCommand {
1716

1817
@Command

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package org.polyfrost.example.config;
1+
package org.polyfrost.example.client;
22

3-
import org.polyfrost.example.ExampleMod;
3+
import org.polyfrost.example.ExampleConstants;
44
import org.polyfrost.oneconfig.api.config.v1.Config;
55
import org.polyfrost.oneconfig.api.config.v1.annotations.Dropdown;
66
import org.polyfrost.oneconfig.api.config.v1.annotations.Slider;
@@ -31,8 +31,7 @@ public class ExampleConfig extends Config {
3131
public static final ExampleConfig INSTANCE = new ExampleConfig(); // The instance of the config.
3232

3333
public ExampleConfig() {
34-
super(ExampleMod.ID + ".json", ExampleMod.NAME, Category.OTHER); // TODO: Change your category here.
34+
super(ExampleConstants.ID + ".json", ExampleConstants.NAME, Category.OTHER); // TODO: Change your category here.
3535
}
3636

3737
}
38-

src/main/java/org/polyfrost/example/hud/ExampleHud.java src/main/java/org/polyfrost/example/client/ExampleHud.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.polyfrost.example.hud;
1+
package org.polyfrost.example.client;
22

33
// TODO: for nextdayy
44
public class ExampleHud {

src/main/resources/fabric.mod.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"entrypoints": {
1212
"client": [
1313
{
14-
"value": "org.polyfrost.example.ExampleMod"
14+
"value": "org.polyfrost.example.client.ExampleClient"
1515
}
1616
]
1717
},

0 commit comments

Comments
 (0)