Random teleport improvements
Supersedes #3538. Closes #1893, closes #3469, closes #3479.
Various improvements for Essentials' random teleportation feature.
Should be complete as-is, other than potential code clean-up and testing before merging.
Miscellaneous points of interest:
- #easteregg
pre-cacheconfiguration removed (it was hardly in use anyways, and doesn't make any difference after first tp + with multiple locations the number of locations to compute could get very expensive). - EssentialsUpgrade to convert old single location random teleport and retain prior behavior.
- Random respawn with
random-respawnandrandom-respawn-locationconfiguration options. - Random teleport signs by adding
randomteleportto theenabledSignslist in the config, writing[RandomTeleport]in the first line on the sign, and optionally the name of the location on the second line. - Configuration option
default-locationfor default location (where to teleport when typing /tpr with no arguments) that defaults to the current world. - Configuration option
per-location-permissionfor per location permissions (essentials.tpr.location.<name>), functioning similarly to how per warp permissions work. -
/settprnow requires the location name as an argument to set center/ranges for. - Can teleport other players with the
essentials.tpr.othersand the command/tpr <name> <player>. - Console can now execute
/tprwith the name and player both as required arguments. - Fixed an issue where on older versions of the game the default center location would be a block too high.
- Fixed an issue where events modifying random teleportation parameters would cause incorrect caching.
- Fixed the issue of random locations below y=0 being considered invalid (world height can be lower now in 1.17).
@pop4959 can you resolve conflicts for this whenever you have time
Updated, would like to see a few more people test this before merging though. Grab a build from actions if you want to try it, and just be sure to backup tpr.yml so you can easily switch back to regular Essentials builds.
You can enter a value after it for tpr, but you can always get by in the farmworld.
You can enter a value after it for tpr, but you can always get by in the farmworld.
Not quite sure what you mean here, can you elaborate?
https://github.com/EssentialsX/Essentials/discussions/4679 I posted that in the discussions. So I got your invitation to test your build. With the / tpr I still got into the farming world, even if I had specified a value such as Nether.
#4679 I posted that in the discussions. So I got your invitation to test your build. With the / tpr I still got into the farming world, even if I had specified a value such as Nether.
Can you provide a list of the worlds you have on your server and your tpr.yml file
Ok i got it.
After a few teleoports with / tpr, I suddenly landed in the Void in the Nether. Can that still be fixed?
Hey, just wondering if there are any updates on this? Just wanted to open a new issue, but saw that the Feature I want was already suggested (and apparently also been worked on) (#3469) Would be awesome having this :)
Edit: Sadly can't help test because the build artifact is expired :/
@Chris6ix Updated the build for you :)
This work is for the most part done, probably just a few minor changes here and there, but otherwise just needs to be tested thoroughly before the 2.20 milestone.
Alright I downloaded it, and I'm going to test it when I got some spare time (Have Exams rn :/ ) Thanks for updating the build :)
Is there anything specific that needs to be tested or something? I can imagine that the basics have already been tested?
Btw, is there an approximate release date for 2.20?
Alright I downloaded it, and I'm going to test it when I got some spare time (Have Exams rn :/ ) Thanks for updating the build :)
Is there anything specific that needs to be tested or something? I can imagine that the basics have already been tested?
Btw, is there an approximate release date for 2.20?
No problem. Nothing specific, just making sure multi-world teleports, /tpr, /settpr commands, configuration, etc all appear and behave as expected and are intuitive to use, not buggy, etc. The basics have been tested so ideally try it out on a server and see if you find any issues using it.
There isn't an ETA For 2.20 currently but you can track progress in the milestone here on Github.
No problem. Nothing specific, just making sure multi-world teleports, /tpr, /settpr commands, configuration, etc all appear and behave as expected and are intuitive to use, not buggy, etc. The basics have been tested so ideally try it out on a server and see if you find any issues using it.
There isn't an ETA For 2.20 currently but you can track progress in the milestone here on Github.
Okay thank you! I will test these things when i got some spare time and get back to you with the results ;)
Hey @pop4959 i found some free time and tested the multi world rtp feature :)
I loaded the 4 worlds from my Server to a completely fresh paper 1.18.2 #350 Test Server with only EssX 2.20.0-dev+6-2448e2a (your build) and Multiverse-Core 4.3.2-SNAPSHOT-b870
I also generated a completely new EssX folder and left everything to default.
I teleported myself to each of the world's spawns using mvtp <WorldName> and then just did /settpr <WorldName> center
This worked perfectly for all the worlds.
I then teleported myself to each world and made about 20 random teleports in each world, each time checking with Xaeros World Map that the teleports were really random and that it was not picking a location more than once or something. Everything worked perfectly fine besides the rtps in the nether...there were 2 issues: Out of the 20 times, I got teleported 2 times into a wall Out of the 20 times, I got teleported 3 times on top of the nether roof
So I think the nether part needs to be adjusted a bit with a max height just under the nether roof for example and a fix for the teleporting into walls. The rest looks fine to me :)
Thanks again for working on this great feature! If you need any more testing or something, just ping me here.
Cheers
@Chris6ix Hey, thanks for doing such a thorough test! Glad to hear everything's working for you. 😄
Not sure about the teleporting into walls/roof, I don't believe any changes have been made with regards to that. It should be using Essentials safe teleport feature (as all other teleport commands do), so unless you've turned that off random teleports should behave correctly.
I sometimes forget to keep this branch up-to-date, but feel free to continue testing it. Just ping me if you need any changes merged in from the current mainstream dev builds.
Hey @pop4959 thanks for the quick reply!
As I explained in my message from before, I generated a completely new EssX folder (so also a fresh config) and didn't even open it (the only file I checked was tpr.yml to check if all the worlds show up correctly).
So all settings were on default, which for the teleport safety seems to be this:
So the teleport safety was enabled...and it still teleported me into walls / on top of the nether roof...
Or is that because I was in creative? (Because of explanation of force-safe-teleport-location)
If that is so, shouldn't the default be true to also prevent creative mode players from getting teleported into walls?
Yes it is probably because you were in creative. The teleport is "safe" in creative mode since you do not take damage. Teleportation safety primarily concerns whether or not the player takes damage teleporting to the location.
You can test in survival or try setting that option to true if that is your preference.
Mhm okay I have force-safe-teleport-location now set to true and I'm not getting teleported into walls anymore in creative, but it still teleports me on top of the nether roof (Probably because its "safe" because you don't take damage...)
Is there something you can do to not make the nether roof count as "safe" / Or add a max tp height just for the nether dimension just under the nether roof, which seems to be Y:121 ?
Edit: This could be a config option if the nether roof should be treated as safe or not
Okay, that's something we can look into then. The intent is definitely not to teleport on top of the roof. Probably either the location being selected too high, or teleportation safety choosing a spot above the roof (although I believe it's already supposed to do this).
Want to update that I've been using this PR on my server for more than a few months and it has been working great.
TODO
- jroys comments above
- pre-validate random locations in chunks
- refactor / clean up some code