use of io.xol.chunkstories.api.voxel.Voxel in project chunkstories-core by Hugobros3.
the class VoxelStoneWall method getVoxelRenderer.
@Override
public VoxelModel getVoxelRenderer(CellData info) {
Voxel vox;
vox = info.getNeightborVoxel(0);
boolean connectLeft = (vox.getDefinition().isSolid() && vox.getDefinition().isOpaque()) || vox.equals(this);
vox = info.getNeightborVoxel(1);
boolean connectFront = (vox.getDefinition().isSolid() && vox.getDefinition().isOpaque()) || vox.equals(this);
vox = info.getNeightborVoxel(2);
boolean connectRight = (vox.getDefinition().isSolid() && vox.getDefinition().isOpaque()) || vox.equals(this);
vox = info.getNeightborVoxel(3);
boolean connectBack = (vox.getDefinition().isSolid() && vox.getDefinition().isOpaque()) || vox.equals(this);
String type = "default";
if (connectLeft && connectFront && connectRight && connectBack)
type = "allDir";
else if (connectLeft && connectFront && connectRight)
type = "allButBack";
else if (connectLeft && connectFront && connectBack)
type = "allButRight";
else if (connectLeft && connectBack && connectRight)
type = "allButFront";
else if (connectBack && connectFront && connectRight)
type = "allButLeft";
else if (connectLeft && connectRight)
type = "allX";
else if (connectFront && connectBack)
type = "allZ";
else if (connectLeft && connectBack)
type = "leftBack";
else if (connectRight && connectBack)
type = "rightBack";
else if (connectLeft && connectFront)
type = "leftFront";
else if (connectRight && connectFront)
type = "rightFront";
else if (connectLeft)
type = "left";
else if (connectRight)
type = "right";
else if (connectFront)
type = "front";
else if (connectBack)
type = "back";
return store.models().getVoxelModel("stone_wall" + "." + type);
}
Aggregations