DarkEyeDragon/RandomTeleport

Worldborder check before teleport

ShayBox opened this issue · 4 comments

If use-worldborder is enabled, the plugin should have an additional safety check that the player isn't going to teleport outside the border, this is to protect the player from recently changed worldborder size which hast had safe spots re-calculated, I installed the plugin and it immediately teleported and killed me outside the border and continued to for some time until I'm guessing the safe spots finished calculating or something.

Currently the way you do it is by typing /rtp reload after resizing wb's. i know its not that great. I'll look into if i can make it so it reloads after wb change

So i looked a bit deeper into it and it seems its not all that simple, there is no event to listen too regarding world border changes. However i can look for the execution of the wb command

I've made an issue related to this on the paper issue tracker. PaperMC/Paper#4720
A friend of mine is going to PR that change into paper. Once thats accepted i can start implementing a proper system for this.
As for now all we can do is play the waiting game.

If you're using one of the latest builds of paper there is a worldborder change event i hook into.
https://ci.darkeyedragon.me/job/Random%20Teleport/98/ build 98 and up will have support for this. These are dev builds and should be properly tested before using in production. Added by: 7bb9baa