Restructure code
This commit is contained in:
parent
f14bfa56e1
commit
58b86a9852
|
|
@ -177,20 +177,21 @@ public class DynamicModelSystem {
|
||||||
@Override
|
@Override
|
||||||
public Object load(K key) throws Exception {
|
public Object load(K key) throws Exception {
|
||||||
var unbaked = input.get(key);
|
var unbaked = input.get(key);
|
||||||
if (unbaked != null) {
|
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 {
|
|
||||||
return NULL_BAKED;
|
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 -> {
|
return new DynamicRegistryMap<>(input.keySet(), k -> {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user