fix omega config class loading too early in static block, make modmenu dep transitive
This commit is contained in:
@@ -6,6 +6,7 @@ import draylar.omegaconfig.api.Comment;
|
|||||||
import draylar.omegaconfig.api.Config;
|
import draylar.omegaconfig.api.Config;
|
||||||
import draylar.omegaconfig.gson.SyncableExclusionStrategy;
|
import draylar.omegaconfig.gson.SyncableExclusionStrategy;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
|
import net.fabricmc.api.ModInitializer;
|
||||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
|
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
|
||||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
@@ -30,7 +31,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
public class OmegaConfig {
|
public class OmegaConfig implements ModInitializer {
|
||||||
|
|
||||||
public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
||||||
public static final Identifier CONFIG_SYNC_PACKET = new Identifier("omegaconfig", "sync");
|
public static final Identifier CONFIG_SYNC_PACKET = new Identifier("omegaconfig", "sync");
|
||||||
@@ -38,7 +39,8 @@ public class OmegaConfig {
|
|||||||
public static final Logger LOGGER = LogManager.getLogger();
|
public static final Logger LOGGER = LogManager.getLogger();
|
||||||
private static final List<Config> REGISTERED_CONFIGURATIONS = new ArrayList<>();
|
private static final List<Config> REGISTERED_CONFIGURATIONS = new ArrayList<>();
|
||||||
|
|
||||||
static {
|
@Override
|
||||||
|
public void onInitialize() {
|
||||||
ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> server.execute(() -> {
|
ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> server.execute(() -> {
|
||||||
PacketByteBuf packet = new PacketByteBuf(Unpooled.buffer());
|
PacketByteBuf packet = new PacketByteBuf(Unpooled.buffer());
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,11 @@
|
|||||||
"Draylar",
|
"Draylar",
|
||||||
"Frqnny"
|
"Frqnny"
|
||||||
],
|
],
|
||||||
|
"entrypoints": {
|
||||||
|
"main": [
|
||||||
|
"draylar.omegaconfig.OmegaConfig"
|
||||||
|
]
|
||||||
|
},
|
||||||
"contact": {
|
"contact": {
|
||||||
"homepage": "https://github.com/Draylar/omega-config",
|
"homepage": "https://github.com/Draylar/omega-config",
|
||||||
"sources": "https://github.com/Draylar/omega-config",
|
"sources": "https://github.com/Draylar/omega-config",
|
||||||
|
|||||||
@@ -14,8 +14,12 @@ dependencies {
|
|||||||
implementation project(":omega-config-base")
|
implementation project(":omega-config-base")
|
||||||
|
|
||||||
// Mod Menu
|
// Mod Menu
|
||||||
modRuntimeOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
|
modCompileOnly ("com.terraformersmc:modmenu:${project.modmenu_version}") {
|
||||||
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
|
transitive(false)
|
||||||
|
}
|
||||||
|
modRuntime ("com.terraformersmc:modmenu:${project.modmenu_version}") {
|
||||||
|
transitive(false)
|
||||||
|
}
|
||||||
|
|
||||||
// Cloth Config Lite
|
// Cloth Config Lite
|
||||||
include "me.shedaniel.cloth:cloth-config-lite-fabric:2.0.6"
|
include "me.shedaniel.cloth:cloth-config-lite-fabric:2.0.6"
|
||||||
|
|||||||
Reference in New Issue
Block a user