Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register config sync event bus in init #103

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import com.gtnewhorizon.gtnhlib.network.NetworkHandler;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.common.network.FMLNetworkEvent;
Expand All @@ -23,10 +22,6 @@ public final class ConfigSyncHandler {
static final Map<String, SyncedConfigElement> syncedElements = new Object2ObjectOpenHashMap<>();
private static boolean hasSyncedValues = false;

static {
FMLCommonHandler.instance().bus().register(new ConfigSyncHandler());
}

@SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) {
if (!(event.player instanceof EntityPlayerMP playerMP)) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.jetbrains.annotations.NotNull;

import cpw.mods.fml.client.config.IConfigElement;
import cpw.mods.fml.common.FMLCommonHandler;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.val;
Expand Down Expand Up @@ -490,6 +491,7 @@ static Class<?>[] getConfigClasses(String modid) {
}

public static void onInit() {
FMLCommonHandler.instance().bus().register(new ConfigSyncHandler());
cullDeadCategories();
if (DUMP_KEYS) {
writeLangKeysToFile();
Expand Down