Avoid exposing mods to exceptions when baking models
This commit is contained in:
parent
c51d7ae641
commit
962b843199
|
|
@ -13,6 +13,7 @@ import net.minecraft.core.Direction;
|
|||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
import org.embeddedt.modernfix.ModernFix;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
|
@ -106,7 +107,12 @@ public class DynamicBakedModelProvider implements Map<ResourceLocation, BakedMod
|
|||
if(model != SENTINEL)
|
||||
return model;
|
||||
else {
|
||||
model = bakery.bake((ResourceLocation)o, BlockModelRotation.X0_Y0);
|
||||
try {
|
||||
model = bakery.bake((ResourceLocation)o, BlockModelRotation.X0_Y0);
|
||||
} catch(RuntimeException e) {
|
||||
ModernFix.LOGGER.error("Exception baking {}: {}", o, e);
|
||||
model = missingModel;
|
||||
}
|
||||
if(model == missingModel) {
|
||||
// to correctly emulate the original map, we return null for missing models
|
||||
permanentOverrides.put((ResourceLocation) o, null);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user