fixing lockup on forced tick
This commit is contained in:
1 parent
e3adc9e83f
commit
06e4197509
1 file changed
+9
-1
@@ -2,6 +2,8 @@ package carpet.mixins;
|
|||||||
|
|
||||||
import carpet.fakes.MinecraftServerInterface;
|
import carpet.fakes.MinecraftServerInterface;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.server.ServerTask;
|
||||||
|
import net.minecraft.util.NonBlockingThreadExecutor;
|
||||||
import net.minecraft.util.SystemUtil;
|
import net.minecraft.util.SystemUtil;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
@@ -9,8 +11,13 @@ import org.spongepowered.asm.mixin.Shadow;
|
|||||||
import java.util.function.BooleanSupplier;
|
import java.util.function.BooleanSupplier;
|
||||||
|
|
||||||
@Mixin(MinecraftServer.class)
|
@Mixin(MinecraftServer.class)
|
||||||
public abstract class MinecraftServer_scarpetMixin implements MinecraftServerInterface
|
public abstract class MinecraftServer_scarpetMixin extends NonBlockingThreadExecutor<ServerTask> implements MinecraftServerInterface
|
||||||
{
|
{
|
||||||
|
public MinecraftServer_scarpetMixin(String string_1)
|
||||||
|
{
|
||||||
|
super(string_1);
|
||||||
|
}
|
||||||
|
|
||||||
@Shadow protected abstract void tick(BooleanSupplier booleanSupplier_1);
|
@Shadow protected abstract void tick(BooleanSupplier booleanSupplier_1);
|
||||||
|
|
||||||
@Shadow private long timeReference;
|
@Shadow private long timeReference;
|
||||||
@@ -22,5 +29,6 @@ public abstract class MinecraftServer_scarpetMixin implements MinecraftServerInt
|
|||||||
{
|
{
|
||||||
timeReference = field_4557 = SystemUtil.getMeasuringTimeMs();
|
timeReference = field_4557 = SystemUtil.getMeasuringTimeMs();
|
||||||
tick(isAhead);
|
tick(isAhead);
|
||||||
|
executeTaskQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user