This commit is contained in:
gnembon committed 2019-11-07 16:13:15 -04:00
1 parent 6dd31329b7
commit ec19e37a74
9 files changed
+29 -29

No files matched your search

@@ -3,7 +3,7 @@ package carpet.mixins;
import carpet.helpers.TickSpeed;
import carpet.utils.CarpetProfiler;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.SystemUtil;
import net.minecraft.util.Util;
import net.minecraft.util.profiler.DisableableProfiler;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Final;
@@ -61,7 +61,7 @@ public abstract class MinecraftServer_tickspeedMixin
{
while (this.running)
{
//long long_1 = SystemUtil.getMeasuringTimeMs() - this.timeReference;
//long long_1 = Util.getMeasuringTimeMs() - this.timeReference;
//CM deciding on tick speed
if (CarpetProfiler.tick_health_requested != 0L)
{
@@ -72,12 +72,12 @@ public abstract class MinecraftServer_tickspeedMixin
if (TickSpeed.time_warp_start_time != 0 && TickSpeed.continueWarp())
{
//making sure server won't flop after the warp or if the warp is interrupted
this.timeReference = this.field_4557 = SystemUtil.getMeasuringTimeMs();
this.timeReference = this.field_4557 = Util.getMeasuringTimeMs();
}
else
{
mspt = TickSpeed.mspt; // regular tick
long_1 = SystemUtil.getMeasuringTimeMs() - this.timeReference;
long_1 = Util.getMeasuringTimeMs() - this.timeReference;
}
//end tick deciding
//smoothed out delay to include mcpt component. With 50L gives defaults.
@@ -101,7 +101,7 @@ public abstract class MinecraftServer_tickspeedMixin
this.tick(TickSpeed.time_warp_start_time != 0 ? ()->true : this::shouldKeepTicking);
this.profiler.swap("nextTickWait");
this.field_19249 = true;
this.field_19248 = Math.max(SystemUtil.getMeasuringTimeMs() + /*50L*/ mspt, this.timeReference);
this.field_19248 = Math.max(Util.getMeasuringTimeMs() + /*50L*/ mspt, this.timeReference);
this.method_16208();
this.profiler.pop();
this.profiler.endTick();
@@ -157,7 +157,7 @@ public abstract class MinecraftServer_tickspeedMixin
}
@Inject(method = "method_16208", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/MinecraftServer;executeTasks(Ljava/util/function/BooleanSupplier;)V",
target = "Lnet/minecraft/server/MinecraftServer;runTasks(Ljava/util/function/BooleanSupplier;)V",
shift = At.Shift.BEFORE
))
private void stopAsync(CallbackInfo ci)