TechnicallyCoded/FoliaLib

Inaccurate usage of Folia scheduling API

Closed this issue · 1 comments

A248 commented

It is incorrect to use entity.getLocation() in conjunction with the region scheduler. Plugins should use entity.getScheduler() which accounts for matters such as teleportation.

public void runInPlayerRegion(Player player, Runnable runnable) {
//this.globalRegionScheduler.//
this.plugin.getServer().getRegionScheduler().run(plugin, player.getLocation(), task -> runnable.run());

Already changed