Skip to content

Commit

Permalink
Register config sync event bus in init (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfts authored Jan 19, 2025
1 parent 2752dc6 commit 6af1528
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
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

0 comments on commit 6af1528

Please sign in to comment.