use of me.earth.earthhack.api.setting.settings.BooleanSetting in project 3arthh4ck by 3arthqu4ke.
the class AntiPackets method registerSettings.
private void registerSettings(Iterable<BooleanSetting> settings, AntiPacketData data) {
for (BooleanSetting s : settings) {
register(s);
data.register(s.getName(), "Cancels " + s.getName() + " packets.");
}
}
use of me.earth.earthhack.api.setting.settings.BooleanSetting in project 3arthh4ck by 3arthqu4ke.
the class Notifications method createSettings.
private void createSettings() {
announceMap.clear();
Visibilities.VISIBILITY_MANAGER.registerVisibility(categories, configure::getValue);
for (Module module : Managers.MODULES.getRegistered()) {
Setting<Boolean> enabled = module.getSetting("Enabled", BooleanSetting.class);
if (enabled == null) {
continue;
}
enabled.addObserver(event -> {
if (isEnabled() && !event.isCancelled() && modules.getValue() && announceMap.get(module).getValue()) {
onToggleModule((Module) event.getSetting().getContainer(), event.getValue());
}
});
String name = module.getName();
if (this.getSetting(name) != null) {
name = "Show" + name;
}
Setting<Boolean> setting = register(new BooleanSetting(name, false));
announceMap.put(module, setting);
Visibilities.VISIBILITY_MANAGER.registerVisibility(setting, () -> configure.getValue() && categories.getValue() == module.getCategory());
this.getData().settingDescriptions().put(setting, "Announce Toggling of " + name + "?");
}
}
Aggregations