feat: old replaceable by mushrooms (#10)

Update upstream (Luminol)
This commit is contained in:
Helvetica Volubi
2025-06-18 16:50:23 +08:00
parent 16f2258eed
commit 71455cca64
49 changed files with 1442 additions and 1439 deletions
@@ -0,0 +1,42 @@
package dev.tr7zw.entityculling;
import com.logisticscraft.occlusionculling.DataProvider;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.chunk.ChunkAccess;
public class DefaultChunkDataProvider implements DataProvider {
private final Level level;
public DefaultChunkDataProvider(Level level) {
this.level = level;
}
@Override
public boolean prepareChunk(int chunkX, int chunkZ) {
return this.level.getChunkIfLoaded(chunkX, chunkZ) != null;
}
@Override
public boolean isOpaqueFullCube(int x, int y, int z) {
BlockPos pos = new BlockPos(x, y, z);
final ChunkAccess access = this.level.getChunkIfLoaded(pos);
if (access == null) {
return false;
}
if (this.level.isOutsideBuildHeight(pos)) {
return Blocks.VOID_AIR.defaultBlockState().isSolidRender();
} else {
return access.getBlockState(pos).isSolidRender();// 好孩子不要学坏叔叔这样绕过异步拦截()
}
}
@Override
public void cleanup() {
DataProvider.super.cleanup();
}
}