Files

37 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.
# bariskeser_skills.js — eng_wall() (satır 2702)
[← bariskeser_skills.js](index.md) · [← Master](../../wiki.md)
```javascript
function eng_wall(c, sk) {
var p = c.getPlayer(); if (!p) return; if (guard(p, sk.k)) return;
var cf = sk.cfg, w = c.getWorld(), pos = p.getPosition(), look = p.getLook(), bx = lookBasis(look);
etitle(p, sk);
var glass = mappet.createBlockState("minecraft:stained_glass", (cf.meta != null ? cf.meta : 11));
var saved = [], W = cf.width || 2, H = cf.height || 4;
for (var wd = -W; wd <= W; wd++) {
for (var h = 0; h < H; h++) {
var bxi = Math.round(pos.x + look.x * 2 + bx.rx * wd), byi = Math.floor(pos.y) + h, bzi = Math.round(pos.z + look.z * 2 + bx.rz * wd);
try {
var cur = w.getBlock(bxi, byi, bzi), id = cur.getBlockId();
if (id === "minecraft:air" || id === "minecraft:tallgrass" || id === "minecraft:snow_layer") {
saved.push({ x: bxi, y: byi, z: bzi, s: cur });
w.setBlock(glass, bxi, byi, bzi);
showHead(w, bxi + 0.5, byi + 0.5, bzi + 0.5, 1.0, cf.dur || 200);
}
} catch (e) {}
}
}
w.playSound("minecraft:block.glass.place", pos.x, pos.y, pos.z, 2, 0.8);
c.scheduleScript(cf.dur || 200, function (cc) {
var ww = cc.getWorld();
for (var i = 0; i < saved.length; i++) {
var b = saved[i];
try { if (ww.getBlock(b.x, b.y, b.z).getBlockId() === "minecraft:stained_glass") ww.setBlock(b.s, b.x, b.y, b.z); } catch (e) {}
fx(ww, "cloud", b.x + 0.5, b.y + 0.5, b.z + 0.5, 4, 0.2, 0.2, 0.2, 0.02);
}
ww.playSound("minecraft:block.glass.break", pos.x, pos.y, pos.z, 2, 1);
});
}
```