Fixed hash bug for ChunkPos & incorrect shink causing overdraw issue
This commit is contained in:
@@ -375,17 +375,10 @@ public class LodUtil
|
||||
// if the skipRadius is being used
|
||||
if (skipRadius != 0)
|
||||
{
|
||||
for (int x = centerChunk.getX() - chunkRenderDist; x < centerChunk.getX() + chunkRenderDist; x++)
|
||||
{
|
||||
for (int z = centerChunk.getZ() - chunkRenderDist; z < centerChunk.getZ() + chunkRenderDist; z++)
|
||||
{
|
||||
if (x <= centerChunk.getX() - skipRadius || x >= centerChunk.getX() + skipRadius
|
||||
|| z <= centerChunk.getZ() - skipRadius || z >= centerChunk.getZ() + skipRadius)
|
||||
{
|
||||
posToSkip.remove(FACTORY.createChunkPos(x, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
posToSkip.removeIf((pos) -> {
|
||||
return (pos.getX() < centerChunk.getX() - skipRadius || pos.getX() > centerChunk.getX() + skipRadius
|
||||
|| pos.getZ() < centerChunk.getZ() - skipRadius || pos.getZ() > centerChunk.getZ() + skipRadius);
|
||||
});
|
||||
}
|
||||
return posToSkip;
|
||||
}
|
||||
|
||||
+11
@@ -50,4 +50,15 @@ public abstract class AbstractChunkPosWrapper
|
||||
|
||||
public abstract AbstractBlockPosWrapper getWorldPosition();
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Long.hashCode(getLong());
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) return true;
|
||||
if (!(obj instanceof AbstractChunkPosWrapper)) return false;
|
||||
return getLong() == ((AbstractChunkPosWrapper)obj).getLong();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user