use of io.github.nucleuspowered.nucleus.modules.afk.config.AFKConfig in project Nucleus by NucleusPowered.
the class AFKCommandInterceptor method onReload.
@Override
public void onReload() throws Exception {
AFKConfig config = Nucleus.getNucleus().getInternalServiceManager().getServiceUnchecked(AFKConfigAdapter.class).getNodeOrDefault();
if (config.isAlertSenderOnAfk()) {
NucleusTextTemplate textTemplate = config.getMessages().getOnCommand();
if (textTemplate == null || textTemplate.isEmpty()) {
// NPE has occurred here in the past due to an empty message.
this.message = null;
} else {
this.message = textTemplate;
}
this.send = true;
} else {
this.message = null;
this.send = false;
}
}
Aggregations