Guard against all possible nulls to be on the safe side, fixes #517
This commit is contained in:
@@ -119,7 +119,9 @@ public class BakedModelGenerateOverrides implements IBakedModel {
|
||||
|
||||
IBakedModel original = event.getModelRegistry().getObject(location);
|
||||
|
||||
if(original != null){
|
||||
// Ignore the warnings, IntelliJ is right that these can't be null in the dev environment but certain
|
||||
// mods seem to be doing ASM hackery that makes it so they can be null
|
||||
if(original != null && original.getOverrides() != null && original.getOverrides().getOverrides() != null){
|
||||
original.getOverrides().getOverrides().stream().map(ItemOverride::getLocation)
|
||||
.filter(l -> l.getPath().contains(OVERRIDE_GENERATORS)).findFirst()
|
||||
.ifPresent(l -> event.getModelRegistry().putObject(location,
|
||||
|
||||
Reference in New Issue
Block a user