Class ChunkScanTask
java.lang.Object
net.chen.legacyLand.resource.pricing.ChunkScanTask
- All Implemented Interfaces:
Runnable
区块储量扫描任务(P1)。
关键优化 —— Palette Early-Exit:
Minecraft 区块按 16 高一段(section)使用 palette 存储方块;当 section 仅含 AIR 时
ChunkSnapshot.isSectionEmpty(int) 返回 true,可直接跳过整段 4096 个方块。
对于地表以上的几何空气段(大部分 overworld 区块的 6~10 段),该剪枝可减少 60% 以上的循环。
Section 索引计算:sy = (y - worldMinY) >> 4。worldMinY 必须在调度方主线程获取后传入, ChunkSnapshot 自身不暴露此值。
-
Constructor Summary
ConstructorsConstructorDescriptionChunkScanTask(org.bukkit.ChunkSnapshot snapshot, String worldName, int worldMinY, int worldMaxY, ResourcePricingConfig config) -
Method Summary
-
Constructor Details
-
ChunkScanTask
public ChunkScanTask(org.bukkit.ChunkSnapshot snapshot, String worldName, int worldMinY, int worldMaxY, ResourcePricingConfig config)
-
-
Method Details
-
run
-