Merge branch '1.16.5' of gitlab.com:jeseibel/minecraft-lod-mod into 1.16.5

This commit is contained in:
James Seibel
2021-08-10 20:49:42 -05:00
3 changed files with 20 additions and 3 deletions
@@ -297,6 +297,23 @@ public class LodNodeBufferBuilder
LodConfig.CLIENT.lodTemplate.get().
template.addLodToBuffer(currentBuffer, lodDim, lod,
xOffset , yOffset, zOffset, renderer.debugging, detail);
/*
LodDetail detail = LodConfig.CLIENT.lodDetail.get();
for(int x = 0; x < detail.dataPointLengthCount; x++){
for(int z = 0; z < detail.dataPointLengthCount; z++) {
int posX = LodUtil.convertLevelPos(lod.startBlockPos.getX() + (x*detail.dataPointWidth), 0, detail.detailLevel);
int posZ = LodUtil.convertLevelPos(lod.startBlockPos.getZ() + (z*detail.dataPointWidth), 0, detail.detailLevel);
LodQuadTreeNode newLod = lodDim.getLodFromCoordinates(posX, posZ, detail.detailLevel);
System.out.print("printing ");
System.out.println(newLod);
if(newLod != null) {
LodConfig.CLIENT.lodTemplate.get().
template.addLodToBuffer(currentBuffer, lodDim, newLod,
xOffset + (x*detail.dataPointWidth), yOffset, zOffset + (z*detail.dataPointWidth), renderer.debugging);
}
}
}
*/
}
}
@@ -131,7 +131,7 @@ public class LodNodeBuilder {
* @throws IllegalArgumentException thrown if either the chunk or world is null.
*/
public List<LodQuadTreeNode> generateLodNodeFromChunk(IChunk chunk, LodBuilderConfig config) throws IllegalArgumentException {
LodDetail detail = LodDetail.HALF;
LodDetail detail = LodDetail.QUAD;
List<LodQuadTreeNode> lodNodeList = new ArrayList<>();
if (chunk == null)
throw new IllegalArgumentException("generateLodFromChunk given a null chunk");
@@ -313,9 +313,9 @@ public class LodQuadTreeNode
{
// TODO would it be better to use the average height/depth?
// get the lowest height from the all the given LodQuadTreeNodes
short height = (short) dataList.stream().mapToInt(x -> (int) x.getLodDataPoint().height).max().getAsInt();
short height = (short) dataList.stream().mapToInt(x -> (int) x.getLodDataPoint().height).min().getAsInt();
// get the highest depth
short depth = (short) dataList.stream().mapToInt(x -> (int) x.getLodDataPoint().depth).min().getAsInt();
short depth = (short) dataList.stream().mapToInt(x -> (int) x.getLodDataPoint().depth).max().getAsInt();
// get the average color
int red = dataList.stream().mapToInt(x -> x.getLodDataPoint().color.getRed()).sum() / dataList.size();