ThoughtVNC Posted October 7, 2021 Share Posted October 7, 2021 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 Quote Link to comment Share on other sites More sharing options...
Gunman Posted October 8, 2021 Share Posted October 8, 2021 I don't know if the API supports what you're wanting. May need to make your own list of worlds and keep them updated, but test it out and find out what "not allowed to be hopped" entails to. Quote Link to comment Share on other sites More sharing options...
Chris Posted October 8, 2021 Share Posted October 8, 2021 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 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()); 4 Quote Link to comment Share on other sites More sharing options...
ThoughtVNC Posted October 8, 2021 Author Share Posted October 8, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...