Fix Glas Blocks

This commit is contained in:
brausjonas
2022-05-16 09:58:00 +02:00
parent 967a194f16
commit dd3cb12698
9 changed files with 415 additions and 11 deletions
+11 -6
View File
@@ -87,14 +87,19 @@ public class Chunk
y + Data.faceChecks[f].y,
z + Data.faceChecks[f].z + chunkPosition.z * Data.chunkWidth))))
{
for (int v = 0; v < 6; v++)
if(!world.IsBlockTransparent(world.GetBlockID(new Vector3(x + chunkPosition.x * Data.chunkWidth,
y,
z + chunkPosition.z * Data.chunkWidth))))
{
vertices.Add(Data.vertices[Data.triangles[f, v]] + new Vector3(x, y, z));
triangles.Add(triangleIndex);
triangleIndex++;
for (int v = 0; v < 6; v++)
{
vertices.Add(Data.vertices[Data.triangles[f, v]] + new Vector3(x, y, z));
triangles.Add(triangleIndex);
triangleIndex++;
}
AddUV(textures[f]);
}
AddUV(textures[f]);
}
}
}