Merge branch 'master' into 1.16

# Conflicts:
#	src/main/java/carpet/mixins/MinecraftServer_tickspeedMixin.java
This commit is contained in:
gnembon committed 2020-02-27 23:04:13 -04:00
commit da6ac199de
4 files changed
+119 -43

No files matched your search

@@ -3,9 +3,11 @@ package carpet.mixins;
import carpet.helpers.TickSpeed;
import carpet.utils.CarpetProfiler;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.ServerTask;
import net.minecraft.util.TickDurationMonitor;
import net.minecraft.util.Util;
import net.minecraft.util.profiler.Profiler;
import net.minecraft.util.thread.ReentrantThreadExecutor;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@@ -18,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.function.BooleanSupplier;
@Mixin(MinecraftServer.class)
public abstract class MinecraftServer_tickspeedMixin
public abstract class MinecraftServer_tickspeedMixin extends ReentrantThreadExecutor<ServerTask>
{
@Shadow private volatile boolean running;
@@ -32,6 +34,11 @@ public abstract class MinecraftServer_tickspeedMixin
@Shadow @Final private Profiler profiler;
public MinecraftServer_tickspeedMixin(String name)
{
super(name);
}
@Shadow protected abstract void tick(BooleanSupplier booleanSupplier_1);
@Shadow protected abstract boolean shouldKeepTicking();
@@ -116,7 +123,12 @@ public abstract class MinecraftServer_tickspeedMixin
this.profiler.swap("nextTickWait");
this.field_19249 = true;
this.field_19248 = Math.max(Util.getMeasuringTimeMs() + /*50L*/ msThisTick, this.timeReference);
this.method_16208();
if (TickSpeed.time_warp_start_time != 0)
{
runTasks();
runTasks(() -> !hasRunningTasks() );
}
else { this.method_16208(); }
this.profiler.pop();
this.profiler.endTick();
this.loading = true;