chore(history): squash 10 commit(s) from 2026-07-31
- feat: Фаза 1 ребрендинг combatant → lovisual + восстановление config - refactor: Фаза 2 — выкинуть Runtime/JarReplacement, заменить на Lifecycle - refactor: Фаза 3.5 — удалить читерские модули, ESP под легит - refactor: Фаза 3 — разбить Renderer2D (3379→2150 фасад + 14 хелперов ≤200) - refactor: Фаза 3 — разбить BetterChatRenderer (2870→210 фасад + 21 хелпер ≤200) - refactor: Фаза 3 — разбить UnifiedSettingRenderer (2798→208 фасад + 24 хелпера ≤200) - refactor: Фаза 3 — разбить ClickGuiRenderer (1887→542 фасад + 15 хелперов ≤200) - refactor: Фаза 3 — разбить NameTags (1791→438 фасад + 11 хелперов ≤200) - refactor: Фаза 3 — разбить TargetHud (1655→340 фасад + 11 хелперов ≤200) - refactor: Фаза 3 — разбить ESP (1538→269 фасад + 11 хелперов ≤200)
This commit is contained in:
parent
8084ac50b3
commit
52d87368c9
1595 changed files with 35857 additions and 51145 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -15,10 +15,6 @@ import dev.loki.lovisual.features.gui.hud.nondraggable.StaticHudElementRegistry;
|
|||
import dev.loki.lovisual.features.module.Module;
|
||||
import dev.loki.lovisual.features.module.ModuleAutoLoader;
|
||||
import dev.loki.lovisual.features.module.ModuleManager;
|
||||
import dev.loki.lovisual.runtime.ClientRuntime;
|
||||
import dev.loki.lovisual.runtime.RuntimeResumeParticipant;
|
||||
import dev.loki.lovisual.runtime.RuntimeShutdownContext;
|
||||
import dev.loki.lovisual.runtime.RuntimeShutdownParticipant;
|
||||
import dev.loki.lovisual.util.logging.DebugLog;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.metadata.CustomValue;
|
||||
|
|
@ -34,7 +30,7 @@ import java.util.Map;
|
|||
public enum AddonManager {
|
||||
;
|
||||
|
||||
public static final String ADDON_METADATA_KEY = "combatant:addon";
|
||||
public static final String ADDON_METADATA_KEY = "lovisual:addon";
|
||||
|
||||
private static final Map<String, AddonRegistration> ADDONS = new LinkedHashMap<>();
|
||||
private static final Map<String, Boolean> ENABLED_OVERRIDES = new LinkedHashMap<>();
|
||||
|
|
@ -88,32 +84,6 @@ public enum AddonManager {
|
|||
discoverEntrypoints();
|
||||
}
|
||||
|
||||
public static void registerRuntimeLifecycle() {
|
||||
ClientRuntime.setAddonCounter(AddonManager::activeCount);
|
||||
ClientRuntime.registerParticipant(new RuntimeShutdownParticipant() {
|
||||
@Override
|
||||
public String id() {
|
||||
return "addons";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown(RuntimeShutdownContext context) {
|
||||
suspendForRuntime(context);
|
||||
}
|
||||
});
|
||||
ClientRuntime.registerResumeParticipant(new RuntimeResumeParticipant() {
|
||||
@Override
|
||||
public String id() {
|
||||
return "addons";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resume(String reason) {
|
||||
resumeAfterRuntime(reason);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static List<AddonSnapshot> snapshots() {
|
||||
init();
|
||||
return ADDONS.values().stream()
|
||||
|
|
@ -142,7 +112,7 @@ public enum AddonManager {
|
|||
out.addAll(registration.issues);
|
||||
}
|
||||
if (out.isEmpty()) {
|
||||
out.add(new AddonIssue("combatant", AddonIssue.Severity.INFO, "No addon errors found", ""));
|
||||
out.add(new AddonIssue("lovisual", AddonIssue.Severity.INFO, "No addon errors found", ""));
|
||||
}
|
||||
return List.copyOf(out);
|
||||
}
|
||||
|
|
@ -349,42 +319,6 @@ public enum AddonManager {
|
|||
return addon;
|
||||
}
|
||||
|
||||
private static void suspendForRuntime(RuntimeShutdownContext context) {
|
||||
int suspended = 0;
|
||||
for (AddonRegistration registration : ADDONS.values()) {
|
||||
if (registration.addon == null || registration.status != AddonStatus.ACTIVE) continue;
|
||||
try {
|
||||
if (context.jarReplacement()) {
|
||||
shutdownAddon(registration, context.reason());
|
||||
registration.status = AddonStatus.SHUTDOWN;
|
||||
} else {
|
||||
registration.addon.onRuntimeSuspended(
|
||||
new LoVisualAddonRuntimeContextImpl(registration.descriptor.id())
|
||||
);
|
||||
registration.status = AddonStatus.SUSPENDED;
|
||||
}
|
||||
suspended++;
|
||||
} catch (Throwable t) {
|
||||
registration.status = AddonStatus.ERROR;
|
||||
registration.issue(AddonIssue.Severity.ERROR, "Runtime suspend failed", t.toString());
|
||||
DebugLog.error("Addon runtime suspend failed: %s", t, registration.descriptor.id());
|
||||
}
|
||||
}
|
||||
context.increment("addons_suspended", suspended);
|
||||
}
|
||||
|
||||
private static void resumeAfterRuntime(String reason) {
|
||||
for (AddonRegistration registration : ADDONS.values()) {
|
||||
if (registration.addon == null || registration.status != AddonStatus.SUSPENDED || !registration.enabled) {
|
||||
continue;
|
||||
}
|
||||
resumeAddon(registration, reason);
|
||||
if (registration.status != AddonStatus.ERROR) {
|
||||
registration.status = AddonStatus.ACTIVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void suspendAddon(AddonRegistration registration, String reason) {
|
||||
if (registration.addon == null) return;
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue