1.8 KiB
1.8 KiB
ezoickalkan.js — karadelik() (satır 151)
}
}
function restoreBatch(ctx, startIdx) {
var end = Math.min(startIdx + 200, savedBlocks.length);
var ptP = mappet.getParticleType("portal");
for (var ri = startIdx; ri < end; ri++) {
var rb = savedBlocks[ri];
try {
if (w.getBlock(rb.x, rb.y, rb.z).getBlockId() === "minecraft:air") {
w.setBlock(rb.s, rb.x, rb.y, rb.z);
if (ptP && (ri % 3 === 0)) w.spawnParticles(ptP, true, rb.x+0.5, rb.y+0.5, rb.z+0.5, 1, 0.2, 0.2, 0.2, 0.01);
}
} catch (e) {}
}
if (end < savedBlocks.length) {
ctx.scheduleScript(2, function(c3) { restoreBatch(c3, end); });
} else {
w.playSound("minecraft:block.beacon.activate", hitX, hitY, hitZ, 2.0, 1.4);
}
}
function bhLoop(ctx) {
if (t >= totalTicks) {
w.playSound("minecraft:entity.generic.explode", hitX, hitY, hitZ, 3.0, 0.5);
var ptHuge = mappet.getParticleType("hugeexplosion");
if (ptHuge) w.spawnParticles(ptHuge, true, hitX, hitY, hitZ, 3, 1.0, 1.0, 1.0, 0.1);
restoreBatch(ctx, 0);
return;
}
// 2 Blokluk Küresel Kara Delik Görünümü (happyVillager)
var ptHappy = mappet.getParticleType("happyVillager");
var bhRadius = 2.0;
if (ptHappy) {
for (var i = 0; i < 40; i++) {
var u = Math.random();
var v = Math.random();
var theta = 2 * Math.PI * u;
var phi = Math.acos(2 * v - 1);