Class Module
java.lang.Object
com.zenith.module.api.ModuleUtils
com.zenith.module.api.Module
- Direct Known Subclasses:
AbstractInventoryModule, ActionLimiter, ActiveHours, AntiAFK, AntiKick, AntiLeak, AutoArmor, AutoDisconnect, AutoDrop, AutoReconnect, AutoReply, AutoRespawn, ChatHistory, Click, CoordObfuscation, ExtraChat, QueueWarning, ReplayMod, Requeue, SessionTimeLimit, Spammer, SpawnPatrol, Spook, Tasks, VisualRange
Module system base class.
-
Field Summary
Fields inherited from class ModuleUtils
moduleAlertPrefix, moduleLogPrefix -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()Disables the module, does not check enabledSetting() or set any config valuesvoidenable()Enables the module, does not check enabledSetting() or set any config valuesabstract booleanWhether this module should be enabled automatically on startup Typically, this should be read from a config boolean value@Nullable PacketHandlerCodec@Nullable PacketHandlerCodecbooleanvoidOverride to run a custom hook when the module is disabledvoidonEnable()Override to run a custom hook when the module is enabled@Nullable PacketHandlerCodecOverride this to register client packet handlers Meaning packets between zenith and the destination serverList<com.github.rfresh2.EventConsumer<?>> Override this to register module events@Nullable PacketHandlerCodecOverride this to register server packet handlers Meaning packets between zenith and players - both spectators and controlling playervoidsetEnabled(boolean enabled) Sets the module enabled state, does not set any config valuesvoidExecuted when the module is enabled Should not usually be overridden or run directlyvoidSets the module enabled state from the result of enabledSetting()voidExecuted when the module is disabled Should not usually be overridden or run directlyMethods inherited from class ModuleUtils
debug, debug, debug, disconnect, discordAndIngameNotification, discordNotification, error, error, error, executeCommand, info, info, info, inGameAlert, inGameAlertActivePlayer, sendClientPacket, sendClientPacketAsync, sendClientPacketAwait, sendClientPacketsAsync, warn, warn, warn
-
Constructor Details
-
Module
public Module()
-
-
Method Details
-
enabledSetting
public abstract boolean enabledSetting()Whether this module should be enabled automatically on startup Typically, this should be read from a config boolean value -
registerEvents
Override this to register module events -
registerClientPacketHandlerCodec
Override this to register client packet handlers Meaning packets between zenith and the destination server -
registerServerPacketHandlerCodec
Override this to register server packet handlers Meaning packets between zenith and players - both spectators and controlling player -
onEnable
public void onEnable()Override to run a custom hook when the module is enabled -
onDisable
public void onDisable()Override to run a custom hook when the module is disabled -
enable
public void enable()Enables the module, does not check enabledSetting() or set any config values -
disable
public void disable()Disables the module, does not check enabledSetting() or set any config values -
setEnabled
public void setEnabled(boolean enabled) Sets the module enabled state, does not set any config values -
syncEnabledFromConfig
public void syncEnabledFromConfig()Sets the module enabled state from the result of enabledSetting() -
subscribeEvents
public void subscribeEvents()Executed when the module is enabled Should not usually be overridden or run directly -
unsubscribeEvents
public void unsubscribeEvents()Executed when the module is disabled Should not usually be overridden or run directly -
isEnabled
public boolean isEnabled() -
getClientPacketHandlerCodec
-
getServerPacketHandlerCodec
-