Restructure code

This commit is contained in:
embeddedt 2026-01-03 15:29:58 -05:00
parent f14bfa56e1
commit 58b86a9852
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -177,20 +177,21 @@ public class DynamicModelSystem {
@Override
public Object load(K key) throws Exception {
var unbaked = input.get(key);
if (unbaked != null) {
if (DEBUG_DYNAMIC_MODEL_LOADING) {
ModernFix.LOGGER.info("Baking {}", key);
}
var bakerResult = baker.apply(key, unbaked);
if (bakerResult == null) {
ModernFix.LOGGER.warn("Baker has returned null for {}", key);
return NULL_BAKED;
} else {
return bakerResult;
}
} else {
if (unbaked == null) {
return NULL_BAKED;
}
if (DEBUG_DYNAMIC_MODEL_LOADING) {
ModernFix.LOGGER.info("Baking {}", key);
}
var bakerResult = baker.apply(key, unbaked);
if (bakerResult == null) {
ModernFix.LOGGER.warn("Baker has returned null for {}", key);
return NULL_BAKED;
}
return bakerResult;
}
});
return new DynamicRegistryMap<>(input.keySet(), k -> {