Files

36 lines
942 B
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 — protectDomainBatch() (satır 2417)
[← Darklord.js](index.md) · [← Master](../../wiki.md)
```javascript
function protectDomainBatch(world, domain, tick)
{
var plan = domain.plan || [];
if (plan.length === 0) return false;
var changed = 0;
for (var i = 0; i < DOMAIN_PROTECT_BATCH; i++)
{
var idx = Number(domain.protectIndex || 0);
if (idx >= plan.length) idx = 0;
domain.protectIndex = idx + 1;
var item = plan[idx];
if (!item) continue;
if (item.kind === "air")
{
if (domainApplyAir(world, domain, item, false)) changed++;
}
else if (!isDomainBlock(world, item))
{
domainApplyBlock(world, domain, item, false);
if ((changed & 7) === 0) spawnDomainBuildFx(world, item);
changed++;
}
}
return changed > 0;
}
```