use of net.wurstclient.features.mods.other.NavigatorMod in project Wurst-MC-1.12 by Wurst-Imperium.
the class Mod method setBlocked.
public void setBlocked(boolean blocked) {
this.blocked = blocked;
active = enabled && !blocked;
if (!(this instanceof NavigatorMod))
UIRenderer.modList.updateState(this);
if (enabled)
try {
onToggle();
if (blocked)
onDisable();
else
onEnable();
} catch (Throwable e) {
CrashReport report = CrashReport.makeCrashReport(e, "Toggling Wurst mod");
CrashReportCategory category = report.makeCategory("Affected mod");
category.setDetail("Mod name", () -> name);
category.setDetail("Attempted action", () -> blocked ? "Block" : "Unblock");
throw new ReportedException(report);
}
}
use of net.wurstclient.features.mods.other.NavigatorMod in project Wurst-MC-1.12 by Wurst-Imperium.
the class Mod method setEnabled.
public final void setEnabled(boolean enabled) {
if (this.enabled == enabled)
return;
this.enabled = enabled;
active = enabled && !blocked;
if (!(this instanceof NavigatorMod))
UIRenderer.modList.updateState(this);
if (blocked && enabled)
return;
try {
onToggle();
if (enabled)
onEnable();
else
onDisable();
} catch (Throwable e) {
CrashReport report = CrashReport.makeCrashReport(e, "Toggling Wurst mod");
CrashReportCategory category = report.makeCategory("Affected mod");
category.setDetail("Mod name", () -> name);
category.setDetail("Attempted action", () -> enabled ? "Enable" : "Disable");
throw new ReportedException(report);
}
if (stateSaved)
ConfigFiles.MODS.save();
}
Aggregations