Files

52 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.
# potion_rain.js — q() (satır 160)
[← potion_rain.js](index.md) · [← Master](../../wiki.md)
Parça 9/11 · [önceki](q-8.md) · [sonraki](q-10.md)
```javascript
try { pp = server.getPlayer(name); } catch (e0) {}
if (pp) shooter = pp;
if (cfg.mode === 1 && pp) {
// "Etrafim": yagmur oyuncuyla birlikte hareket eder
var pos = pp.getPosition();
w = pp.getWorld();
cx = pos.x; cy = pos.y; cz = pos.z;
}
if (!stop) {
var n = cfg.timed ? cfg.rate : Math.min(cfg.rate, cfg.count - sent);
for (var i = 0; i < n; i++) {
var ent = null;
try { ent = dropOne(w, shooter, cx, cy, cz); } catch (e1) {}
if (!ent) failed++;
sent++;
}
}
tick++;
var more = !stop && (cfg.timed ? tick < totalTicks : sent < cfg.count);
if (more) {
ctx.scheduleScript(0, wave); // 0 = bir sonraki tick
return;
}
mappet.set(G_STOP + name, 0);
mappet.set(G_BUSY + name, now() + COOLDOWN_MS);
if (stop && pp) pp.sendActionBar("§eYagmur durduruldu §8| §7" + sent + " adet dustu");
}
wave(c); // ilk dalga hemen
try { world.playSound("minecraft:entity.splash_potion.throw", center.x, center.y, center.z, 2.0, 0.6); } catch (e2) {}
p.playStaticSound("minecraft:entity.witch.throw", 1.0, 0.8);
p.sendActionBar("§dYagmur: " + k.col + k.name + (carriesPotion(k, cfg) ? " §8+ " + pot.col + pot.name : "") +
" §8| §7" + (cfg.timed ? cfg.duration + " sn, " + cfg.rate + "/tick" : cfg.count + " adet") +
" §8| §7" + areaText(cfg));
return true;
}
function stopRain(p) {
var name = p.getName();
var busy = mappet.get(G_BUSY + name);
```