Add a manual toggle
This commit is contained in:
parent
4b22355348
commit
4053e43964
@ -17,6 +17,11 @@ import java.util.Map;
|
||||
public class AprilFoolsManager extends MiniPlugin
|
||||
{
|
||||
|
||||
/**
|
||||
* Manually can be toggled to enable or disable the April Fools activities.
|
||||
*/
|
||||
private static final boolean ENABLED = true;
|
||||
|
||||
private static final Map<String, String> CHAT_REPLACEMENTS = ImmutableMap.<String, String>builder()
|
||||
.put("you", "ye")
|
||||
.put("yes", "aye")
|
||||
@ -88,7 +93,7 @@ public class AprilFoolsManager extends MiniPlugin
|
||||
super("April Fools");
|
||||
|
||||
_instance = this;
|
||||
_enabled = true;
|
||||
setEnabled(true);
|
||||
_enabledTitle = UtilServer.isHubServer() || UtilServer.isTestServer();
|
||||
|
||||
if (_enabled)
|
||||
@ -184,7 +189,7 @@ public class AprilFoolsManager extends MiniPlugin
|
||||
@EventHandler
|
||||
public void updateRandomMessage(UpdateEvent event)
|
||||
{
|
||||
if (!_enabledTitle || event.getType() != UpdateType.SLOW)
|
||||
if (!_enabled || !_enabledTitle || event.getType() != UpdateType.SLOW)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -219,7 +224,7 @@ public class AprilFoolsManager extends MiniPlugin
|
||||
|
||||
public void setEnabled(boolean enabled)
|
||||
{
|
||||
_enabled = enabled;
|
||||
_enabled = ENABLED && enabled;
|
||||
}
|
||||
|
||||
public static AprilFoolsManager getInstance()
|
||||
|
Loading…
Reference in New Issue
Block a user