42 lines
1.1 KiB
Markdown
42 lines
1.1 KiB
Markdown
# MercanRey3.js — findAffected() (satır 130)
|
||
|
||
[← MercanRey3.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
```javascript
|
||
function findAffected(world, state)
|
||
{
|
||
var entities = world.getEntities(state.x - RADIUS, state.y - RADIUS, state.z - RADIUS, state.x + RADIUS, state.y + RADIUS, state.z + RADIUS);
|
||
var affected = {};
|
||
|
||
for (var i = 0; i < entities.size(); i++)
|
||
{
|
||
var entity = entities.get(i);
|
||
|
||
if (entity == null || !entity.isLivingBase() || String(entity.getUniqueId()) === String(state.caster))
|
||
{
|
||
continue;
|
||
}
|
||
|
||
if (entity.getDimension() !== Number(state.dimension))
|
||
{
|
||
continue;
|
||
}
|
||
|
||
var pos = entity.getPosition();
|
||
|
||
if (distanceSqPos(pos, state.x, state.y, state.z) <= RADIUS * RADIUS)
|
||
{
|
||
affected[String(entity.getUniqueId())] = true;
|
||
slowInside(entity);
|
||
|
||
if (entity.isPlayer())
|
||
{
|
||
entity.sendActionBar("Insignia de Caballero: reflekslerin agirlasiyor.");
|
||
}
|
||
}
|
||
}
|
||
|
||
return affected;
|
||
}
|
||
```
|