All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.hendrixshen.magiclib.mixin.minecraft.event.DedicatedServerMixin Maven / Gradle / Ivy

package top.hendrixshen.magiclib.mixin.minecraft.event;

import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import net.minecraft.server.dedicated.DedicatedServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import top.hendrixshen.magiclib.impl.event.EventManager;
import top.hendrixshen.magiclib.impl.event.minecraft.DedicatedServerEvent.PostInitEvent;

@OnlyIn(Dist.DEDICATED_SERVER)
@Mixin(DedicatedServer.class)
public class DedicatedServerMixin {
    @Inject(
            method = "initServer",
            at = @At(
                    "TAIL"
            )
    )
    private void postInitServer(CallbackInfoReturnable cir) {
        EventManager.dispatch(new PostInitEvent());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy