Wilderness-Tp

Wilderness-Tp

36.7k Downloads

Request for random location API

jyhsu2000 opened this issue ยท 7 comments

commented

Hi, I use this plugin for a long time and I read the code of this project, I think it's a good plugin for random teleport.

When I develop my own plugin, I need some ways to get a random location to teleport (but not teleport a player immediately).

I found getRandomeLocation in TeleportGoneWild, but it calls realTeleportt2 to teleport the player after found a random location.

Could you create an API similar to getRandomeLocation but just return Location of the random location found by this plugin instead of teleporting the player?
Then we can use the Location for our own purpose.
Thanks.

commented

Hi,
I noticed that there are some huge updates for the last 2 weeks.
RandomLocationSearchTask is almost rewritten and some access modifiers public is removed.
So we cannot use the following code like before,

FutureTask<Location> futureTask = RandomLocationSearchTask.search(world, player);

In the current version, are there still anyways of getting a random location from another plugin?
Or any plans about it?

commented

@arboriginal did a ton of changes, and I basically trusted the changes since it was way too big to review. Feel free to PR fixes since it seems he decided to no longer submit PRs anymore...? But ya go ahead and make stuff public if need be.

I didn't realize that he did a lot of refactoring in his second PR where he removed some functionality I had added so feel free to revert/readd portions of code if desired.

commented

he decided to no longer submit PRs anymore...?

I've decided nothing, I make PR when I have things to purpose, and time for it.

commented

Ok just was confused by your comment about patches. I'm assuming you do that to keep your profile clean?

commented

I read the code of this project I think it's a good plugin for random teleport.

Thank you, we agree c:

I'll look into making an API call. It will likely return a Future since it's designed to be async-first.

commented

If you think you can get to this before I can, feel free to make a PR.

commented

Sounds great.
It will be very helpful if there is some way to get a random location without teleportation.