Files

50 lines
1.8 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.
# pirt3.js — restoreLayerStep() (satır 470)
[← pirt3.js](index.md) · [← Master](../../wiki.md)
Parça 2/3 · [önceki](restoreLayerStep.md) · [sonraki](restoreLayerStep-3.md)
```javascript
var by = blocks[i + 1];
if (by === currentY) {
var bx = blocks[i];
var bz = blocks[i + 2];
var idIdx = blocks[i + 3];
var meta = blocks[i + 4];
var state = mappet.createBlockState(idList[idIdx], meta);
world.setBlock(state, bx, by, bz);
countThisLayer++;
}
}
if (countThisLayer > 0) {
var pHeal1 = mappet.getParticleType(SPELL_CONFIG.PARTICLE_HEAL_1);
var pHeal2 = mappet.getParticleType(SPELL_CONFIG.PARTICLE_HEAL_2);
var pHeal3 = mappet.getParticleType(SPELL_CONFIG.PARTICLE_HEAL_3);
var dy = Math.abs(currentY - cy);
var layerRadius = Math.sqrt(radius * radius - dy * dy);
if (isNaN(layerRadius) || layerRadius < 1) layerRadius = 1;
// Yeşil mending parıltıları
if (pHeal1 !== null) {
world.spawnParticles(pHeal1, false, cx, currentY, cz, 30, layerRadius * 0.8, 0.25, layerRadius * 0.8, 0.05);
}
if (pHeal2 !== null) {
world.spawnParticles(pHeal2, false, cx, currentY, cz, 25, layerRadius * 0.75, 0.2, layerRadius * 0.75, 0.08);
}
if (pHeal3 !== null) {
world.spawnParticles(pHeal3, false, cx, currentY, cz, 15, layerRadius * 0.6, 0.2, layerRadius * 0.6, 0.05);
}
// Büyüme ve yerleşme sesleri
world.playSound("minecraft:block.chorus_flower.grow", cx, currentY, cz, 1.4, 1.35);
if (Math.random() < 0.35) {
world.playSound("minecraft:block.stone.place", cx, currentY, cz, 1.1, 0.9);
}
}
currentY++;
```