Merge remote-tracking branch 'origin/1.18.X' into 1.18.X
This commit is contained in:
+8
-10
@@ -10,8 +10,6 @@ import com.seibel.lod.core.wrapperInterfaces.modAccessor.ISodiumAccessor;
|
||||
|
||||
import me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.SectionPos;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.LevelHeightAccessor;
|
||||
|
||||
public class SodiumAccessor implements ISodiumAccessor {
|
||||
@@ -27,15 +25,15 @@ public class SodiumAccessor implements ISodiumAccessor {
|
||||
SodiumWorldRenderer renderer = SodiumWorldRenderer.instance();
|
||||
LevelHeightAccessor height = Minecraft.getInstance().level;
|
||||
// 0b11 = Lighted chunk & loaded chunk
|
||||
return renderer.getChunkTracker().getChunks(0b11).filter(
|
||||
return renderer.getChunkTracker().getChunks(0b00).filter(
|
||||
(long l) -> {
|
||||
for (int i = height.getMinSection(); i<height.getMaxSection(); i++) {
|
||||
SectionPos p = SectionPos.of(new ChunkPos(l), i);
|
||||
if (renderer.isBoxVisible(p.minBlockX()+1, p.minBlockY()+1, p.minBlockZ()+1,
|
||||
p.maxBlockX()-1, p.maxBlockY()-1, p.maxBlockZ()-1)) return true;
|
||||
}
|
||||
return false;
|
||||
//return true;
|
||||
return true;
|
||||
//for (int i = height.getMinSection(); i<height.getMaxSection(); i++) {
|
||||
// SectionPos p = SectionPos.of(new ChunkPos(l), i);
|
||||
// if (renderer.isBoxVisible(p.minBlockX()+1, p.minBlockY()+1, p.minBlockZ()+1,
|
||||
// p.maxBlockX()-1, p.maxBlockY()-1, p.maxBlockZ()-1)) return true;
|
||||
//}
|
||||
//return false;
|
||||
}).mapToObj((long l) -> {
|
||||
return (AbstractChunkPosWrapper)factory.createChunkPos(l);
|
||||
}).collect(Collectors.toCollection(HashSet::new));
|
||||
|
||||
Reference in New Issue
Block a user