package jesse.keeblarcraft.EventMgr;

import jesse.CommonServerUtils;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.minecraft.server.MinecraftServer;

// This interface is responsible for the end tick of a server world event tick
public class ServerTickListener implements ServerTickEvents.EndTick {
    CommonServerUtils config = new CommonServerUtils();
    @Override
    public void onEndTick(MinecraftServer server) {
        if (server != null) {
            config.SetServerInstance(server);
        }
    }

    // Static method to register the server tick listener
    public static void InitializeServerTicks() {
        ServerTickEvents.END_SERVER_TICK.register(new ServerTickListener());
    }
}
