Fixed some nullability issues

This commit is contained in:
Anuken 2020-10-25 12:35:48 -04:00
parent 2a0af620be
commit a6307039b0
2 changed files with 4 additions and 1 deletions

View File

@ -103,6 +103,7 @@ public class Blocks implements ContentList{
alwaysReplace = true;
hasShadow = false;
useColor = false;
wall = this;
}
@Override public void drawBase(Tile tile){}

View File

@ -569,7 +569,9 @@ public class ContentParser{
if(field.field.getType().isPrimitive()) return;
if(!field.field.isAnnotationPresent(Nullable.class) && field.field.get(object) == null && !implicitNullable.contains(field.field.getType())){
throw new RuntimeException("'" + field.field.getName() + "' in " + object.getClass().getSimpleName() + " is missing!");
throw new RuntimeException("'" + field.field.getName() + "' in " +
((object.getClass().isAnonymousClass() ? object.getClass().getSuperclass() : object.getClass()).getSimpleName()) +
" is missing! Object = " + object + ", field = (" + field.field.getName() + " = " + field.field.get(object) + ")");
}
}catch(Exception e){
throw new RuntimeException(e);