package info.tehnut.xtones.network;

import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import org.checkerframework.checker.nullness.qual.Nullable;
import info.tehnut.xtones.client.XtonesClient;

final class ConfigSyncHandler implements IMessageHandler<ConfigSyncMessage, IMessage> {
    static final ConfigSyncHandler INSTANCE = new ConfigSyncHandler();

    private ConfigSyncHandler() {
    }

    private static void readConfig(final ConfigSyncMessage config) {
        XtonesClient.setServerXtoneCycling(config.hasXtoneCycling());
    }

    @Override
    @Nullable
    public IMessage onMessage(final ConfigSyncMessage config, final MessageContext context) {
        FMLCommonHandler.instance().getMinecraftServerInstance().addScheduledTask(() -> readConfig(config));
        return null;
    }
}

@@ -41,54 +41,85 @@
 ort 
-net.minecraftforge.fml.common.FMLCommonHandler
+info.tehnut.xtones.client.XtonesClient;%0Aimport net.minecraft.client.Minecraft
 ;%0Aim
@@ -390,55 +390,8 @@
 ble;
-%0Aimport info.tehnut.xtones.client.XtonesClient;
 %0A%0Afi
@@ -869,62 +869,30 @@
     
-FMLCommonHandler.instance().getMinecraftServerInstance
+Minecraft.getMinecraft
 ().a

Fix config sync handling not using client task scheduler