tick complete
This commit is contained in:
1 parent
59914856fb
commit
03b78b52c1
8 files changed
+338
-261
No files matched your search
@@ -43,6 +43,8 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
|
||||
@Shadow private volatile boolean loading;
|
||||
|
||||
CarpetProfiler.ProfilerToken currentSection;
|
||||
|
||||
// Cancel a while statement
|
||||
@Redirect(method = "run", at = @At(value = "FIELD", target = "Lnet/minecraft/server/MinecraftServer;running:Z"))
|
||||
private boolean cancelRunLoop(MinecraftServer server)
|
||||
@@ -61,6 +63,10 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
{
|
||||
//long long_1 = SystemUtil.getMeasuringTimeMs() - this.timeReference;
|
||||
//CM deciding on tick speed
|
||||
if (CarpetProfiler.tick_health_requested != 0L)
|
||||
{
|
||||
CarpetProfiler.start_tick_profiling();
|
||||
}
|
||||
long mspt = 0L;
|
||||
long long_1 = 0L;
|
||||
if (TickSpeed.time_warp_start_time != 0 && TickSpeed.continueWarp())
|
||||
@@ -104,30 +110,6 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/MinecraftServer;tickWorlds(Ljava/util/function/BooleanSupplier;)V",
|
||||
shift = At.Shift.BEFORE
|
||||
))
|
||||
private void startProfilerTick(BooleanSupplier booleanSupplier_1, CallbackInfo ci)
|
||||
{
|
||||
if (CarpetProfiler.tick_health_requested != 0L)
|
||||
{
|
||||
CarpetProfiler.start_tick_profiling();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(
|
||||
method = "tick",
|
||||
at = @At("TAIL")
|
||||
)
|
||||
private void endTick(BooleanSupplier booleanSupplier_1, CallbackInfo ci) {
|
||||
if (CarpetProfiler.tick_health_requested != 0L)
|
||||
{
|
||||
CarpetProfiler.end_tick_profiling((MinecraftServer) (Object)this);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/PlayerManager;saveAllPlayerData()V",
|
||||
@@ -135,7 +117,7 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
))
|
||||
private void startAutosave(BooleanSupplier booleanSupplier_1, CallbackInfo ci)
|
||||
{
|
||||
CarpetProfiler.start_section(null, "Autosave");
|
||||
currentSection = CarpetProfiler.start_section(null, "Autosave", CarpetProfiler.TYPE.GENERAL);
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At(
|
||||
@@ -145,7 +127,7 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
))
|
||||
private void finishAutosave(BooleanSupplier booleanSupplier_1, CallbackInfo ci)
|
||||
{
|
||||
CarpetProfiler.end_current_section();
|
||||
CarpetProfiler.end_current_section(currentSection);
|
||||
}
|
||||
|
||||
@Inject(method = "tickWorlds", at = @At(
|
||||
@@ -155,7 +137,7 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
))
|
||||
private void startNetwork(BooleanSupplier booleanSupplier_1, CallbackInfo ci)
|
||||
{
|
||||
CarpetProfiler.start_section(null, "Network");
|
||||
currentSection = CarpetProfiler.start_section(null, "Network", CarpetProfiler.TYPE.GENERAL);
|
||||
}
|
||||
|
||||
@Inject(method = "tickWorlds", at = @At(
|
||||
@@ -165,7 +147,25 @@ public abstract class MinecraftServer_tickspeedMixin
|
||||
))
|
||||
private void finishNetwork(BooleanSupplier booleanSupplier_1, CallbackInfo ci)
|
||||
{
|
||||
CarpetProfiler.end_current_section();
|
||||
CarpetProfiler.end_current_section(currentSection);
|
||||
}
|
||||
|
||||
@Inject(method = "method_16208", at = @At("HEAD"))
|
||||
private void startAsync(CallbackInfo ci)
|
||||
{
|
||||
currentSection = CarpetProfiler.start_section(null, "Async Tasks", CarpetProfiler.TYPE.GENERAL);
|
||||
}
|
||||
@Inject(method = "method_16208", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/MinecraftServer;waitFor(Ljava/util/function/BooleanSupplier;)V",
|
||||
shift = At.Shift.BEFORE
|
||||
))
|
||||
private void stopAsync(CallbackInfo ci)
|
||||
{
|
||||
if (CarpetProfiler.tick_health_requested != 0L)
|
||||
{
|
||||
CarpetProfiler.end_tick_profiling((MinecraftServer) (Object)this, currentSection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user