public class AnnoyingUtility
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static @NotNull java.lang.String |
color(@Nullable java.lang.String message)
Translates
& color codes to ChatColor |
static @NotNull java.lang.String |
formatMillis(long value,
@Nullable java.lang.String pattern,
boolean padWithZeros)
Formats a millisecond long using the given pattern
|
static @NotNull java.lang.String |
formatNumber(@NotNull java.lang.Number value,
@Nullable java.lang.String pattern)
Formats a
Double value using the given pattern |
static @NotNull java.util.Set<java.lang.String> |
getAllPlayerNames()
Gets a
Set of all player names |
static @NotNull java.util.Set<java.lang.String> |
getEnumNames(@NotNull java.lang.Class<? extends java.lang.Enum<?>> enumClass)
Gets a
Set of all the enum's value's names |
static @NotNull java.util.Set<java.lang.String> |
getFileNames(@NotNull AnnoyingPlugin plugin,
@NotNull java.lang.String path)
Gets a
Set of all YML file names in a folder. |
static @Nullable com.google.gson.JsonElement |
getJson(@NotNull java.lang.String userAgent,
@NotNull java.lang.String urlString)
Retrieves the
JsonElement from the specified URL |
static @Nullable org.bukkit.OfflinePlayer |
getOfflinePlayer(@NotNull java.lang.String name)
Gets an
OfflinePlayer from the specified name |
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.Set<java.lang.String> |
getWorldNames()
Gets a
Set of all world names |
@NotNull
public static @NotNull java.lang.String color(@Nullable
@Nullable java.lang.String message)
& color codes to ChatColormessage - the message to translate@Nullable
public static @Nullable org.bukkit.OfflinePlayer getOfflinePlayer(@NotNull
@NotNull java.lang.String name)
OfflinePlayer from the specified namename - the name of the playerOfflinePlayer, or null if not found@NotNull
public static @NotNull java.lang.String formatMillis(long value,
@Nullable
@Nullable java.lang.String pattern,
boolean padWithZeros)
value - the milliseconds to formatpattern - the way in which to format the millisecondspadWithZeros - whether to pad the left hand side of numbers with 0's@NotNull
public static @NotNull java.lang.String formatNumber(@NotNull
@NotNull java.lang.Number value,
@Nullable
@Nullable java.lang.String pattern)
Double value using the given patternvalue - the Number to formatpattern - the pattern to use@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@NotNull
public static @NotNull java.util.Set<java.lang.String> getEnumNames(@NotNull
@NotNull java.lang.Class<? extends java.lang.Enum<?>> enumClass)
Set of all the enum's value's namesenumClass - the enum class to get the names fromSet of the enum's value's names@NotNull
public static @NotNull java.util.Set<java.lang.String> getFileNames(@NotNull
@NotNull AnnoyingPlugin plugin,
@NotNull
@NotNull java.lang.String path)
Set of all YML file names in a folder. If the path is not a folder, an empty Set is returnedplugin - the AnnoyingPlugin to get the folder frompath - the path to the folderSet all YML file names in the folder@Nullable
public static @Nullable com.google.gson.JsonElement getJson(@NotNull
@NotNull java.lang.String userAgent,
@NotNull
@NotNull java.lang.String urlString)
JsonElement from the specified URLuserAgent - the user agent to use when retrieving the JsonElementurlString - the URL to retrieve the JsonElement fromJsonElement retrieved from the specified URL