DON'T THROW EXCEPTIONS IN SCHEMATICS AA

This commit is contained in:
Logan Darklock 2019-09-03 21:57:20 -07:00
parent 620fc9af64
commit b51dccc737
No known key found for this signature in database
GPG Key ID: B8C37CEDE1AC60EA
2 changed files with 9 additions and 1 deletions

View File

@ -31,6 +31,6 @@ public class FillBomSchematic extends AbstractSchematic {
}
}
throw new IllegalStateException("Couldn't find desired state");
return bom.getAnyBlockState();
}
}

View File

@ -322,4 +322,12 @@ public final class BlockOptionalMeta {
//noinspection deprecation
return Block.getBlockFromItem(stack.getItem()).getStateFromMeta(stack.getMetadata());
}
public IBlockState getAnyBlockState() {
if (blockstates.size() > 0) {
return blockstates.iterator().next();
}
return null;
}
}