Files

44 lines
866 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.
# MercanElArosSky.js — tick() (satır 125)
[← MercanElArosSky.js](index.md) · [← Master](../../wiki.md)
```javascript
function tick(c)
{
var player = c.getSubject();
var state = mappet.get(STATE_KEY);
if (state == null || state.uuid == null)
{
return;
}
var ticks = Number(state.ticks || 0) + 1;
if (ticks < REFRESH_INTERVAL)
{
saveState(state.uuid, ticks);
return;
}
var center = c.getServer().getEntity(String(state.uuid));
try
{
if (center == null || !center.isPlayer())
{
resetAllSky(c);
mappet.set(STATE_KEY, null);
return;
}
saveState(state.uuid, 0);
applyAreaSky(c, center);
}
catch (e)
{
mappet.set(STATE_KEY, null);
}
}
```