Fix for the previous commit - transparent blocks were handled improperly.

This commit is contained in:
RainWarrior 2015-10-29 13:32:43 +03:00
parent 3d972a11a8
commit a9d5d0097d

View file

@ -169,15 +169,18 @@ public class VertexLighterFlat extends QuadGatheringTransformer
protected void updateLightmap(float[] normal, float[] lightmap, float x, float y, float z) protected void updateLightmap(float[] normal, float[] lightmap, float x, float y, float z)
{ {
float e1 = 1 - 1e-2f;
float e2 = 0.95f; float e2 = 0.95f;
BlockPos pos = blockInfo.getBlockPos(); BlockPos pos = blockInfo.getBlockPos();
if(normal[1] < -e2) pos = pos.down(); boolean full = blockInfo.getBlock().isFullCube();
if(normal[1] > e2) pos = pos.up();
if(normal[2] < -e2) pos = pos.north(); if((full || y < -e1) && normal[1] < -e2) pos = pos.down();
if(normal[2] > e2) pos = pos.south(); if((full || y > e1) && normal[1] > e2) pos = pos.up();
if(normal[0] < -e2) pos = pos.west(); if((full || z < -e1) && normal[2] < -e2) pos = pos.north();
if(normal[0] > e2) pos = pos.east(); if((full || z > e1) && normal[2] > e2) pos = pos.south();
if((full || x < -e1) && normal[0] < -e2) pos = pos.west();
if((full || x > e1) && normal[0] > e2) pos = pos.east();
int brightness = blockInfo.getBlock().getMixedBrightnessForBlock(blockInfo.getWorld(), pos); int brightness = blockInfo.getBlock().getMixedBrightnessForBlock(blockInfo.getWorld(), pos);