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
ConstructorsConstructorDescriptionToggleableModule(String name, String description, ModuleCategory category) ToggleableModule(String name, ModuleCategory category) -
Method Summary
Modifier and TypeMethodDescriptionbooleandeserialize(com.google.gson.JsonElement jsonElement) booleanbooleanvoidCalled when the module is disabled.voidonEnable()Called when the module is enabled.voidcom.google.gson.JsonElementvoidsetToggled(boolean toggled) voidtoggle()Methods inherited from class org.rusherhack.client.api.feature.module.Module
areNotificationsEnabled, createCommand, getCategory, getDescription, getLogger, getName, getSettings, isHidden, registerSettings, sendNotification, sendNotification, setHidden, setListening, setNotificationsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.rusherhack.core.feature.IFeatureConfigurable
getSetting, resetMethods inherited from interface org.rusherhack.client.api.feature.module.IModule
getMetadataMethods inherited from interface org.rusherhack.core.interfaces.INamed
getAliases, getDisplayNameMethods inherited from interface org.rusherhack.core.serialize.ISerializable
shouldAutoSave, shouldSerialize
-
Constructor Details
-
ToggleableModule
-
ToggleableModule
-
-
Method Details
-
toggle
public void toggle()- Specified by:
togglein interfaceorg.rusherhack.core.interfaces.IToggleable
-
isToggled
public boolean isToggled()- Specified by:
isToggledin interfaceorg.rusherhack.core.interfaces.IToggleable
-
setToggled
public void setToggled(boolean toggled) - Specified by:
setToggledin 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:
onEnablein 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:
onDisablein interfaceorg.rusherhack.core.interfaces.IToggleable
-
onKeybindEvent
public void onKeybindEvent()- Specified by:
onKeybindEventin interfaceorg.rusherhack.core.bind.IBindable
-
getBindReference
- Specified by:
getBindReferencein interfaceorg.rusherhack.core.bind.IBindable
-
isListening
public boolean isListening()- Specified by:
isListeningin interfaceorg.rusherhack.core.event.listener.EventListener- Overrides:
isListeningin classModule
-
serialize
public com.google.gson.JsonElement serialize() -
deserialize
public boolean deserialize(com.google.gson.JsonElement jsonElement) - Specified by:
deserializein interfaceorg.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>- Overrides:
deserializein classModule
-