/* * This file is part of the LoVisual Client distribution. * Copyright (c) 2026 loki5512344. * * Licensed under the GNU General Public License v3.0. */ package dev.loki.lovisual.addon; import dev.loki.lovisual.api.v0.addon.LoVisualAddon; import net.fabricmc.loader.api.entrypoint.EntrypointContainer; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; final class AddonRegistration { final AddonDescriptor descriptor; final EntrypointContainer entrypoint; final List modules = new ArrayList<>(); final List disabledBuiltInModules = new ArrayList<>(); final List draggableHudElements = new ArrayList<>(); final List staticHudElements = new ArrayList<>(); final List commands = new ArrayList<>(); final List clickGuiSections = new ArrayList<>(); final List moduleExtensions = new ArrayList<>(); final List irisPatchManifests = new ArrayList<>(); final List renderCallbacks = new ArrayList<>(); final List postProcessPasses = new ArrayList<>(); final List issues = new ArrayList<>(); final Map suspendedModules = new LinkedHashMap<>(); final Map suspendedDraggableHudElements = new LinkedHashMap<>(); final Map suspendedStaticHudElements = new LinkedHashMap<>(); LoVisualAddon addon; boolean moduleConfigurationApplied; boolean initialized; boolean clientReadyNotified; AddonStatus status; boolean enabled; boolean restartRequired; AddonRegistration(AddonDescriptor descriptor, EntrypointContainer entrypoint, boolean enabled, AddonStatus status) { this.descriptor = descriptor; this.entrypoint = entrypoint; this.enabled = enabled; this.status = status; } AddonSnapshot snapshot() { return new AddonSnapshot( descriptor.id(), descriptor.name(), descriptor.version(), descriptor.description(), descriptor.authors(), descriptor.iconPath(), descriptor.apiVersion(), status, enabled, restartRequired, modules.size(), draggableHudElements.size(), staticHudElements.size(), commands.size(), clickGuiSections.size(), moduleExtensions.size(), irisPatchManifests.size(), List.copyOf(issues) ); } void issue(AddonIssue.Severity severity, String message, String detail) { issues.add(new AddonIssue(descriptor.id(), severity, message, detail)); } }