mirror of
https://github.com/GTNewHorizons/GTNHLib.git
synced 2026-11-26 14:53:14 +00:00
Register config sync event bus in init (#103)
This commit is contained in:
2 files changed
+2
-5
No files matched your search
@@ -10,7 +10,6 @@ import net.minecraft.server.integrated.IntegratedServer;
|
||||
|
||||
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;
|
||||
@@ -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;
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.apache.logging.log4j.Logger;
|
||||
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;
|
||||
@@ -490,6 +491,7 @@ public class ConfigurationManager {
|
||||
}
|
||||
|
||||
public static void onInit() {
|
||||
FMLCommonHandler.instance().bus().register(new ConfigSyncHandler());
|
||||
cullDeadCategories();
|
||||
if (DUMP_KEYS) {
|
||||
writeLangKeysToFile();
|
||||
|
||||
Reference in new issue
Block a user