Merge remote-tracking branch 'origin/1.16.5' into 1.16.5
This commit is contained in:
@@ -303,17 +303,15 @@ public class LodBufferBuilder
|
||||
boolean performFaceCulling = true;
|
||||
if (performFaceCulling
|
||||
&& posToRender.contains(detailLevel, xAdj, zAdj)
|
||||
/*&& (gameChunkRenderDistance < Math.abs(chunkXdist)
|
||||
&& (gameChunkRenderDistance < Math.abs(chunkXdist)
|
||||
|| gameChunkRenderDistance < Math.abs(chunkZdist)
|
||||
|| !vanillaRenderedChunks[chunkXdist + gameChunkRenderDistance + 1][chunkZdist + gameChunkRenderDistance + 1])*/)
|
||||
|| !vanillaRenderedChunks[chunkXdist + gameChunkRenderDistance + 1][chunkZdist + gameChunkRenderDistance + 1]))
|
||||
{
|
||||
if (!adjData.containsKey(direction) || adjData.get(direction) == null)
|
||||
adjData.put(direction, new long[maxVerticalData]);
|
||||
for (int verticalIndex = 0; verticalIndex < lodDim.getMaxVerticalData(detailLevel, xAdj, zAdj); verticalIndex++)
|
||||
{
|
||||
long data = lodDim.getData(detailLevel, xAdj, zAdj, verticalIndex);
|
||||
if(!DataPointUtil.isItVoid(data) && DataPointUtil.doesItExist(data))
|
||||
System.out.println(DataPointUtil.toString(data));
|
||||
adjData.get(direction)[verticalIndex] = data;
|
||||
}
|
||||
} else
|
||||
|
||||
@@ -11,9 +11,8 @@ import com.seibel.lod.util.DetailDistanceUtil;
|
||||
import com.seibel.lod.wrappers.MinecraftWrapper;
|
||||
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.vector.Vector3d;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import javax.xml.crypto.Data;
|
||||
|
||||
public class Box
|
||||
{
|
||||
@@ -191,9 +190,8 @@ public class Box
|
||||
}
|
||||
}
|
||||
|
||||
public void setUpCulling(int cullingDistance)
|
||||
public void setUpCulling(int cullingDistance, BlockPos playerPos)
|
||||
{
|
||||
Vector3d playerPos = MinecraftWrapper.INSTANCE.getPlayer().position();
|
||||
for (Direction direction : DIRECTIONS)
|
||||
{
|
||||
if(direction == Direction.DOWN)
|
||||
@@ -224,9 +222,9 @@ public class Box
|
||||
int maxY = getMaxY();
|
||||
for (Direction direction : ADJ_DIRECTIONS)
|
||||
{
|
||||
//if(isCulled(direction)){
|
||||
// continue;
|
||||
//}
|
||||
/*if(isCulled(direction)){
|
||||
continue;
|
||||
}*/
|
||||
|
||||
long[] dataPoint = adjData.get(direction);
|
||||
if (dataPoint == null || DataPointUtil.isItVoid(dataPoint[0]))
|
||||
@@ -262,13 +260,17 @@ public class Box
|
||||
int faceToDraw = 0;
|
||||
boolean firstFace = true;
|
||||
boolean toFinish = false;
|
||||
/*for (i = dataPoint.length - 1; i >= 0; i--)
|
||||
{
|
||||
long singleDataPoint = dataPoint[i];*/
|
||||
long singleAdjDataPoint;
|
||||
/*for (i = 0; i < dataPoint.length; i++)
|
||||
{
|
||||
singleAdjDataPoint = dataPoint[i];*/
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
singleAdjDataPoint = order[i];
|
||||
if(DataPointUtil.isItVoid(singleAdjDataPoint) || !DataPointUtil.doesItExist(singleAdjDataPoint))
|
||||
{
|
||||
break;
|
||||
}
|
||||
height = DataPointUtil.getHeight(singleAdjDataPoint);
|
||||
depth = DataPointUtil.getDepth(singleAdjDataPoint);
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public class CubicLodTemplate extends AbstractLodTemplate
|
||||
box.setColor(color);
|
||||
box.set(width, height - depth, width);
|
||||
box.move((int) (xOffset + x), (int) (depth + yOffset), (int) (zOffset + z));
|
||||
box.setUpCulling(32);
|
||||
box.setUpCulling(32, bufferCenterBlockPos);
|
||||
box.setAdjData(adjData);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user