public class BukkitUtility
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static @NotNull java.lang.String |
color(@Nullable java.lang.Object object)
Translates
& color codes to ChatColor |
static @NotNull java.util.List<java.lang.String> |
colorCollection(@Nullable java.util.Collection<?> objects)
Translates
& color codes to ChatColor for a Collection of messages |
static @NotNull java.util.Set<java.lang.String> |
getAllPlayerNames()
Gets a
Set of all player names |
static @NotNull java.util.Optional<org.bukkit.OfflinePlayer> |
getOfflinePlayer(@NotNull java.lang.String name)
Gets an
OfflinePlayer from the specified name
Returns a Player if they're online |
static @NotNull java.util.Set<java.lang.String> |
getOfflinePlayerNames()
Gets a
Set of all offline player names |
static @NotNull java.util.Set<java.lang.String> |
getOnlinePlayerNames()
Gets a
Set of all online player names |
static @NotNull java.util.Optional<java.lang.Integer> |
getPermissionValue(@NotNull org.bukkit.entity.Player player,
@NotNull java.lang.String permission)
Gets the value of a permission node from a
Player
Example: player has friends.max.5 permission, getPermissionValue(player, "friends.max.") would return 5 |
static @NotNull java.util.Set<java.lang.String> |
getWorldNames()
Gets a
Set of all world names |
static @NotNull java.lang.String |
stripUntranslatedColor(@Nullable java.lang.String string)
Strips untranslated
ChatColors (using &) from a String |
static boolean |
toggleScoreboardTag(@NotNull org.bukkit.entity.Entity entity,
@NotNull java.lang.String scoreboardTag)
Toggles a scoreboard tag on an
Entity |
@NotNull
public static @NotNull java.lang.String color(@Nullable
@Nullable java.lang.Object object)
& color codes to ChatColorobject - the object/message to translate@NotNull
public static @NotNull java.util.List<java.lang.String> colorCollection(@Nullable
@Nullable java.util.Collection<?> objects)
& color codes to ChatColor for a Collection of messagesobjects - the objects/messages to translate@NotNull
public static @NotNull java.lang.String stripUntranslatedColor(@Nullable
@Nullable java.lang.String string)
ChatColors (using &) from a Stringstring - the String to stripStringpublic static boolean toggleScoreboardTag(@NotNull
@NotNull org.bukkit.entity.Entity entity,
@NotNull
@NotNull java.lang.String scoreboardTag)
Entityentity - the Entity to toggle the scoreboard tag onscoreboardTag - the scoreboard tag to toggle@NotNull
public static @NotNull java.util.Optional<java.lang.Integer> getPermissionValue(@NotNull
@NotNull org.bukkit.entity.Player player,
@NotNull
@NotNull java.lang.String permission)
Player
player has friends.max.5 permission, getPermissionValue(player, "friends.max.") would return 5player - the Player to get the permission value frompermission - the permission node to get the value of@NotNull
public static @NotNull java.util.Optional<org.bukkit.OfflinePlayer> getOfflinePlayer(@NotNull
@NotNull java.lang.String name)
OfflinePlayer from the specified name
Player if they're onlinename - the name of the playerOfflinePlayer, or empty if not found@NotNull public static @NotNull java.util.Set<java.lang.String> getOnlinePlayerNames()
Set of all online player namesSet of player names@NotNull public static @NotNull java.util.Set<java.lang.String> getOfflinePlayerNames()
Set of all offline player namesSet of player names@NotNull public static @NotNull java.util.Set<java.lang.String> getAllPlayerNames()
Set of all player namesSet of player names@NotNull public static @NotNull java.util.Set<java.lang.String> getWorldNames()
Set of all world namesSet of world names