| 1 | /*
|
| 2 | * This file is part of the Combatant Client distribution.
|
| 3 | * Copyright (c) 2026 pivosos2007.
|
| 4 | *
|
| 5 | * Licensed under the GNU General Public License v3.0.
|
| 6 | */
|
| 7 |
|
| 8 | package combatant.client.util.resources.asset;
|
| 9 |
|
| 10 | import combatant.client.render.engine.text.FontInfo;
|
| 11 | import combatant.client.runtime.discovery.CombatantIndex;
|
| 12 | import combatant.client.util.logging.DebugLog;
|
| 13 | import net.minecraft.resources.Identifier;
|
| 14 | import net.minecraft.server.packs.resources.ResourceManager;
|
| 15 |
|
| 16 | import java.lang.reflect.Field;
|
| 17 | import java.lang.reflect.Method;
|
| 18 | import java.lang.reflect.Modifier;
|
| 19 | import java.util.ArrayList;
|
| 20 | import java.util.Arrays;
|
| 21 | import java.util.Comparator;
|
| 22 | import java.util.EnumSet;
|
| 23 | import java.util.LinkedHashMap;
|
| 24 | import java.util.LinkedHashSet;
|
| 25 | import java.util.List;
|
| 26 | import java.util.Locale;
|
| 27 | import java.util.Map;
|
| 28 | import java.util.Set;
|
| 29 |
|
| 30 | /**
|
| 31 | * Central generated-index discovery for render/resource assets.
|
| 32 | *
|
| 33 | * <p>Discovery reads only classes carrying Combatant asset annotations. Resource-backed
|
| 34 | * subsystems, including player animation scripts, declare their assets through metadata here.</p>
|
| 35 | */
|
| 36 | public enum AssetAutoLoader {
|
| 37 | ;
|
| 38 |
|
| 39 | private static final String DEFAULT_SCOPE = "combatant.client";
|
| 40 |
|
| 41 | private static final List<Hook> HOOKS = new ArrayList<>();
|
| 42 | private static final List<Class<?>> TEXTURE_CATALOGS = new ArrayList<>();
|
| 43 | private static final List<FontDefinition> FONT_ASSETS = new ArrayList<>();
|
| 44 | private static final Map<String, ScriptDefinition> SCRIPT_ASSETS = new LinkedHashMap<>();
|
| 45 | private static final Map<String, Identifier> RESOURCE_ASSETS = new LinkedHashMap<>();
|
| 46 | private static final Set<String> UI_SCRIPT_IDS = new LinkedHashSet<>();
|
| 47 | private static final Set<String> ACTIVE_SCOPES = new LinkedHashSet<>();
|
| 48 | private static boolean discovered;
|
| 49 |
|
| 50 | public static synchronized void discover() {
|
| 51 | if (discovered) return;
|
| 52 |
|
| 53 | try {
|
| 54 | discoverHooks(CombatantIndex.classNames(CombatantIndex.Kind.ASSET_HOOK, DEFAULT_SCOPE));
|
| 55 | discoverTextureCatalogs(CombatantIndex.classNames(CombatantIndex.Kind.TEXTURE_CATALOG, DEFAULT_SCOPE));
|
| 56 | discoverFontCatalogs(CombatantIndex.classNames(CombatantIndex.Kind.FONT_CATALOG, DEFAULT_SCOPE));
|
| 57 | discoverScriptCatalogs(CombatantIndex.classNames(CombatantIndex.Kind.SCRIPT_CATALOG, DEFAULT_SCOPE));
|
| 58 | discoverResourceCatalogs(CombatantIndex.classNames(CombatantIndex.Kind.RESOURCE_CATALOG, DEFAULT_SCOPE));
|
| 59 | discoverUiScripts(CombatantIndex.classNames(CombatantIndex.Kind.UI_SCRIPT, DEFAULT_SCOPE));
|
| 60 | sortDiscoveredAssets();
|
| 61 | discovered = true;
|
| 62 | DebugLog.info("[Combatant][Assets] discovered hooks=%d textureCatalogs=%d fonts=%d scripts=%d resources=%d uiScripts=%d",
|
| 63 | HOOKS.size(), TEXTURE_CATALOGS.size(), FONT_ASSETS.size(), SCRIPT_ASSETS.size(), RESOURCE_ASSETS.size(), UI_SCRIPT_IDS.size());
|
| 64 | } catch (Throwable error) {
|
| 65 | clearDiscovery();
|
| 66 | throw new IllegalStateException("Combatant asset discovery failed", error);
|
| 67 | }
|
| 68 | }
|
| 69 |
|
| 70 | public static void initialize(ResourceManager manager) {
|
| 71 | run(AssetLoadPhase.INITIALIZE, manager);
|
| 72 | }
|
| 73 |
|
| 74 | public static void reload(ResourceManager manager) {
|
| 75 | run(AssetLoadPhase.RELOAD, manager);
|
| 76 | }
|
| 77 |
|
| 78 | public static void postReload(ResourceManager manager) {
|
| 79 | run(AssetLoadPhase.POST_RELOAD, manager);
|
| 80 | }
|
| 81 |
|
| 82 | /**
|
| 83 | * Activates a named runtime asset scope. Activation hooks are strict: a failed hook rolls the
|
| 84 | * scope back. If rollback itself fails, the scope remains published so ownership
|
| 85 | * can be recovered instead of being disguised as inactive.
|
| 86 | */
|
| 87 | public static synchronized boolean activate(String scope, ResourceManager manager) {
|
| 88 | String normalized = normalizeScope(scope);
|
| 89 | discover();
|
| 90 | if (ACTIVE_SCOPES.contains(normalized)) return false;
|
| 91 | ACTIVE_SCOPES.add(normalized);
|
| 92 | try {
|
| 93 | runScopedStrict(AssetLoadPhase.ACTIVATE, normalized, manager);
|
| 94 | return true;
|
| 95 | } catch (RuntimeException | Error error) {
|
| 96 | // Roll back already-created resources from earlier hooks in the same scope. Keep the
|
| 97 | // scope published if teardown itself fails: ownership may still be live and the caller
|
| 98 | // must be able to retry authoritative cleanup instead of observing a false inactive state.
|
| 99 | boolean rollbackComplete = false;
|
| 100 | try {
|
| 101 | runScopedStrict(AssetLoadPhase.DEACTIVATE, normalized, manager);
|
| 102 | rollbackComplete = true;
|
| 103 | } catch (RuntimeException | Error teardownError) {
|
| 104 | error.addSuppressed(teardownError);
|
| 105 | } finally {
|
| 106 | if (rollbackComplete) ACTIVE_SCOPES.remove(normalized);
|
| 107 | }
|
| 108 | throw error;
|
| 109 | }
|
| 110 | }
|
| 111 |
|
| 112 | /**
|
| 113 | * Deactivates a runtime scope after its teardown hooks completed. A teardown failure keeps the
|
| 114 | * scope active because GPU/resource ownership may still be live.
|
| 115 | */
|
| 116 | public static synchronized boolean deactivate(String scope, ResourceManager manager) {
|
| 117 | String normalized = normalizeScope(scope);
|
| 118 | discover();
|
| 119 | if (!ACTIVE_SCOPES.contains(normalized)) return false;
|
| 120 | runScopedStrict(AssetLoadPhase.DEACTIVATE, normalized, manager);
|
| 121 | ACTIVE_SCOPES.remove(normalized);
|
| 122 | return true;
|
| 123 | }
|
| 124 |
|
| 125 | public static synchronized boolean isScopeActive(String scope) {
|
| 126 | if (scope == null || scope.isBlank()) return false;
|
| 127 | return ACTIVE_SCOPES.contains(normalizeScope(scope));
|
| 128 | }
|
| 129 |
|
| 130 | public static List<FontDefinition> fontAssets() {
|
| 131 | discover();
|
| 132 | return List.copyOf(FONT_ASSETS);
|
| 133 | }
|
| 134 |
|
| 135 | public static Set<String> uiScriptIds() {
|
| 136 | discover();
|
| 137 | return Set.copyOf(UI_SCRIPT_IDS);
|
| 138 | }
|
| 139 |
|
| 140 | public static ScriptDefinition scriptAsset(Enum<?> key) {
|
| 141 | if (key == null) throw new IllegalArgumentException("Script asset key cannot be null");
|
| 142 | discover();
|
| 143 | ScriptDefinition definition = SCRIPT_ASSETS.get(catalogKey(key.getDeclaringClass(), key.name()));
|
| 144 | if (definition == null) {
|
| 145 | throw new IllegalArgumentException("No @ScriptAsset metadata for "
|
| 146 | + key.getDeclaringClass().getName() + "." + key.name());
|
| 147 | }
|
| 148 | return definition;
|
| 149 | }
|
| 150 |
|
| 151 | public static List<ScriptDefinition> scriptAssets(Class<? extends Enum<?>> catalogType) {
|
| 152 | if (catalogType == null) throw new IllegalArgumentException("Script catalog type cannot be null");
|
| 153 | if (!catalogType.isEnum()) throw new IllegalArgumentException("Script catalog type must be an enum: " + catalogType.getName());
|
| 154 | discover();
|
| 155 | Object[] constants = catalogType.getEnumConstants();
|
| 156 | if (constants == null || constants.length == 0) return List.of();
|
| 157 | ArrayList<ScriptDefinition> definitions = new ArrayList<>(constants.length);
|
| 158 | for (Object constant : constants) {
|
| 159 | definitions.add(scriptAsset((Enum<?>) constant));
|
| 160 | }
|
| 161 | definitions.sort(Comparator
|
| 162 | .comparingInt(ScriptDefinition::order)
|
| 163 | .thenComparing(definition -> definition.resource().toString()));
|
| 164 | return List.copyOf(definitions);
|
| 165 | }
|
| 166 |
|
| 167 | public static Identifier resourceAsset(Enum<?> key) {
|
| 168 | if (key == null) throw new IllegalArgumentException("Resource asset key cannot be null");
|
| 169 | discover();
|
| 170 | Identifier resource = RESOURCE_ASSETS.get(catalogKey(key.getDeclaringClass(), key.name()));
|
| 171 | if (resource == null) {
|
| 172 | throw new IllegalArgumentException("No @ResourceAsset metadata for "
|
| 173 | + key.getDeclaringClass().getName() + "." + key.name());
|
| 174 | }
|
| 175 | return resource;
|
| 176 | }
|
| 177 |
|
| 178 | public static String classpathResource(Enum<?> key) {
|
| 179 | Identifier id = resourceAsset(key);
|
| 180 | return "assets/" + id.getNamespace() + "/" + id.getPath();
|
| 181 | }
|
| 182 |
|
| 183 | public static int preloadTextures(net.minecraft.client.renderer.texture.TextureManager textureManager) {
|
| 184 | discover();
|
| 185 | if (textureManager == null) return 0;
|
| 186 |
|
| 187 | LinkedHashSet<Identifier> ids = new LinkedHashSet<>();
|
| 188 | for (Class<?> type : TEXTURE_CATALOGS) {
|
| 189 | for (Field field : type.getDeclaredFields()) {
|
| 190 | if (!Modifier.isStatic(field.getModifiers())) continue;
|
| 191 | try {
|
| 192 | field.setAccessible(true);
|
| 193 | collectIdentifiers(field.get(null), ids);
|
| 194 | } catch (Throwable error) {
|
| 195 | DebugLog.error("[Combatant][Assets] Failed to read texture catalog field %s.%s",
|
| 196 | error, type.getName(), field.getName());
|
| 197 | }
|
| 198 | }
|
| 199 | }
|
| 200 |
|
| 201 | int loaded = 0;
|
| 202 | for (Identifier id : ids) {
|
| 203 | try {
|
| 204 | textureManager.getTexture(id);
|
| 205 | loaded++;
|
| 206 | } catch (Throwable error) {
|
| 207 | DebugLog.error("[Combatant][Assets] Failed to preload texture %s", error, id);
|
| 208 | }
|
| 209 | }
|
| 210 | return loaded;
|
| 211 | }
|
| 212 |
|
| 213 | private static synchronized void run(AssetLoadPhase phase, ResourceManager manager) {
|
| 214 | discover();
|
| 215 | for (Hook hook : HOOKS) {
|
| 216 | if (!hook.phases.contains(phase)) continue;
|
| 217 | if (!hook.scope.isEmpty() && !ACTIVE_SCOPES.contains(hook.scope)) continue;
|
| 218 | try {
|
| 219 | invokeHook(hook, manager);
|
| 220 | } catch (Throwable error) {
|
| 221 | Throwable cause = error.getCause() != null ? error.getCause() : error;
|
| 222 | DebugLog.error("[Combatant][Assets] %s hook failed: %s#%s",
|
| 223 | cause, phase.name().toLowerCase(Locale.ROOT), hook.method.getDeclaringClass().getName(), hook.method.getName());
|
| 224 | }
|
| 225 | }
|
| 226 | }
|
| 227 |
|
| 228 | private static void runScopedStrict(AssetLoadPhase phase, String scope, ResourceManager manager) {
|
| 229 | for (Hook hook : HOOKS) {
|
| 230 | if (!hook.phases.contains(phase) || !scope.equals(hook.scope)) continue;
|
| 231 | try {
|
| 232 | invokeHook(hook, manager);
|
| 233 | } catch (Throwable error) {
|
| 234 | Throwable cause = error.getCause() != null ? error.getCause() : error;
|
| 235 | throw new IllegalStateException("Runtime asset hook failed: " + scope + " "
|
| 236 | + phase.name().toLowerCase(Locale.ROOT) + " "
|
| 237 | + hook.method.getDeclaringClass().getName() + "#" + hook.method.getName(), cause);
|
| 238 | }
|
| 239 | }
|
| 240 | }
|
| 241 |
|
| 242 | private static void invokeHook(Hook hook, ResourceManager manager) throws ReflectiveOperationException {
|
| 243 | if (hook.acceptsManager) {
|
| 244 | hook.method.invoke(null, manager);
|
| 245 | } else {
|
| 246 | hook.method.invoke(null);
|
| 247 | }
|
| 248 | }
|
| 249 |
|
| 250 | private static void discoverHooks(List<String> classNames) throws ReflectiveOperationException {
|
| 251 | for (String className : classNames) {
|
| 252 | Class<?> type = Class.forName(className, false, AssetAutoLoader.class.getClassLoader());
|
| 253 | for (Method method : type.getDeclaredMethods()) {
|
| 254 | AssetLoad annotation = method.getAnnotation(AssetLoad.class);
|
| 255 | if (annotation == null) continue;
|
| 256 | validateHook(method);
|
| 257 | method.setAccessible(true);
|
| 258 | HOOKS.add(new Hook(method,
|
| 259 | EnumSet.copyOf(Arrays.asList(annotation.value())),
|
| 260 | annotation.order(),
|
| 261 | normalizeOptionalScope(annotation.scope()),
|
| 262 | method.getParameterCount() == 1));
|
| 263 | }
|
| 264 | }
|
| 265 | }
|
| 266 |
|
| 267 | private static void discoverTextureCatalogs(List<String> classNames) throws ClassNotFoundException {
|
| 268 | for (String className : classNames) {
|
| 269 | TEXTURE_CATALOGS.add(Class.forName(className, false, AssetAutoLoader.class.getClassLoader()));
|
| 270 | }
|
| 271 | }
|
| 272 |
|
| 273 | private static void discoverFontCatalogs(List<String> classNames) throws ReflectiveOperationException {
|
| 274 | for (String className : classNames) {
|
| 275 | Class<?> type = Class.forName(className, false, AssetAutoLoader.class.getClassLoader());
|
| 276 | if (!type.isEnum()) {
|
| 277 | throw new IllegalArgumentException("@FontCatalog type must be an enum: " + type.getName());
|
| 278 | }
|
| 279 | FontCatalog catalog = type.getAnnotation(FontCatalog.class);
|
| 280 | Object[] constants = type.getEnumConstants();
|
| 281 | if (constants == null) continue;
|
| 282 | for (Object constant : constants) {
|
| 283 | String name = ((Enum<?>) constant).name();
|
| 284 | Field field = type.getField(name);
|
| 285 | FontAsset asset = field.getAnnotation(FontAsset.class);
|
| 286 | if (asset == null) {
|
| 287 | throw new IllegalArgumentException(type.getName() + "." + name + " must be annotated with @FontAsset");
|
| 288 | }
|
| 289 | Identifier resource = Identifier.fromNamespaceAndPath(
|
| 290 | catalog.namespace(),
|
| 291 | join(catalog.root(), asset.value())
|
| 292 | );
|
| 293 | FONT_ASSETS.add(new FontDefinition(
|
| 294 | new FontInfo(asset.family(), asset.type()),
|
| 295 | resource,
|
| 296 | asset.atlasOnly(),
|
| 297 | asset.primary(),
|
| 298 | asset.prewarm(),
|
| 299 | asset.order()
|
| 300 | ));
|
| 301 | }
|
| 302 | }
|
| 303 | }
|
| 304 |
|
| 305 | private static void discoverScriptCatalogs(List<String> classNames) throws ReflectiveOperationException {
|
| 306 | for (String className : classNames) {
|
| 307 | Class<?> type = Class.forName(className, false, AssetAutoLoader.class.getClassLoader());
|
| 308 | if (!type.isEnum()) {
|
| 309 | throw new IllegalArgumentException("@ScriptCatalog type must be an enum: " + type.getName());
|
| 310 | }
|
| 311 | ScriptCatalog catalog = type.getAnnotation(ScriptCatalog.class);
|
| 312 | Object[] constants = type.getEnumConstants();
|
| 313 | if (constants == null) continue;
|
| 314 | for (Object constant : constants) {
|
| 315 | String name = ((Enum<?>) constant).name();
|
| 316 | Field field = type.getField(name);
|
| 317 | ScriptAsset asset = field.getAnnotation(ScriptAsset.class);
|
| 318 | if (asset == null) {
|
| 319 | throw new IllegalArgumentException(type.getName() + "." + name + " must be annotated with @ScriptAsset");
|
| 320 | }
|
| 321 | Identifier resource = Identifier.fromNamespaceAndPath(
|
| 322 | catalog.namespace(),
|
| 323 | join(catalog.root(), asset.value())
|
| 324 | );
|
| 325 | Identifier addon = asset.addon().isBlank()
|
| 326 | ? null
|
| 327 | : Identifier.fromNamespaceAndPath(catalog.namespace(), join(catalog.root(), asset.addon()));
|
| 328 | String key = catalogKey(type, name);
|
| 329 | ScriptDefinition duplicate = SCRIPT_ASSETS.putIfAbsent(key,
|
| 330 | new ScriptDefinition(resource, addon, asset.tree(), asset.order()));
|
| 331 | if (duplicate != null) {
|
| 332 | throw new IllegalStateException("Duplicate script asset key: " + key);
|
| 333 | }
|
| 334 | }
|
| 335 | }
|
| 336 | }
|
| 337 |
|
| 338 | private static void discoverResourceCatalogs(List<String> classNames) throws ReflectiveOperationException {
|
| 339 | for (String className : classNames) {
|
| 340 | Class<?> type = Class.forName(className, false, AssetAutoLoader.class.getClassLoader());
|
| 341 | if (!type.isEnum()) {
|
| 342 | throw new IllegalArgumentException("@ResourceCatalog type must be an enum: " + type.getName());
|
| 343 | }
|
| 344 | ResourceCatalog catalog = type.getAnnotation(ResourceCatalog.class);
|
| 345 | Object[] constants = type.getEnumConstants();
|
| 346 | if (constants == null) continue;
|
| 347 | for (Object constant : constants) {
|
| 348 | String name = ((Enum<?>) constant).name();
|
| 349 | Field field = type.getField(name);
|
| 350 | ResourceAsset asset = field.getAnnotation(ResourceAsset.class);
|
| 351 | if (asset == null) {
|
| 352 | throw new IllegalArgumentException(type.getName() + "." + name + " must be annotated with @ResourceAsset");
|
| 353 | }
|
| 354 | Identifier resource = Identifier.fromNamespaceAndPath(
|
| 355 | catalog.namespace(),
|
| 356 | join(catalog.root(), asset.value())
|
| 357 | );
|
| 358 | String key = catalogKey(type, name);
|
| 359 | Identifier duplicate = RESOURCE_ASSETS.putIfAbsent(key, resource);
|
| 360 | if (duplicate != null) {
|
| 361 | throw new IllegalStateException("Duplicate resource asset key: " + key);
|
| 362 | }
|
| 363 | }
|
| 364 | }
|
| 365 | }
|
| 366 |
|
| 367 | private static void discoverUiScripts(List<String> classNames) throws ClassNotFoundException {
|
| 368 | for (String className : classNames) {
|
| 369 | Class<?> type = Class.forName(className, false, AssetAutoLoader.class.getClassLoader());
|
| 370 | UiScriptAsset asset = type.getAnnotation(UiScriptAsset.class);
|
| 371 | if (asset == null || asset.value().isBlank()) continue;
|
| 372 | if (!UI_SCRIPT_IDS.add(asset.value())) {
|
| 373 | throw new IllegalStateException("Duplicate @UiScriptAsset id: " + asset.value());
|
| 374 | }
|
| 375 | }
|
| 376 | }
|
| 377 |
|
| 378 | private static void validateHook(Method method) {
|
| 379 | if (!Modifier.isStatic(method.getModifiers())) {
|
| 380 | throw new IllegalArgumentException("@AssetLoad method must be static: " + method);
|
| 381 | }
|
| 382 | if (method.getReturnType() != void.class) {
|
| 383 | throw new IllegalArgumentException("@AssetLoad method must return void: " + method);
|
| 384 | }
|
| 385 | if (method.getParameterCount() > 1
|
| 386 | || (method.getParameterCount() == 1 && method.getParameterTypes()[0] != ResourceManager.class)) {
|
| 387 | throw new IllegalArgumentException("@AssetLoad method must accept no args or ResourceManager: " + method);
|
| 388 | }
|
| 389 | }
|
| 390 |
|
| 391 | private static void sortDiscoveredAssets() {
|
| 392 | HOOKS.sort(Comparator
|
| 393 | .comparingInt((Hook hook) -> hook.order)
|
| 394 | .thenComparing(hook -> hook.method.getDeclaringClass().getName())
|
| 395 | .thenComparing(hook -> hook.method.getName()));
|
| 396 | TEXTURE_CATALOGS.sort(Comparator.comparing(Class::getName));
|
| 397 | FONT_ASSETS.sort(Comparator
|
| 398 | .comparingInt(FontDefinition::order)
|
| 399 | .thenComparing(def -> def.info().family())
|
| 400 | .thenComparing(def -> def.info().type().ordinal()));
|
| 401 | }
|
| 402 |
|
| 403 | private static void collectIdentifiers(Object value, Set<Identifier> out) {
|
| 404 | if (value == null) return;
|
| 405 | if (value instanceof Identifier id) {
|
| 406 | out.add(id);
|
| 407 | return;
|
| 408 | }
|
| 409 | if (value instanceof Identifier[] ids) {
|
| 410 | out.addAll(Arrays.asList(ids));
|
| 411 | return;
|
| 412 | }
|
| 413 | if (value instanceof Iterable<?> iterable) {
|
| 414 | for (Object element : iterable) {
|
| 415 | if (element instanceof Identifier id) out.add(id);
|
| 416 | }
|
| 417 | }
|
| 418 | }
|
| 419 |
|
| 420 | private static String catalogKey(Class<?> type, String constant) {
|
| 421 | return type.getName() + "#" + constant;
|
| 422 | }
|
| 423 |
|
| 424 | private static String join(String left, String right) {
|
| 425 | String a = left == null ? "" : left.replace('\\', '/').replaceAll("^/+|/+$", "");
|
| 426 | String b = right == null ? "" : right.replace('\\', '/').replaceAll("^/+|/+$", "");
|
| 427 | return a.isEmpty() ? b : b.isEmpty() ? a : a + "/" + b;
|
| 428 | }
|
| 429 |
|
| 430 | private static void clearDiscovery() {
|
| 431 | HOOKS.clear();
|
| 432 | TEXTURE_CATALOGS.clear();
|
| 433 | FONT_ASSETS.clear();
|
| 434 | SCRIPT_ASSETS.clear();
|
| 435 | RESOURCE_ASSETS.clear();
|
| 436 | UI_SCRIPT_IDS.clear();
|
| 437 | ACTIVE_SCOPES.clear();
|
| 438 | discovered = false;
|
| 439 | }
|
| 440 |
|
| 441 | private static String normalizeScope(String scope) {
|
| 442 | String normalized = normalizeOptionalScope(scope);
|
| 443 | if (normalized.isEmpty()) throw new IllegalArgumentException("Runtime asset scope must not be blank");
|
| 444 | return normalized;
|
| 445 | }
|
| 446 |
|
| 447 | private static String normalizeOptionalScope(String scope) {
|
| 448 | return scope == null ? "" : scope.trim().toLowerCase(Locale.ROOT);
|
| 449 | }
|
| 450 |
|
| 451 | private record Hook(Method method,
|
| 452 | EnumSet<AssetLoadPhase> phases,
|
| 453 | int order,
|
| 454 | String scope,
|
| 455 | boolean acceptsManager) {
|
| 456 | }
|
| 457 |
|
| 458 | public record FontDefinition(FontInfo info, Identifier resource, boolean atlasOnly, boolean primary, boolean prewarm, int order) {
|
| 459 | }
|
| 460 |
|
| 461 | public record ScriptDefinition(Identifier resource, Identifier addonResource, boolean tree, int order) {
|
| 462 | }
|
| 463 | }
|
| 464 |
|