public class TriggerReactor extends TriggerReactorCore
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ID |
CACHED_THREAD_POOL, PERMISSION, sharedVars| Constructor and Description |
|---|
TriggerReactor() |
| 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
|
AbstractLocationBasedTriggerManager<AbstractLocationBasedTriggerManager.ClickTrigger> |
getClickManager() |
AbstractCommandTriggerManager |
getCmdManager() |
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.
|
AbstractExecutorManager |
getExecutorManager() |
AbstractInventoryEditManager |
getInvEditManager() |
AbstractInventoryTriggerManager |
getInvManager() |
AbstractPlayerLocationManager |
getLocationManager() |
Logger |
getLogger()
get Logger.
|
<T> T |
getMain()
Get the main class instance.
|
AbstractNamedTriggerManager |
getNamedTriggerManager() |
AbstractPermissionManager |
getPermissionManager() |
AbstractPlaceholderManager |
getPlaceholderManager() |
IPlayer |
getPlayer(String string) |
String |
getPluginDescription()
get Plugin's description.
|
AbstractRepeatingTriggerManager |
getRepeatManager() |
AbstractScriptEditManager |
getScriptEditManager() |
AbstractAreaSelectionManager |
getSelectionManager() |
SelfReference |
getSelfReference() |
Lag |
getTpsHelper() |
String |
getVersion()
get Plugin's version as String
|
AbstractLocationBasedTriggerManager<AbstractLocationBasedTriggerManager.WalkTrigger> |
getWalkManager() |
static SpongeWrapper |
getWrapper() |
boolean |
isConfigSet(String key)
Check if the 'key' is set in the config.yml.
|
boolean |
isEnabled()
Check if this plugin is enabled.
|
boolean |
isServerThread()
Check if the current Thread is the Server
|
void |
onConstruct(org.spongepowered.api.event.game.state.GameInitializationEvent event) |
void |
onDisable(org.spongepowered.api.event.game.state.GameStoppingServerEvent e) |
void |
onEnable(org.spongepowered.api.event.game.state.GameStartedServerEvent e) |
void |
onInitialize(org.spongepowered.api.event.game.state.GameAboutToStartServerEvent e) |
void |
onLoadComplete(org.spongepowered.api.event.game.state.GameAboutToStartServerEvent e) |
void |
onReload(org.spongepowered.api.event.game.GameReloadEvent event) |
void |
onTabComplete(org.spongepowered.api.event.command.TabCompleteEvent.Command e) |
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.
|
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) |
protected 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 final String ID
public static SpongeWrapper getWrapper()
public void onConstruct(org.spongepowered.api.event.game.state.GameInitializationEvent event)
public Lag getTpsHelper()
public void onLoadComplete(org.spongepowered.api.event.game.state.GameAboutToStartServerEvent e)
public void onInitialize(org.spongepowered.api.event.game.state.GameAboutToStartServerEvent e)
public void onEnable(org.spongepowered.api.event.game.state.GameStartedServerEvent e)
public void onDisable(org.spongepowered.api.event.game.state.GameStoppingServerEvent e)
public void onReload(org.spongepowered.api.event.game.GameReloadEvent event)
public void onTabComplete(org.spongepowered.api.event.command.TabCompleteEvent.Command e)
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 TriggerReactorCoreprotected boolean removeLore(IItemStack iS, int index)
removeLore in class TriggerReactorCoreprotected boolean setLore(IItemStack iS, int index, String lore)
setLore in class TriggerReactorCoreprotected void addItemLore(IItemStack iS, String lore)
addItemLore in class TriggerReactorCoreprotected void setItemTitle(IItemStack iS, String title)
setItemTitle 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 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 TriggerReactorCoreprotected 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 class TriggerReactorCorepublic Logger getLogger()
TriggerReactorCoregetLogger in class TriggerReactorCorepublic boolean isEnabled()
TriggerReactorCoreisEnabled in class TriggerReactorCorepublic void disablePlugin()
TriggerReactorCoredisablePlugin 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 class TriggerReactorCorepublic void reloadConfig()
TriggerReactorCorereloadConfig 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 callEvent(IEvent event)
TriggerReactorCorecallEvent in class TriggerReactorCorepublic boolean isServerThread()
TriggerReactorCoreisServerThread in class TriggerReactorCorepublic Map<String,Object> getCustomVarsForTrigger(Object e)
TriggerReactorCoregetCustomVarsForTrigger in class TriggerReactorCorepublic ICommandSender getConsoleSender()
TriggerReactorCoregetConsoleSender in class TriggerReactorCore