public class Exceptions extends Object
| Constructor and Description |
|---|
Exceptions() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
arePluginsEnabled(boolean isInclusive,
Collection<String> names)
Checks if a plugin names' list are enabled.
|
boolean |
arePluginsEnabled(boolean isInclusive,
String... names)
Checks if a plugin names' array are enabled.
|
@NotNull org.bukkit.entity.Player |
checkPlayer(org.bukkit.entity.Player player)
Checks if the player is null.
|
@NotNull Class<?> |
getCallerClass(int index)
Returns the
Class object of the method's caller in the current thread's
stack trace at the specified index. |
void |
hasPluginAccess(Class<?> clazz) |
void |
hasPluginAccess(Class<?> clazz,
String message) |
void |
hasPluginAccess(Class<?> clazz,
Throwable throwable) |
boolean |
isPluginEnabled(String name)
Checks if a plugin is enabled.
|
boolean |
isPluginEnabled(String name,
boolean checkRunning)
Checks if a plugin is enabled.
|
public boolean isPluginEnabled(String name, boolean checkRunning)
name - the plugin's namecheckRunning - if it needs to check if the plugin's is runningpublic boolean isPluginEnabled(String name)
name - the plugin's namepublic boolean arePluginsEnabled(boolean isInclusive,
Collection<String> names)
isInclusive - if enabled, will return true if all plugins are enabled, otherwise false;
if false, will return true if at least one plugin is enabled, otherwise false
names - the plugin names' listpublic boolean arePluginsEnabled(boolean isInclusive,
String... names)
isInclusive - if enabled, will return true if all plugins are enabled, otherwise false;
if false, will return true if at least one plugin is enabled, otherwise false
names - the plugin names' array@NotNull public @NotNull org.bukkit.entity.Player checkPlayer(org.bukkit.entity.Player player)
player - a playerNullPointerException - if player is null@NotNull public @NotNull Class<?> getCallerClass(int index) throws ClassNotFoundException
Class object of the method's caller in the current thread's
stack trace at the specified index.
The index 0 corresponds to the Thread class itself, 1 corresponds to
the caller of this method, 2 corresponds to the caller of the method that called
this method, and so on.
index - the index of the caller in the current thread's stack traceClass object representing the class of the method's callerClassNotFoundException - if the class of the method's caller cannot be foundThread.getStackTrace(),
StackTraceElement.getClassName()public void hasPluginAccess(Class<?> clazz)
Copyright © 2023. All rights reserved.