Jump to content

How do I use the Worlds API?


ThoughtVNC

Recommended Posts

Hey guys, I'm trying to hop worlds in my script, and I'm having a little bit of difficulty understanding the Worlds methods.

In specific, I'm confused about the parameter "all" for the method getAvailableWorlds

public java.util.List<World> getAvailableWorlds(boolean all)
Gets a list with all available worlds to hop to
Parameters:
all - True for all worlds, False to filter out worlds that are not allowed to be hopped to

What is it that all does? If I wanted to just get a list of all P2P, non PVP worlds what would I input?

 

Thanks in advance <3

Link to comment
Share on other sites

3 hours ago, ThoughtVNC said:

Hey guys, I'm trying to hop worlds in my script, and I'm having a little bit of difficulty understanding the Worlds methods.

In specific, I'm confused about the parameter "all" for the method getAvailableWorlds

public java.util.List<World> getAvailableWorlds(boolean all)
Gets a list with all available worlds to hop to
Parameters:
all - True for all worlds, False to filter out worlds that are not allowed to be hopped to

What is it that all does? If I wanted to just get a list of all P2P, non PVP worlds what would I input?

 

Thanks in advance <3

all - True for a List all worlds, False to filter out worlds that are not allowed to be hopped to based on osbots criteria of a invalid world (pvp, high-risk, etc.)

 

List<World> w = getWorlds().getAvailableWorlds(true);

want to filter?
List<World> w = getWorlds().getAvailableWorlds(true).stream().filter(world -> world.isMembers() && world.isPvp()).collect(Collectors.toList());

 

  • Like 4
Link to comment
Share on other sites

1 hour ago, Chris said:
all - True for a List all worlds, False to filter out worlds that are not allowed to be hopped to based on osbots criteria of a invalid world (pvp, high-risk, etc.)

 

List<World> w = getWorlds().getAvailableWorlds(true);

want to filter?
List<World> w = getWorlds().getAvailableWorlds(true).stream().filter(world -> world.isMembers() && world.isPvp()).collect(Collectors.toList());

 

Thanks, I appreciate it.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...