The current system with PlayerEnterPlotEvent, PlayerEnteredPlotEvent, PlayerLeavePlotEvent, PlayerLeftPlotEvent is a confusing mess. The problem is that plot data might not be loaded yet if a player walks onto a plot.
Although it would be possible for a simplified event to just be called delayed, we then can't cancel the PlayerMoveEvent. This being the reason for two events existing at the moment: One event that is cancellable but might not always be called and another that is guaranteed to be called but not cancellable.
A new approach could be: If a player enters a plot whose data is not yet loaded, his position before entering is recorded. Once the data is fetched, the player gets teleported back to the recorded position. A similar approach could be implemented for leaving. This would even allow for these events to be made asynchronous like other plot events.
Although plot leaving and entering would have to be considered correctly. If a player flies swiftly across the world, he should not be teleported to the edge of a plot, from which he got denied, if he has already flown away from it.
The current system with
PlayerEnterPlotEvent
,PlayerEnteredPlotEvent
,PlayerLeavePlotEvent
,PlayerLeftPlotEvent
is a confusing mess. The problem is that plot data might not be loaded yet if a player walks onto a plot. Although it would be possible for a simplified event to just be called delayed, we then can't cancel the PlayerMoveEvent. This being the reason for two events existing at the moment: One event that is cancellable but might not always be called and another that is guaranteed to be called but not cancellable.A new approach could be: If a player enters a plot whose data is not yet loaded, his position before entering is recorded. Once the data is fetched, the player gets teleported back to the recorded position. A similar approach could be implemented for leaving. This would even allow for these events to be made asynchronous like other plot events. Although plot leaving and entering would have to be considered correctly. If a player flies swiftly across the world, he should not be teleported to the edge of a plot, from which he got denied, if he has already flown away from it.