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

top.hendrixshen.magiclib.mixin.dev.threadtweak.DataFixersMixin Maven / Gradle / Ivy

The newest version!
package top.hendrixshen.magiclib.mixin.dev.threadtweak;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import top.hendrixshen.magiclib.impl.dev.threadtweak.ThreadTweaker;

import java.util.concurrent.ThreadFactory;
import net.minecraft.class_3551;

@Mixin(value = class_3551.class, remap = false)
public class DataFixersMixin {
    @Redirect(
            method = "createFixerUpper",
            at = @At(
                    value = "INVOKE",
                    target= "Lcom/google/common/util/concurrent/ThreadFactoryBuilder;build()Ljava/util/concurrent/ThreadFactory;"
            )
    )
    private static @NotNull ThreadFactory onBuildThread(@NotNull ThreadFactoryBuilder builder) {
        builder.setPriority(ThreadTweaker.getBootstrapPriority());
        return builder.build();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy