Fix client test random crashes ()

* Fix client test random crashes

* Improve

* Even easier
This commit is contained in:
modmuss 2024-11-18 18:07:19 +00:00 committed by GitHub
parent 8eedec2580
commit 8ca5486fd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,6 +16,8 @@
package net.fabricmc.fabric.test.base.client.mixin;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@ -32,4 +34,10 @@ public abstract class MinecraftDedicatedServerMixin {
// Capture the server instance once the server is ready to be connected to
TestDedicatedServer.DEDICATED_SERVER_REF.set((MinecraftDedicatedServer) (Object) this);
}
// Don't call shutdownExecutors as we are running the dedi server within the client process.
@WrapOperation(method = "shutdown", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;shutdownExecutors()V"))
private void dontStopExecutors(Operation<Void> original) {
// Never needed, as this is a client mixin.
}
}