Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to Random Teleport #4271

Merged
merged 20 commits into from
Nov 24, 2024

Conversation

pop4959
Copy link
Member

@pop4959 pop4959 commented Jun 25, 2021

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-cache configuration 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-respawn and random-respawn-location configuration options.
  • Random teleport signs by adding randomteleport to the enabledSigns list 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-location for default location (where to teleport when typing /tpr with no arguments) that defaults to the current world.
  • Configuration option per-location-permission for per location permissions (essentials.tpr.location.<name>), functioning similarly to how per warp permissions work.
  • /settpr now requires the location name as an argument to set center/ranges for.
  • Can teleport other players with the essentials.tpr.others and the command /tpr <name> <player>.
  • Console can now execute /tpr with 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 pop4959 added this to the 2.20.0 milestone Jun 25, 2021
@pop4959 pop4959 added type: enhancement Features and feature requests. module: main Issues or PRs for the main Essentials module module: spawn Issues or PRs for the EssentialsSpawn module type: bugfix PRs that fix bugs in EssentialsX. labels Jun 25, 2021
@JRoy
Copy link
Member

JRoy commented Dec 4, 2021

@pop4959 can you resolve conflicts for this whenever you have time

@pop4959
Copy link
Member Author

pop4959 commented Dec 11, 2021

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.

@Leahcimkrob
Copy link

You can enter a value after it for tpr, but you can always get by in the farmworld.

@pop4959
Copy link
Member Author

pop4959 commented Dec 12, 2021

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?

@Leahcimkrob
Copy link

#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.

@pop4959
Copy link
Member Author

pop4959 commented Dec 12, 2021

#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

@Leahcimkrob
Copy link

Ok i got it.

After a few teleoports with / tpr, I suddenly landed in the Void in the Nether. Can that still be fixed?

@Chris6ix
Copy link

Chris6ix commented May 17, 2022

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 :/

@pop4959
Copy link
Member Author

pop4959 commented May 17, 2022

@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.

@Chris6ix
Copy link

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?

@pop4959
Copy link
Member Author

pop4959 commented May 18, 2022

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.

@Chris6ix
Copy link

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 ;)

@Chris6ix
Copy link

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

@pop4959
Copy link
Member Author

pop4959 commented May 28, 2022

@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.

@Chris6ix
Copy link

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:
image
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?

@pop4959
Copy link
Member Author

pop4959 commented May 28, 2022

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).

@goweiwen
Copy link

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.

Copy link
Member

@JRoy JRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few things otherwise good!

@pop4959
Copy link
Member Author

pop4959 commented Aug 14, 2022

TODO

  • jroys comments above
  • pre-validate random locations in chunks
  • refactor / clean up some code

@JRoy JRoy modified the milestones: 2.20.0, 2.21.0 Apr 28, 2023
@mdcfe mdcfe modified the milestones: 2.21.0, 2.22.0 Sep 15, 2024
JRoy added 7 commits November 24, 2024 17:02
…eleport-improvements

# Conflicts:
#	Essentials/src/main/java/com/earth2me/essentials/EssentialsUpgrade.java
#	Essentials/src/main/java/com/earth2me/essentials/RandomTeleport.java
#	Essentials/src/main/java/com/earth2me/essentials/commands/Commandsettpr.java
#	Essentials/src/main/java/com/earth2me/essentials/commands/Commandtpr.java
was never used anyway
The setCenter, setMin/Max methods will save the config on their own
@JRoy JRoy changed the title Random teleport improvements Improvements to Random Teleport Nov 24, 2024
@JRoy JRoy merged commit 2418a6f into EssentialsX:2.x Nov 24, 2024
1 check passed
@JRoy
Copy link
Member

JRoy commented Nov 24, 2024

This has beat the adventure pr for longest time from open to merge...

@PetyXbron
Copy link

🚀🚀🚀

@pop4959 pop4959 deleted the randomteleport-improvements branch November 24, 2024 23:52
Euphillya added a commit to Euphillya/Essentials-Folia that referenced this pull request Dec 10, 2024
EssentialsX@1778bf5 Respect per player locale for command descriptions (EssentialsX#5972)
EssentialsX@2418a6f Improvements to Random Teleport (EssentialsX#4271)
EssentialsX@38e42f9 Add argument to /skull to give skull to other player (EssentialsX#5822)
EssentialsX@1af1565 Discord: Add start time placeholder for start message (EssentialsX#5686)
EssentialsX@bea43e8 Fix mini message parsing in NumberUtil#displayCurrency (EssentialsX#5921)
EssentialsX@3203e97 Parse /pay modifiers more strictly (EssentialsX#5638)
EssentialsX@f02eeec Add method to get all linked players in DiscordLinkService (EssentialsX#5896)
EssentialsX@9590d4c Add translation key for /alts output (EssentialsX#5595)
EssentialsX@3f0a412 Add locale based comma support for /pay (EssentialsX#5962)
EssentialsX@57c9edc Add optional requirements for balance top listing (EssentialsX#5394)
EssentialsX@c7cc1b4 Fix respawn-at-anchor setting. (EssentialsX#5825)
EssentialsX@2a41ea0 Add config options for specific chat type formats
EssentialsX@b560bbd Fix actions permissions on PRs for junit reports
EssentialsX@d31ff55 Remove extraneous code in command preprocess event handling
EssentialsX@bc8aa76 Revert removal of InvalidWorldException (EssentialsX#5984)
EssentialsX@d58db0d Update to 1.21.4
EssentialsX@c37064f Add 1.21.4 Mobs
EssentialsX@baa8258 Add 1.21.4 Tree Types
EssentialsX@424816e Add 1.21.4 Items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: main Issues or PRs for the main Essentials module module: spawn Issues or PRs for the EssentialsSpawn module type: bugfix PRs that fix bugs in EssentialsX. type: enhancement Features and feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run TPR from console/command block RTP Multi World Support Random Spawn
9 participants