update core + change a bit for sodium get chunk so it works better

This commit is contained in:
tom lee
2022-02-11 13:35:03 +08:00
parent c59d7a7d27
commit dc028db5ed
2 changed files with 9 additions and 11 deletions
+1 -1
Submodule core updated: f7da53622c...595b8ecbb5
@@ -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));