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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addWaypoint
(Player p, String name, Location l) int
countTransmitters
(UUID uuid) This method returns the amount ofTransmitters
for the givenUUID
.void
createWaypoint
(Player p, Location l) This method will prompt the givenPlayer
to enter a name for a waypoint.getIcon
(String name, World.Environment environment) 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
.getTransmitters
(UUID uuid) void
This method opens theGPSTransmitter
control panel to the givenPlayer
.void
void
updateTransmitter
(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
This method opens theGPSTransmitter
control panel to the givenPlayer
.- Parameters:
p
- ThePlayer
-
getIcon
@ParametersAreNonnullByDefault @Nonnull public ItemStack getIcon(String name, 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
-
createWaypoint
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. -
addWaypoint
-
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
-