hestia-rsps / hestia

An open-source Kotlin game server.
BSD 3-Clause "New" or "Revised" License
16 stars 4 forks source link

Fix floor item region spawning #88

Open GregHib opened 4 years ago

GregHib commented 4 years ago

ClientRegionChangeSystem currently updates the last region before each sync. This means actions (such as region loading) that take longer than one tick no longer have the last loaded region information.

That being said is that information even needed? A better alternative would be to set the last region loaded inside of the RegionLoaded message handler.

How does that work with floor items though? If you teleport into a region then you need to wait until the region has loaded before sending items, how do you know which region is loaded though? If you teleport to the same region then items will flicker. But if we run the sync inside the region load message will that work?

Optimization: If we only store chunks with items in the FloorItemChunks then we can send ChunkClear's only when necessary.