Class GPSNetwork

java.lang.Object
io.github.thebusybiscuit.slimefun4.api.gps.GPSNetwork

public class GPSNetwork extends Object
The GPSNetwork is a manager class for all Transmitters and waypoints. There can only be one instance of this class per Server. It is also responsible for teleportation and resource management.
Author:
TheBusyBiscuit
See Also:
  • Constructor Details

    • GPSNetwork

      public GPSNetwork(@Nonnull Slimefun plugin)
      This constructs a new GPSNetwork. Note that this network is per Server and not per Player.
      Parameters:
      plugin - Our Slimefun instance
  • Method Details

    • updateTransmitter

      public void updateTransmitter(@Nonnull Location l, @Nonnull UUID uuid, boolean online)
      This method updates the status of a GPSTransmitter.
      Parameters:
      l - The Location of the GPSTransmitter
      uuid - The UUID who the GPSTransmitter belongs to
      online - Whether that GPSTransmitter is online
    • getNetworkComplexity

      public int getNetworkComplexity(@Nonnull UUID uuid)
      This method calculates the GPS complexity for the given UUID. The complexity is determined by the Y level of each GPSTransmitter multiplied by the multiplier of that transmitter.
      Parameters:
      uuid - The UUID who to calculate it for
      Returns:
      The network complexity for that UUID
    • countTransmitters

      public int countTransmitters(@Nonnull UUID uuid)
      This method returns the amount of Transmitters for the given UUID.
      Parameters:
      uuid - The UUID who these transmitters belong to
      Returns:
      The amount of transmitters
    • openTransmitterControlPanel

      public void openTransmitterControlPanel(@Nonnull Player p)
      This method opens the GPSTransmitter control panel to the given Player.
      Parameters:
      p - The Player
    • getIcon

      @ParametersAreNonnullByDefault @Nonnull public ItemStack getIcon(String name, World.Environment environment)
      This returns an icon for the given waypoint. The icon is dependent on the World.Environment of the waypoint's World. However if the name of this waypoint indicates that this is actually a deathmarker then a different texture will be used. Otherwise it will return a globe, a nether or end sphere according to the World.Environment.
      Parameters:
      name - The name of a waypoint
      environment - The World.Environment of the waypoint's World
      Returns:
      An icon for this waypoint
    • openWaypointControlPanel

      public void openWaypointControlPanel(@Nonnull Player p)
    • createWaypoint

      public void createWaypoint(@Nonnull Player p, @Nonnull Location l)
      This method will prompt the given Player to enter a name for a waypoint. After entering the name, it will be added to his waypoint list.
      Parameters:
      p - The Player who should get a new waypoint
      l - The Location of the new waypoint
    • addWaypoint

      public void addWaypoint(@Nonnull Player p, @Nonnull String name, @Nonnull Location l)
      This method adds a new waypoint with the given name and Location for that Player.
      Parameters:
      p - The Player to get the new waypoint
      name - The name of this waypoint
      l - The Location of this waypoint
    • getTransmitters

      @Nonnull public Set<Location> getTransmitters(@Nonnull UUID uuid)
      This method returns a Set of Locations for all Transmitters owned by the given UUID.
      Parameters:
      uuid - The UUID owning those transmitters
      Returns:
      A Set with all Locations of transmitters for this UUID
    • getTeleportationManager

      @Nonnull public TeleportationManager getTeleportationManager()
      This returns the TeleportationManager for this GPSNetwork. It is responsible for all actions that relate to the Teleporter.
      Returns:
      The TeleportationManager for this GPSNetwork
    • getResourceManager

      @Nonnull public ResourceManager getResourceManager()
      This returns the ResourceManager for this GPSNetwork. Use this to access GEOResources.
      Returns:
      The ResourceManager for this GPSNetwork