Add asyncTeleport events#68
Conversation
|
add this please, it currently create a lot of issue and crash |
|
Clean up the imports, and add comments where diff starts and diff ends. The comment where I wrote that events may be placed there is actually wrong. It also needs to check the preconditions for teleporting again, as plugins may modify them. Ideally, given that this is "new" API, if any of those checks fail (i.e wrong tick thread, entity removed, or any other check it made before) then the code needs to throw an exception. You have also incorrectly handled the case where the plugin modifies the target destination world, position, and yaw/pitch. |
Figured out what was wrong with my previous pull request #67 due to a misunderstanding of internal paper methods regarding the chunk coordinate calculations. This pull request fixes what it had problems with.
Currently, teleports caused by methods such as ender pearls or the
/tpcommand do not triggerPlayerTeleportEventor theEntityTeleportEvent.This pull request implements the events when
teleportAsyncis called.