Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1) find out if there is any better api for this, like, get chunktick of a specific areas or anything else
- 2) if there is none beside the "LevelChunk_tick_9d729ccd"
- than maybe this idea would work:
- this is the current code:
- =============================================================================================
- THook(void, LevelChunk_tick_9d729ccd, void *levelChunk,
- trapdoor::BlockSource *blockSource, size_t *tick) {
- if (mod::tick::gameProfiler.inProfiling) {
- TIMER_START
- original(levelChunk, blockSource, tick);
- TIMER_END
- mod::tick::gameProfiler.chunkTickTime += timeReslut;
- mod::tick::gameProfiler.tickChunkNum++;
- } else {
- original(levelChunk, blockSource, tick);
- }
- }
- ==============================================================================================
- - make it alway running, no need to wait for inProfiling to be changed to true
- - idk how many ticks will pass for this thook to be called again, but i think it is not a long time so each time when this THook is called, you make a loop code to get all online players position and save it into a variable.
- - now check if ChunkTick is bigger than some value, maybe 50ms, if yes, than there is a lag chunk.
- - you check players position again, if anyone have a different position which further than some value, maybe 256 block, than teleport them back in spawn point
- so it is only 3 steps:
- 1) make a loop code to get players coord, and compare coords
- 2) check if chunktick is bigger than some value
- 3) teleport player to spawnpoint
Add Comment
Please, Sign In to add comment