public final class LunarClientAPI extends Object implements org.bukkit.event.Listener
| Modifier and Type | Field and Description |
|---|---|
static String |
MESSAGE_CHANNEL |
| Constructor and Description |
|---|
LunarClientAPI(org.bukkit.plugin.java.JavaPlugin plugin) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHologram(org.bukkit.entity.Player player,
UUID id,
org.bukkit.util.Vector position,
String[] lines)
Create a hologram for a player on the server.
|
void |
disableAllStaffModules(org.bukkit.entity.Player player)
Disables ALL staff modules for a specific player
regardless of if they are enabled.
|
void |
failPlayerRegister(org.bukkit.entity.Player player)
Called when the player has been online for 2 seconds without
sending any sort of registration stating they're on lunar client.
|
Set<org.bukkit.entity.Player> |
getPlayersRunningLunarClient()
Gets an immutable set of all the bukkit
Player currently running lunar client. |
String |
getWorldIdentifier(org.bukkit.World world)
Gets the world identifier weather that is custom or
the worlds generated Id for sending waypoints to the client.
|
void |
giveAllStaffModules(org.bukkit.entity.Player player)
Gives a player ALL staff modules.
|
void |
hideNametag(org.bukkit.entity.Player target,
org.bukkit.entity.Player viewer)
Hide the target's username from the viewer.
|
boolean |
isRunningLunarClient(org.bukkit.entity.Player player)
Checks if the player is currently running lunar client.
|
boolean |
isRunningLunarClient(UUID playerUuid)
Checks if a user is currently running LunarClient on the server.
|
void |
overrideNametag(org.bukkit.entity.Player target,
List<String> nametag,
org.bukkit.entity.Player viewer)
Override the normal (bukkit) nametag with lunar client club.skilldevs.utils.nametags.
|
void |
registerPlayer(org.bukkit.entity.Player player)
Register the player as a Lunar Client player based off of their
bukkit plugin channel registration.
|
void |
registerWorldIdentifier(org.bukkit.World world,
java.util.function.Function<org.bukkit.World,String> identifier)
Registers a custom name for the world to be identified as on the client.
|
void |
removeHologram(org.bukkit.entity.Player player,
UUID id)
Remove a previously set hologram for a specific player.
|
void |
removeWaypoint(org.bukkit.entity.Player player,
LCWaypoint waypoint)
Remove a waypoint that the server sent from a player.
|
void |
resetNametag(org.bukkit.entity.Player target,
org.bukkit.entity.Player viewer)
Reset anything done to the nametag.
|
boolean |
sendPacket(org.bukkit.entity.Player player,
LCPacket packet)
The most basic component of the Lunar Client API used
to send packets to the Lunar Client player.
|
void |
sendTeammates(org.bukkit.entity.Player player,
LCPacketTeammates packet)
Sends a validated teammate object to the player.
|
void |
sendWaypoint(org.bukkit.entity.Player player,
LCWaypoint waypoint)
Send a waypoint to a lunarclient player.
|
void |
setStaffModuleState(org.bukkit.entity.Player player,
StaffModule module,
boolean state)
Force set a specific
StaffModule for a specific player. |
void |
unregisterPlayer(org.bukkit.entity.Player player,
boolean quit)
Unregisters a player as a LunarClient player.
|
void |
updateHologram(org.bukkit.entity.Player player,
UUID id,
String[] lines)
Update the lines of a previously added hologram for a specific player.
|
public static final String MESSAGE_CHANNEL
public void failPlayerRegister(org.bukkit.entity.Player player)
LunarClientLoginListener. Do not use unless you are certain you need this.player - The player that has been online for at least 2 seconds.public void registerPlayer(org.bukkit.entity.Player player)
player - The player registering as a Lunar Client user.public void unregisterPlayer(org.bukkit.entity.Player player,
boolean quit)
player - The player who has unregistered themself from the plugin channel.quit - A Boolean value of weather the player quit or simply unregistered from the channel.public boolean isRunningLunarClient(org.bukkit.entity.Player player)
player - Player suspect of using Lunar Client.Boolean value of weather the online player is currently using Lunar Client.public boolean isRunningLunarClient(UUID playerUuid)
playerUuid - The ID of the suspect LunarClient user.Boolean value of weather the player is currently running Lunar Client.public Set<org.bukkit.entity.Player> getPlayersRunningLunarClient()
Player currently running lunar client.
NOTE: This would only be ideal for displaying an object of the player, for computation
it would probably be better to use the raw UUID of the players.public void setStaffModuleState(org.bukkit.entity.Player player,
StaffModule module,
boolean state)
StaffModule for a specific player.
Useful for enabling only a few StaffModuleplayer - The player receiving the staff modules.module - The staff module to set to a state.state - The new state of the StaffModule.public void giveAllStaffModules(org.bukkit.entity.Player player)
player - The player to receive the enabled staff modules.public void disableAllStaffModules(org.bukkit.entity.Player player)
player - The player receiving the new staff module state.public void sendTeammates(org.bukkit.entity.Player player,
LCPacketTeammates packet)
player - The player to receive the team matespacket - The teammates to send to the player.public void addHologram(org.bukkit.entity.Player player,
UUID id,
org.bukkit.util.Vector position,
String[] lines)
player - The observer of the new hologram.id - The randomly generated UUID for the hologram. This will need to be saved for other hologram actions.position - The location (x, y, z) of where the hologram will be placed in the world.lines - The lines of the hologram to be sent to the player.public void updateHologram(org.bukkit.entity.Player player,
UUID id,
String[] lines)
player - The observer of the new hologram lines.id - The ID of the previously placed hologram.lines - The new lines to show to the player.public void removeHologram(org.bukkit.entity.Player player,
UUID id)
player - The player to remove the hologram for.id - The ID of the previously created hologram.public void overrideNametag(org.bukkit.entity.Player target,
List<String> nametag,
org.bukkit.entity.Player viewer)
target - The player whos nametag will be affected for the viewer.nametag - The list of club.skilldevs.utils.nametags that will be sent to the viewer. Supports color codes.viewer - The observer who will see the targets nametag as a lunar client nametag.public void resetNametag(org.bukkit.entity.Player target,
org.bukkit.entity.Player viewer)
target - The player's nametag that will be reset for the viewer.viewer - The observer who will see the targets nametag as normal (bukkit).public void hideNametag(org.bukkit.entity.Player target,
org.bukkit.entity.Player viewer)
target - This player's nametag will be hidden from the viewer.viewer - The observer who will hide the targets nametag.public String getWorldIdentifier(org.bukkit.World world)
world - The world to get the identifier forString of the set name of the world, or default to the worlds unique id.public void registerWorldIdentifier(org.bukkit.World world,
java.util.function.Function<org.bukkit.World,String> identifier)
world - The bukkit object for the world.identifier - The new function identifier.public void sendWaypoint(org.bukkit.entity.Player player,
LCWaypoint waypoint)
player - A player running lunar client.waypoint - A new waypoint object to send to the player.public void removeWaypoint(org.bukkit.entity.Player player,
LCWaypoint waypoint)
player - A player running lunar client.waypoint - A waypoint object that the server has previously sent.public boolean sendPacket(org.bukkit.entity.Player player,
LCPacket packet)
player - The bukkit representation of the Player to receive the packet.packet - The Lunar Client packet that should be sent to the Lunar Client player.Boolean value of weather the packet was sent.Copyright © 2022. All rights reserved.