rendering fix for vacuum nodes

master
Thomas Rudin 2018-08-18 10:37:05 +02:00
parent b4ab9974e6
commit 73e3f946b3
1 changed files with 15 additions and 4 deletions

View File

@ -136,16 +136,16 @@ public class MapBlockRenderer {
int graphicX = x;
int graphicY = 15 - z;
if (leftAbove.isPresent())
if (isViewBlocking(leftAbove))
rgb.addComponent(-5);
if (topAbove.isPresent())
if (isViewBlocking(topAbove))
rgb.addComponent(-5);
if (!left.isPresent())
if (!isViewBlocking(left))
rgb.addComponent(5);
if (!top.isPresent())
if (!isViewBlocking(top))
rgb.addComponent(5);
graphics.setColor(rgb.toColor());
@ -176,4 +176,15 @@ public class MapBlockRenderer {
}
}
private boolean isViewBlocking(Optional<String> optional){
if (!optional.isPresent())
return false;
if (optional.get().equals("vacuum:vacuum"))
return false;
//no vacuum, no air
return true;
}
}