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

personthecat.catlib.mixin.WorldStemServerMixin Maven / Gradle / Ivy

Go to download

Utilities for serialization, commands, noise generation, IO, and some new data types.

The newest version!
package personthecat.catlib.mixin;

import com.mojang.datafixers.util.Pair;
import net.minecraft.class_5219;
import net.minecraft.class_5455;
import net.minecraft.class_6904;
import net.minecraft.class_6904.class_6907;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import personthecat.catlib.event.error.LibErrorContext;
import personthecat.catlib.event.lifecycle.GameReadyEvent;

@Mixin(class_6904.class)
public class WorldStemServerMixin {

    @ModifyVariable(method = "load", at = @At(value = "HEAD"), index = 2)
    private static class_6907 injectCatlibEvent(final class_6907 supplier) {
        return (manager, config) -> {
            final Pair ret = supplier.get(manager, config);
            modSetupComplete();
            return ret;
        };
    }

    private static void modSetupComplete() {
        LibErrorContext.outputServerErrors(true);
        GameReadyEvent.SERVER.invoker().run();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy