public class BukkitTriggerReactorCore extends TriggerReactorCore implements org.bukkit.plugin.Plugin
Try not to import Bukkit related classes in here for sake of code cohesiveness if it's not necessary. (Put them in the AbstractJavaPlugin or its child instead. Plugin class is exception since the BukkitTriggerReactorCore wants to act as delegate class of JavaPlugin)
| Modifier and Type | Field and Description |
|---|---|
protected static AbstractBukkitWrapper |
WRAPPER |
CACHED_THREAD_POOL, PERMISSION, sharedVars| Constructor and Description |
|---|
BukkitTriggerReactorCore() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addItemLore(IItemStack iS,
String lore) |
void |
callEvent(IEvent event)
Call event so that it can be heard by listeners
|
<T> Future<T> |
callSyncMethod(Callable<T> call)
Run Callable on the server thread.
|
Object |
createEmptyPlayerEvent(ICommandSender sender) |
Interpreter.ProcessInterrupter |
createInterrupter(Object e,
Interpreter interpreter,
Map<UUID,Long> cooldowns)
Create ProcessInterrupter that will be used for the most of the Triggers.
|
Interpreter.ProcessInterrupter |
createInterrupterForInv(Object e,
Interpreter interpreter,
Map<UUID,Long> cooldowns,
Map<IInventory,InventoryTrigger> inventoryMap)
Create ProcessInterrupter that will be used for the most of the Triggers.
|
Object |
createPlayerCommandEvent(ICommandSender sender,
String label,
String[] args) |
void |
disablePlugin()
Disable this plugin.
|
IPlayer |
extractPlayerFromContext(Object e)
try to extract player from context 'e'.
|
AbstractAreaTriggerManager |
getAreaManager() |
String |
getAuthor()
get Author of plugin
|
AbstractJavaPlugin.BungeeCordHelper |
getBungeeHelper() |
AbstractLocationBasedTriggerManager<AbstractLocationBasedTriggerManager.ClickTrigger> |
getClickManager() |
AbstractCommandTriggerManager |
getCmdManager() |
org.bukkit.configuration.file.FileConfiguration |
getConfig() |
Object |
getConfig(String key)
Get the saved value associated with 'key' in config.yml.
|
<T> T |
getConfig(String key,
T def)
Get the saved value associated with 'key' in config.yml.
|
ICommandSender |
getConsoleSender()
get sender instance of the console
|
AbstractCustomTriggerManager |
getCustomManager() |
Map<String,Object> |
getCustomVarsForTrigger(Object e)
extract useful custom variables manually from 'context'
|
File |
getDataFolder()
Get folder where the plugin files will be saved.
|
org.bukkit.generator.ChunkGenerator |
getDefaultWorldGenerator(String worldName,
String id) |
org.bukkit.plugin.PluginDescriptionFile |
getDescription() |
AbstractExecutorManager |
getExecutorManager() |
AbstractInventoryEditManager |
getInvEditManager() |
AbstractInventoryTriggerManager |
getInvManager() |
AbstractPlayerLocationManager |
getLocationManager() |
Logger |
getLogger()
get Logger.
|
<T> T |
getMain()
Get the main class instance.
|
AbstractJavaPlugin.MysqlSupport |
getMysqlHelper() |
String |
getName() |
AbstractNamedTriggerManager |
getNamedTriggerManager() |
AbstractPermissionManager |
getPermissionManager() |
AbstractPlaceholderManager |
getPlaceholderManager() |
IPlayer |
getPlayer(String string) |
String |
getPluginDescription()
get Plugin's description.
|
org.bukkit.plugin.PluginLoader |
getPluginLoader() |
AbstractRepeatingTriggerManager |
getRepeatManager() |
InputStream |
getResource(String filename) |
AbstractScriptEditManager |
getScriptEditManager() |
AbstractAreaSelectionManager |
getSelectionManager() |
SelfReference |
getSelfReference() |
org.bukkit.Server |
getServer() |
Lag |
getTpsHelper() |
String |
getVersion()
get Plugin's version as String
|
AbstractLocationBasedTriggerManager<AbstractLocationBasedTriggerManager.WalkTrigger> |
getWalkManager() |
static AbstractBukkitWrapper |
getWrapper() |
boolean |
isConfigSet(String key)
Check if the 'key' is set in the config.yml.
|
boolean |
isEnabled()
Check if this plugin is enabled.
|
boolean |
isNaggable() |
boolean |
isServerThread()
Check if the current Thread is the Server
|
boolean |
onCommand(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command command,
String label,
String[] args) |
void |
onCoreDisable(AbstractJavaPlugin plugin) |
void |
onCoreEnable(AbstractJavaPlugin plugin) |
void |
onDisable() |
void |
onEnable() |
void |
onLoad() |
List<String> |
onTabComplete(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command command,
String alias,
String[] args) |
void |
registerEvents(Manager manager)
Register events for Managers.
|
void |
reloadConfig()
Save all configs from config.yml.
|
protected boolean |
removeLore(IItemStack iS,
int index) |
void |
runTask(Runnable runnable)
Run task on the server thread.
|
void |
saveAsynchronously(Manager manager)
Call saveAll() on separated thread.
|
void |
saveConfig()
Save all configs to config.yml.
|
void |
saveDefaultConfig() |
void |
saveResource(String resourcePath,
boolean replace) |
protected void |
sendCommandDesc(ICommandSender sender,
String command,
String desc)
Send command description.
|
protected void |
sendDetails(ICommandSender sender,
String detail)
Send detail under the command.
|
void |
setConfig(String key,
Object value)
Save the 'value' to the associated 'key' in config.yml.
|
protected void |
setItemTitle(IItemStack iS,
String title) |
protected boolean |
setLore(IItemStack iS,
int index,
String lore) |
void |
setNaggable(boolean canNag) |
void |
showGlowStones(ICommandSender sender,
Set<Map.Entry<SimpleLocation,Trigger>> set)
Show glowstones to indicate the walk/click triggers in the chunk.
|
getInstance, getPluginConfigManager, getSharedVars, getVariableManager, handleException, handleException, isDebugging, onCommand, onCoreDisable, onCoreEnable, onTabComplete, submitAsync, submitSyncprotected static AbstractBukkitWrapper WRAPPER
public static AbstractBukkitWrapper getWrapper()
public SelfReference getSelfReference()
getSelfReference in class TriggerReactorCorepublic AbstractExecutorManager getExecutorManager()
getExecutorManager in class TriggerReactorCorepublic AbstractPlaceholderManager getPlaceholderManager()
getPlaceholderManager in class TriggerReactorCorepublic AbstractScriptEditManager getScriptEditManager()
getScriptEditManager in class TriggerReactorCorepublic AbstractPlayerLocationManager getLocationManager()
getLocationManager in class TriggerReactorCorepublic AbstractPermissionManager getPermissionManager()
getPermissionManager in class TriggerReactorCorepublic AbstractAreaSelectionManager getSelectionManager()
getSelectionManager in class TriggerReactorCorepublic AbstractInventoryEditManager getInvEditManager()
getInvEditManager in class TriggerReactorCorepublic AbstractLocationBasedTriggerManager<AbstractLocationBasedTriggerManager.ClickTrigger> getClickManager()
getClickManager in class TriggerReactorCorepublic AbstractLocationBasedTriggerManager<AbstractLocationBasedTriggerManager.WalkTrigger> getWalkManager()
getWalkManager in class TriggerReactorCorepublic AbstractCommandTriggerManager getCmdManager()
getCmdManager in class TriggerReactorCorepublic AbstractInventoryTriggerManager getInvManager()
getInvManager in class TriggerReactorCorepublic AbstractAreaTriggerManager getAreaManager()
getAreaManager in class TriggerReactorCorepublic AbstractCustomTriggerManager getCustomManager()
getCustomManager in class TriggerReactorCorepublic AbstractRepeatingTriggerManager getRepeatManager()
getRepeatManager in class TriggerReactorCorepublic AbstractNamedTriggerManager getNamedTriggerManager()
getNamedTriggerManager in class TriggerReactorCorepublic AbstractJavaPlugin.BungeeCordHelper getBungeeHelper()
public Lag getTpsHelper()
public AbstractJavaPlugin.MysqlSupport getMysqlHelper()
public void onCoreEnable(AbstractJavaPlugin plugin)
public void onCoreDisable(AbstractJavaPlugin plugin)
protected void sendCommandDesc(ICommandSender sender, String command, String desc)
TriggerReactorCoresendCommandDesc in class TriggerReactorCoresender - sender to show descriptioncommand - the command to explaindesc - descriptionprotected void sendDetails(ICommandSender sender, String detail)
TriggerReactorCoreTriggerReactorCore.sendCommandDesc(ICommandSender, String, String)
to add more information or example about the command.sendDetails in class TriggerReactorCoresender - sender to show descriptiondetail - detail to showpublic String getPluginDescription()
TriggerReactorCoregetPluginDescription in class TriggerReactorCorepublic String getVersion()
TriggerReactorCoregetVersion in class TriggerReactorCorepublic String getAuthor()
TriggerReactorCoregetAuthor in class TriggerReactorCorepublic void showGlowStones(ICommandSender sender, Set<Map.Entry<SimpleLocation,Trigger>> set)
TriggerReactorCoreshowGlowStones in class TriggerReactorCoresender - sender to show the glow stonesset - the set contains location of block and its associated trigger.public void registerEvents(Manager manager)
TriggerReactorCoreregisterEvents in class TriggerReactorCoremanager - the object instance of Managerpublic File getDataFolder()
TriggerReactorCoregetDataFolder in interface org.bukkit.plugin.PlugingetDataFolder in class TriggerReactorCorepublic Logger getLogger()
TriggerReactorCoregetLogger in interface org.bukkit.plugin.PlugingetLogger in class TriggerReactorCorepublic boolean isEnabled()
TriggerReactorCoreisEnabled in interface org.bukkit.plugin.PluginisEnabled in class TriggerReactorCorepublic <T> T getMain()
TriggerReactorCoregetMain in class TriggerReactorCorepublic boolean isConfigSet(String key)
TriggerReactorCoreisConfigSet in class TriggerReactorCorekey - the keypublic void setConfig(String key, Object value)
TriggerReactorCoreTriggerReactorCore.saveConfig()setConfig in class TriggerReactorCorekey - the keyvalue - the value to set.public Object getConfig(String key)
TriggerReactorCoregetConfig in class TriggerReactorCorekey - the keypublic <T> T getConfig(String key, T def)
TriggerReactorCoregetConfig in class TriggerReactorCorekey - the keydef - the default value to return if the 'key' is not setpublic void saveConfig()
TriggerReactorCoresaveConfig in interface org.bukkit.plugin.PluginsaveConfig in class TriggerReactorCorepublic void reloadConfig()
TriggerReactorCorereloadConfig in interface org.bukkit.plugin.PluginreloadConfig in class TriggerReactorCorepublic void runTask(Runnable runnable)
TriggerReactorCorerunTask in class TriggerReactorCorerunnable - the Runnable to runpublic void saveAsynchronously(Manager manager)
TriggerReactorCoresaveAsynchronously in class TriggerReactorCorepublic Interpreter.ProcessInterrupter createInterrupter(Object e, Interpreter interpreter, Map<UUID,Long> cooldowns)
TriggerReactorCorecreateInterrupter in class TriggerReactorCoree - the contextinterpreter - the interpretercooldowns - list of current cooldowns.public Interpreter.ProcessInterrupter createInterrupterForInv(Object e, Interpreter interpreter, Map<UUID,Long> cooldowns, Map<IInventory,InventoryTrigger> inventoryMap)
TriggerReactorCorecreateInterrupterForInv in class TriggerReactorCoree - the contextinterpreter - the interpretercooldowns - list of current cooldowns.inventoryMap - the inventory map that contains all the information about open inventories. As child class that implements
IIventory should override hashCode() and equals() methods, you can assume that each IInventory instance represents one trigger
that is running with the InventoryTrigger mapped. So it is ideal to get inventory object from the 'e' context and see if the Inventory
object exists in the 'inventoryMap.' For the properly working InventoryTriggerManager, closing the inventory should delete the IInventory
from the 'inventoryMap,' so you can safely assume that closed inventory will not exists in the 'inventoryMap.'public IPlayer extractPlayerFromContext(Object e)
TriggerReactorCoreextractPlayerFromContext in class TriggerReactorCoree - Event for Bukkit APIpublic <T> Future<T> callSyncMethod(Callable<T> call)
TriggerReactorCorecallSyncMethod in class TriggerReactorCorecall - the callablepublic void disablePlugin()
TriggerReactorCoredisablePlugin in class TriggerReactorCorepublic void callEvent(IEvent event)
TriggerReactorCorecallEvent in class TriggerReactorCorepublic IPlayer getPlayer(String string)
getPlayer in class TriggerReactorCorepublic Object createEmptyPlayerEvent(ICommandSender sender)
createEmptyPlayerEvent in class TriggerReactorCorepublic Object createPlayerCommandEvent(ICommandSender sender, String label, String[] args)
createPlayerCommandEvent in class TriggerReactorCoreprotected void setItemTitle(IItemStack iS, String title)
setItemTitle in class TriggerReactorCoreprotected void addItemLore(IItemStack iS, String lore)
addItemLore in class TriggerReactorCoreprotected boolean setLore(IItemStack iS, int index, String lore)
setLore in class TriggerReactorCoreprotected boolean removeLore(IItemStack iS, int index)
removeLore in class TriggerReactorCorepublic boolean isServerThread()
TriggerReactorCoreisServerThread in class TriggerReactorCorepublic Map<String,Object> getCustomVarsForTrigger(Object e)
TriggerReactorCoregetCustomVarsForTrigger in class TriggerReactorCorepublic ICommandSender getConsoleSender()
TriggerReactorCoregetConsoleSender in class TriggerReactorCorepublic List<String> onTabComplete(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)
onTabComplete in interface org.bukkit.command.TabCompleterpublic boolean onCommand(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command command,
String label,
String[] args)
onCommand in interface org.bukkit.command.CommandExecutorpublic org.bukkit.plugin.PluginDescriptionFile getDescription()
getDescription in interface org.bukkit.plugin.Pluginpublic org.bukkit.configuration.file.FileConfiguration getConfig()
getConfig in interface org.bukkit.plugin.Pluginpublic InputStream getResource(String filename)
getResource in interface org.bukkit.plugin.Pluginpublic void saveDefaultConfig()
saveDefaultConfig in interface org.bukkit.plugin.Pluginpublic void saveResource(String resourcePath, boolean replace)
saveResource in interface org.bukkit.plugin.Pluginpublic org.bukkit.plugin.PluginLoader getPluginLoader()
getPluginLoader in interface org.bukkit.plugin.Pluginpublic org.bukkit.Server getServer()
getServer in interface org.bukkit.plugin.Pluginpublic void onDisable()
onDisable in interface org.bukkit.plugin.Pluginpublic void onLoad()
onLoad in interface org.bukkit.plugin.Pluginpublic void onEnable()
onEnable in interface org.bukkit.plugin.Pluginpublic boolean isNaggable()
isNaggable in interface org.bukkit.plugin.Pluginpublic void setNaggable(boolean canNag)
setNaggable in interface org.bukkit.plugin.Pluginpublic org.bukkit.generator.ChunkGenerator getDefaultWorldGenerator(String worldName, String id)
getDefaultWorldGenerator in interface org.bukkit.plugin.Pluginpublic String getName()
getName in interface org.bukkit.plugin.Plugin