Class ClientInstances


  • public class ClientInstances
    extends java.lang.Object
    Utility class for finding and managing client instances.
    • Constructor Summary

      Constructors 
      Constructor Description
      ClientInstances()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<ClientInstance> find​(java.util.function.Predicate<ClientInstance> predicate)
      Returns a list of all client instances that satisfy the given predicate.
      static java.util.List<World> findFreeWorlds​(java.util.function.Predicate<World> worldPredicate, int maxPerWorld, int radius, java.lang.String... scripts)
      Finds free worlds based on the given predicate, maximum number per world, radius, and scripts.
      static java.util.List<World> findFreeWorlds​(java.util.function.Predicate<World> worldPredicate, int maxPerWorld, Positionable positionable, int radius, java.lang.String... scripts)
      Finds free worlds based on the given predicate, maximum number per world, radius, and scripts.
      static void sendMessage​(java.lang.String message)
      Sends a message that will be broadcasted to all of your client instances (including the sending instance)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClientInstances

        public ClientInstances()
    • Method Detail

      • sendMessage

        public static void sendMessage​(java.lang.String message)
        Sends a message that will be broadcasted to all of your client instances (including the sending instance)
        Parameters:
        message -
      • find

        public static java.util.List<ClientInstance> find​(java.util.function.Predicate<ClientInstance> predicate)
        Returns a list of all client instances that satisfy the given predicate.
        Parameters:
        predicate - the predicate used to filter the client instances
        Returns:
        a list of client instances that satisfy the predicate
      • findFreeWorlds

        public static java.util.List<World> findFreeWorlds​(java.util.function.Predicate<World> worldPredicate,
                                                           int maxPerWorld,
                                                           int radius,
                                                           java.lang.String... scripts)
        Finds free worlds based on the given predicate, maximum number per world, radius, and scripts.
        Parameters:
        worldPredicate - the predicate used to filter the worlds
        maxPerWorld - the maximum number of worlds to return per world
        radius - the search radius for the worlds
        scripts - the scripts to search for in the worlds
        Returns:
        a list of free worlds that match the given criteria
      • findFreeWorlds

        public static java.util.List<World> findFreeWorlds​(java.util.function.Predicate<World> worldPredicate,
                                                           int maxPerWorld,
                                                           Positionable positionable,
                                                           int radius,
                                                           java.lang.String... scripts)
        Finds free worlds based on the given predicate, maximum number per world, radius, and scripts.
        Parameters:
        worldPredicate - the predicate used to filter the worlds
        maxPerWorld - the maximum number of worlds to return per world
        radius - the search radius for the worlds
        scripts - the scripts to search for in the worlds
        Returns:
        a list of free worlds that match the given criteria