Class ToggleableModule
java.lang.Object
org.rusherhack.client.api.feature.module.Module
org.rusherhack.client.api.feature.module.ToggleableModule
- All Implemented Interfaces:
IModule
,Globals
,org.rusherhack.core.bind.IBindable
,org.rusherhack.core.event.listener.EventListener
,org.rusherhack.core.feature.IFeature
,org.rusherhack.core.feature.IFeatureConfigurable
,org.rusherhack.core.interfaces.IHideable
,org.rusherhack.core.interfaces.INamed
,org.rusherhack.core.interfaces.IToggleable
,org.rusherhack.core.logging.ILoggable
,org.rusherhack.core.notification.INotifiable
,org.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>
,org.rusherhack.core.serialize.JsonSerializable
public abstract class ToggleableModule
extends Module
implements org.rusherhack.core.interfaces.IToggleable, org.rusherhack.core.bind.IBindable
A module that can be toggled
-
Field Summary
-
Constructor Summary
ConstructorDescriptionToggleableModule
(String name, String description, ModuleCategory category) ToggleableModule
(String name, ModuleCategory category) -
Method Summary
Modifier and TypeMethodDescriptionboolean
deserialize
(com.google.gson.JsonElement jsonElement) boolean
boolean
void
Called when the module is disabled.void
onEnable()
Called when the module is enabled.void
com.google.gson.JsonElement
void
setToggled
(boolean toggled) void
toggle()
Methods inherited from class org.rusherhack.client.api.feature.module.Module
areNotificationsEnabled, createCommand, getCategory, getDescription, getLogger, getName, getSettings, isHidden, registerSettings, sendNotification, sendNotification, setHidden, setListening, setNotifications
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.rusherhack.core.feature.IFeatureConfigurable
getSetting, reset
Methods inherited from interface org.rusherhack.client.api.feature.module.IModule
getMetadata
Methods inherited from interface org.rusherhack.core.interfaces.INamed
getAliases, getDisplayName
Methods inherited from interface org.rusherhack.core.serialize.ISerializable
shouldAutoSave, shouldSerialize
-
Constructor Details
-
ToggleableModule
-
ToggleableModule
-
-
Method Details
-
toggle
public void toggle()- Specified by:
toggle
in interfaceorg.rusherhack.core.interfaces.IToggleable
-
isToggled
public boolean isToggled()- Specified by:
isToggled
in interfaceorg.rusherhack.core.interfaces.IToggleable
-
setToggled
public void setToggled(boolean toggled) - Specified by:
setToggled
in interfaceorg.rusherhack.core.interfaces.IToggleable
-
onEnable
public void onEnable()Called when the module is enabled.Avoid referencing the world or player here, because modules can be toggled while they are null.
- Specified by:
onEnable
in interfaceorg.rusherhack.core.interfaces.IToggleable
-
onDisable
public void onDisable()Called when the module is disabled.Avoid referencing the world or player here, because modules can be toggled while they are null.
- Specified by:
onDisable
in interfaceorg.rusherhack.core.interfaces.IToggleable
-
onKeybindEvent
public void onKeybindEvent()- Specified by:
onKeybindEvent
in interfaceorg.rusherhack.core.bind.IBindable
-
getBindReference
- Specified by:
getBindReference
in interfaceorg.rusherhack.core.bind.IBindable
-
isListening
public boolean isListening()- Specified by:
isListening
in interfaceorg.rusherhack.core.event.listener.EventListener
- Overrides:
isListening
in classModule
-
serialize
public com.google.gson.JsonElement serialize() -
deserialize
public boolean deserialize(com.google.gson.JsonElement jsonElement) - Specified by:
deserialize
in interfaceorg.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>
- Overrides:
deserialize
in classModule
-