Skip to content

Commit

Permalink
Added descriptions and tick time on Server Thread
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHua269 committed Jan 11, 2025
1 parent eb86ffe commit ef1ed73
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,23 @@ public void onTickChildren(MinecraftServer minecraftServer, BooleanSupplier bool
Chlorophyll.server = (MinecraftServer) (Object)this;
this.shouldPollChunkTask = false;

// Active the tick loops
for (ServerLevel level : this.getAllLevels()){
((ITaskSchedulingLevel) level).chlorophyll$setupTickLoop();
}

// Time
for (ServerLevel level : this.getAllLevels()) {
level.tickTime();
}

// Tick base connections
this.getConnection().tick();

// Player list
this.playerList.tick();

// Server GUI
for (Runnable tickable : this.tickables) {
tickable.run();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@ public void onBlockStateChange(BlockPos blockPos, BlockState blockState, BlockSt
private void onStructureStartsAvailable$mainThreadReturn(MinecraftServer server, Runnable runnable) {
this.tickLoop.execute(runnable);
}

@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;tickTime()V"))
private void tickTime$mainThreadReturn(ServerLevel serverLevel) {
return; // As we don't wanna tick this off server thread because some threading issue
}
}

0 comments on commit ef1ed73

Please sign in to comment.