public abstract class Adapter extends Object
Constructor and Description |
---|
Adapter() |
Modifier and Type | Method and Description |
---|---|
abstract void |
broadcastMessage(String message)
Broadcast the message to all online player, without any filter.
|
boolean |
canSendStats()
Check if can send stats
|
abstract FakePlayer |
createFakePlayer(Location loc,
String name)
Create a fake player
WARN: Not supported yet with all platform
|
abstract Inventory |
createInventory(String inventoryName,
int size,
NegativityHolder holder)
Create a new inventory
|
abstract ItemBuilder |
createItemBuilder(ItemStack item)
Create a new item builder with the given item
|
abstract ItemBuilder |
createItemBuilder(Material type)
Create a new item builder with the given type
|
abstract ItemBuilder |
createItemBuilder(String type)
Create a new item builder with the given type name
|
abstract ItemBuilder |
createSkullItemBuilder(OfflinePlayer owner)
Create a new item builder of skull with the current owner
|
abstract ItemBuilder |
createSkullItemBuilder(Player owner)
Create a new item builder of skull with the current owner
|
void |
debug(String msg)
Log this message if debug is enabled
|
abstract NegativityAccountManager |
getAccountManager()
Get the account manager of the platform
|
static Adapter |
getAdapter() |
abstract List<String> |
getAllPlugins()
Get all plugins on the actual platform.
|
abstract Configuration |
getConfig()
Get the Negativity's config of the platform
|
abstract File |
getDataFolder()
Get the data folder of the plugin
|
abstract List<ExternalPlugin> |
getDependentPlugins() |
abstract ItemRegistrar |
getItemRegistrar()
Get the registrar of all items
|
abstract double |
getLastTPS()
Get last TPS value
|
abstract LoggerAdapter |
getLogger()
Get a logger adapter to log informations.
|
String |
getName()
Get the platform name
|
abstract @Nullable OfflinePlayer |
getOfflinePlayer(String name)
Get offline player with the given name
Prefer use
getOfflinePlayer(UUID) because this method isn't supported on all platform, and a name can be changed |
abstract @Nullable OfflinePlayer |
getOfflinePlayer(UUID uuid)
Get offline player with the given UUID
|
abstract List<Player> |
getOnlinePlayers()
Get all online players
|
abstract List<UUID> |
getOnlinePlayersUUID()
Get UUID of all online players
|
abstract Platform |
getPlatformID()
Get the platform
|
abstract TranslationProviderFactory |
getPlatformTranslationProviderFactory() |
abstract @Nullable Player |
getPlayer(String name)
Get player with the given name
Prefer use
getPlayer(UUID) because this method isn't supported on all platform, and a name can be changed |
abstract @Nullable Player |
getPlayer(UUID uuid)
Get player with the given UUID
|
abstract ExternalPlugin |
getPlugin(String name)
Get another plugin
|
abstract String |
getPluginVersion()
Get the version of the Negativity plugin
|
abstract Scheduler |
getScheduler() |
abstract Version |
getServerVersion()
The Minecraft version the server is running
|
abstract double[] |
getTPS()
Get all available TPS
This array is not empty, at least, it contains the
getLastTPS() value in [0] place |
@Nullable UUID |
getUUID(String name)
Get the UUID with the name
|
abstract String |
getVersion()
Get the platform version
|
abstract VersionAdapter<?> |
getVersionAdapter()
Get the version adapter for the actual platform version
|
abstract boolean |
hasPlugin(String name)
Check if another plugin is loaded.
|
abstract void |
registerNewIncomingChannel(String channel,
BiConsumer<Player,byte[]> event)
Register incoming channel and call consumer when receiving new channel message
|
abstract void |
reload()
Reload Negativity's plugin
|
abstract void |
reloadConfig()
Reload the configuration of Negativity
|
abstract void |
runConsoleCommand(String cmd)
Run a command from console
|
abstract void |
runSync(Runnable call)
Run action sync with the server.
|
abstract void |
sendMessageRunnableHover(Player p,
String message,
String hover,
String command)
Send message to the specified player which can run a command and have a message showed when the mouse is drag hover the message.
|
static void |
setAdapter(Adapter adapter) |
public static void setAdapter(Adapter adapter)
public static Adapter getAdapter()
public abstract Platform getPlatformID()
public String getName()
public abstract Configuration getConfig()
public abstract File getDataFolder()
public abstract LoggerAdapter getLogger()
public void debug(String msg)
msg
- the message to logpublic abstract TranslationProviderFactory getPlatformTranslationProviderFactory()
public abstract void reload()
public abstract String getVersion()
public abstract Version getServerVersion()
public abstract String getPluginVersion()
public abstract void reloadConfig()
public abstract NegativityAccountManager getAccountManager()
public abstract void runConsoleCommand(String cmd)
cmd
- the command which have to be executepublic abstract List<UUID> getOnlinePlayersUUID()
public abstract List<Player> getOnlinePlayers()
public abstract double[] getTPS()
getLastTPS()
value in [0] placepublic abstract double getLastTPS()
public abstract ItemRegistrar getItemRegistrar()
public abstract ItemBuilder createItemBuilder(Material type)
type
- the item typepublic abstract ItemBuilder createItemBuilder(ItemStack item)
item
- the beginning itempublic abstract ItemBuilder createItemBuilder(String type)
type
- the item type namepublic abstract ItemBuilder createSkullItemBuilder(Player owner)
owner
- the player owner of the skullpublic abstract ItemBuilder createSkullItemBuilder(OfflinePlayer owner)
owner
- the player owner of the skullpublic abstract Inventory createInventory(String inventoryName, int size, NegativityHolder holder)
inventoryName
- the inventory namesize
- the inventory sizeholder
- the inventory holderpublic @Nullable UUID getUUID(String name)
name
- the name of a possible playerpublic abstract @Nullable OfflinePlayer getOfflinePlayer(String name)
getOfflinePlayer(UUID)
because this method isn't supported on all platform, and a name can be changedname
- the offline player namenull
if no player matching this name has played on this serverpublic abstract @Nullable OfflinePlayer getOfflinePlayer(UUID uuid)
uuid
- the offline player UUIDnull
if no player with this UUID has played on this serverpublic abstract @Nullable Player getPlayer(String name)
getPlayer(UUID)
because this method isn't supported on all platform, and a name can be changedname
- the player namenull
if no player matching this name is onlinepublic abstract @Nullable Player getPlayer(UUID uuid)
uuid
- the player UUIDnull
if no player with this UUID is onlinepublic abstract FakePlayer createFakePlayer(Location loc, String name)
loc
- the location of the fake playername
- the name of the fake playerpublic abstract void sendMessageRunnableHover(Player p, String message, String hover, String command)
p
- the player that will receive the messagemessage
- the messagehover
- the hover message (show on mouse drag)command
- the command run on clickpublic abstract boolean hasPlugin(String name)
name
- the plugin name (used by the platform)public abstract ExternalPlugin getPlugin(String name)
name
- the plugin name (used by the platform)public abstract List<ExternalPlugin> getDependentPlugins()
public abstract void runSync(Runnable call)
call
- the action to callpublic abstract Scheduler getScheduler()
public boolean canSendStats()
public abstract void registerNewIncomingChannel(String channel, BiConsumer<Player,byte[]> event)
channel
- the channel nameevent
- The callable event which will be fired when received message from this channelpublic abstract void broadcastMessage(String message)
message
- the message to sendpublic abstract List<String> getAllPlugins()
public abstract VersionAdapter<?> getVersionAdapter()