update to 24w33a

This commit is contained in:
gnembon committed 2024-08-18 19:10:40 +02:00
1 parent 9940feb7d3
commit d11586fdaf
58 files changed
+379 -875

No files matched your search

@@ -19,36 +19,13 @@ public abstract class ServerChunkCache_profilerMixin
CarpetProfiler.ProfilerToken currentSection;
@Inject(method = "tickChunks", at = @At("HEAD"))
@Inject(method = "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;JLjava/util/List;)V", at = @At("HEAD"))
private void startSpawningSection(CallbackInfo ci)
{
currentSection = CarpetProfiler.start_section(level, "Spawning", CarpetProfiler.TYPE.GENERAL);
}
@Inject(method = "tickChunks", at = @At(
value = "FIELD",
target = "net/minecraft/server/level/ServerChunkCache.level:Lnet/minecraft/server/level/ServerLevel;",
ordinal = 10
))
private void skipChunkTicking(CallbackInfo ci)
{
if (currentSection != null)
{
CarpetProfiler.end_current_section(currentSection);
}
}
@Inject(method = "tickChunks", at = @At(
value = "INVOKE",
target = "net/minecraft/server/level/ServerLevel.tickChunk(Lnet/minecraft/world/level/chunk/LevelChunk;I)V",
shift = At.Shift.AFTER
))
private void resumeSpawningSection(CallbackInfo ci)
{
currentSection = CarpetProfiler.start_section(level, "Spawning", CarpetProfiler.TYPE.GENERAL);
}
@Inject(method = "tickChunks", at = @At("RETURN"))
@Inject(method = "tickChunks(Lnet/minecraft/util/profiling/ProfilerFiller;JLjava/util/List;)V", at = @At("RETURN"))
private void stopSpawningSection(CallbackInfo ci)
{
if (currentSection != null)
@@ -56,18 +33,4 @@ public abstract class ServerChunkCache_profilerMixin
CarpetProfiler.end_current_section(currentSection);
}
}
//@Redirect(method = "tick", at = @At(
// value = "INVOKE",
// target = "Lnet/minecraft/server/level/DistanceManager;purgeStaleTickets()V"
//))
//private void pauseTicketSystem(DistanceManager distanceManager)
//{
// pausing expiry of tickets
// that will prevent also chunks from unloading, so require a deep frozen state
//ServerTickRateManager trm = ((MinecraftServerInterface) level.getServer()).getTickRateManager();
//if (!trm.runsNormally() && trm.deeplyFrozen()) return;
//distanceManager.purgeStaleTickets();
//}
}