Files

42 lines
1.1 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.
# Darklord.js — closeDomain() (satır 2010)
[← Darklord.js](index.md) · [← Master](../../wiki.md)
```javascript
function closeDomain(c, p)
{
var domain = loadDomain(c);
if (!domain || !domain.active)
{
p.send(TAG + "\u00a78Aktif alan yok.");
return;
}
if (!canControlDomain(p, domain))
{
p.send(TAG + "\u00a7cBu alan uzerinde yetkin yok.");
return;
}
var runId = nowMs();
domain.closing = true;
domain.runId = runId;
if (domain.restoreIndex === undefined || domain.restoreIndex === null)
{
domain.restoreIndex = domain.saved ? domain.saved.length - 1 : -1;
}
saveDomain(c, domain);
setDomainRun(runId);
var pos = p.getPosition();
play(p.getWorld(), "minecraft:block.beacon.deactivate", pos.x, pos.y + 0.8, pos.z, 0.9, 0.62);
play(p.getWorld(), "minecraft:block.portal.trigger", pos.x, pos.y + 0.8, pos.z, 0.8, 0.48);
p.send(TAG + "\u00a78Alan kapanis restorasyonu basladi.");
c.scheduleScript(DOMAIN_LOOP_TICKS, function(ctx) {
domainLoop(ctx, runId, 1);
});
}
```