Files

49 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# pirt.js — runProjectile() (satır 178)
[← pirt.js](index.md) · [← Master](../../wiki.md)
Parça 3/6 · [önceki](runProjectile-2.md) · [sonraki](runProjectile-4.md)
```javascript
idList.push(id);
}
blocks.push(bx);
blocks.push(by);
blocks.push(bz);
blocks.push(idIdx);
blocks.push(state.getMeta());
if (by < minY) minY = by;
if (by > maxY) maxY = by;
}
}
}
}
}
}
}
c.setValue("blocksToRestore", blocks);
c.setValue("blocksIdList", idList);
c.setValue("currentRestoreY", minY);
c.setValue("maxRestoreY", maxY);
c.setValue("hitCx", cx);
c.setValue("hitCy", cy);
c.setValue("hitCz", cz);
// 2. Krateri o bölgede temizle (Patlama oyuğu oluşturur)
for (var dx = -radius; dx <= radius; dx++) {
for (var dy = -radius; dy <= radius; dy++) {
for (var dz = -radius; dz <= radius; dz++) {
if (dx*dx + dy*dy + dz*dz <= rSq) {
var bx = cx + dx;
var by = cy + dy;
var bz = cz + dz;
if (by >= 0 && by <= 255) {
var state = world.getBlock(bx, by, bz);
if (state !== null && !state.isAir()) {
world.removeBlock(bx, by, bz);
}
```