GamerSafer / ablockalypse

MIT License
2 stars 0 forks source link

Keep chunks loaded after player dies to delete wolves #26

Closed cafestifflered closed 2 years ago

cafestifflered commented 2 years ago

When a player dies the chunks are instantly unloaded, preventing tamed wolves from being untamed or killed.

Keep the chunks loaded for a few ticks so that tamed wolves can be properly removed when a player dies.

michelecoco commented 2 years ago

We already had a piece of logic responsible for despawning wolves. When a player dies, the plugin iterates over all the wolf entities in the world where the player died, removing them if the dead player tamed them. This didn't work on production since chunks are immediately unloaded after a player dies unless there is at least another player nearby.

I took a different approach than what we initially discussed. Instead of keeping the chunks loaded, the plugin iterates over all the entities in chunks about to be unloaded, removing wolves tamed by dead players. This is an addition to the logic described above.

Solved in 43aa50fb67b8192bb0d69f76cd55ed4d5cceded7