Fix another outdated mixin
This commit is contained in:
parent
6012626112
commit
d8b86708e5
|
|
@ -1,12 +1,12 @@
|
|||
package org.embeddedt.modernfix.common.mixin.feature.cause_lag_by_disabling_threads;
|
||||
|
||||
import net.minecraft.TracingExecutor;
|
||||
import net.minecraft.client.renderer.chunk.SectionRenderDispatcher;
|
||||
import org.embeddedt.modernfix.annotation.ClientOnlyMixin;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
|
@ -14,14 +14,14 @@ import java.util.concurrent.TimeUnit;
|
|||
@Mixin(SectionRenderDispatcher.class)
|
||||
@ClientOnlyMixin
|
||||
public class ChunkRenderDispatcherMixin {
|
||||
private static final Executor MFIX_CHUNK_BUILD_EXECUTOR = new ThreadPoolExecutor(1, computeNumThreads(), 0L, TimeUnit.SECONDS, new LinkedBlockingQueue<>());
|
||||
private static final TracingExecutor MFIX_CHUNK_BUILD_EXECUTOR = new TracingExecutor(new ThreadPoolExecutor(1,computeNumThreads(), 0L, TimeUnit.SECONDS, new LinkedBlockingQueue<>()));
|
||||
|
||||
private static int computeNumThreads() {
|
||||
return Math.max(Math.min(Runtime.getRuntime().availableProcessors() / 4, 10), 1);
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "<init>*", at = @At("HEAD"), ordinal = 0, argsOnly = true)
|
||||
private static Executor replaceExecutor(Executor old) {
|
||||
private static TracingExecutor replaceExecutor(TracingExecutor old) {
|
||||
return MFIX_CHUNK_BUILD_EXECUTOR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user