Class GPSNetwork
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.gps.GPSNetwork
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addWaypoint
(org.bukkit.entity.Player p, String name, org.bukkit.Location l) This method adds a new waypoint with the given name andLocation
for thatPlayer
.int
countTransmitters
(UUID uuid) This method returns the amount ofTransmitters
for the givenUUID
.void
createWaypoint
(org.bukkit.entity.Player p, org.bukkit.Location l) This method will prompt the givenPlayer
to enter a name for a waypoint.org.bukkit.inventory.ItemStack
This returns an icon for the given waypoint.int
getNetworkComplexity
(UUID uuid) This method calculates the GPS complexity for the givenUUID
.This returns theResourceManager
for thisGPSNetwork
.This returns theTeleportationManager
for thisGPSNetwork
.Set
<org.bukkit.Location> getTransmitters
(UUID uuid) void
openTransmitterControlPanel
(org.bukkit.entity.Player p) This method opens theGPSTransmitter
control panel to the givenPlayer
.void
openWaypointControlPanel
(org.bukkit.entity.Player p) void
updateTransmitter
(org.bukkit.Location l, UUID uuid, boolean online) This method updates the status of aGPSTransmitter
.
-
Constructor Details
-
GPSNetwork
- Parameters:
plugin
- OurSlimefun
instance
-
-
Method Details
-
updateTransmitter
This method updates the status of aGPSTransmitter
.- Parameters:
l
- TheLocation
of theGPSTransmitter
uuid
- TheUUID
who theGPSTransmitter
belongs toonline
- Whether thatGPSTransmitter
is online
-
getNetworkComplexity
This method calculates the GPS complexity for the givenUUID
. The complexity is determined by the Y level of eachGPSTransmitter
multiplied by the multiplier of that transmitter. -
countTransmitters
This method returns the amount ofTransmitters
for the givenUUID
.- Parameters:
uuid
- TheUUID
who these transmitters belong to- Returns:
- The amount of transmitters
-
openTransmitterControlPanel
public void openTransmitterControlPanel(@Nonnull org.bukkit.entity.Player p) This method opens theGPSTransmitter
control panel to the givenPlayer
.- Parameters:
p
- ThePlayer
-
getIcon
@ParametersAreNonnullByDefault @Nonnull public org.bukkit.inventory.ItemStack getIcon(String name, org.bukkit.World.Environment environment) This returns an icon for the given waypoint. The icon is dependent on theWorld.Environment
of the waypoint'sWorld
. 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 theWorld.Environment
.- Parameters:
name
- The name of a waypointenvironment
- TheWorld.Environment
of the waypoint'sWorld
- Returns:
- An icon for this waypoint
-
openWaypointControlPanel
public void openWaypointControlPanel(@Nonnull org.bukkit.entity.Player p) -
createWaypoint
public void createWaypoint(@Nonnull org.bukkit.entity.Player p, @Nonnull org.bukkit.Location l) This method will prompt the givenPlayer
to enter a name for a waypoint. After entering the name, it will be added to his waypoint list.- Parameters:
p
- ThePlayer
who should get a new waypointl
- TheLocation
of the new waypoint
-
addWaypoint
public void addWaypoint(@Nonnull org.bukkit.entity.Player p, @Nonnull String name, @Nonnull org.bukkit.Location l) This method adds a new waypoint with the given name andLocation
for thatPlayer
.- Parameters:
p
- ThePlayer
to get the new waypointname
- The name of this waypointl
- TheLocation
of this waypoint
-
getTransmitters
-
getTeleportationManager
This returns theTeleportationManager
for thisGPSNetwork
. It is responsible for all actions that relate to theTeleporter
.- Returns:
- The
TeleportationManager
for thisGPSNetwork
-
getResourceManager
- Returns:
- The
ResourceManager
for thisGPSNetwork
-