Files

41 lines
1.2 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.
# Grim.js — skinLoop() (satır 374)
[← Grim.js](index.md) · [← Master](../../wiki.md)
```javascript
function skinLoop(c) {
var runId = Number(c.getValue("skin_run_id"));
var s = loadState();
if (!s.active || Number(s.runId) !== runId || Number(mappet.get(RUN_KEY)) !== runId) return;
var viewer = findPlayer(c, OWNER);
if (viewer) {
var any = false;
for (var uuid in s.overrides) {
var o = s.overrides[uuid];
if (!o || !o.enabled) continue;
any = true;
var target = c.getServer().getEntity(String(uuid));
if (!target || !target.isPlayer()) continue;
if (target.getDimension() !== viewer.getDimension()) continue;
if (s.hidden[uuid]) {
restoreTarget(viewer, target);
delete s.hidden[uuid];
}
var morph = buildSkinMorph(target, o.url);
if (morph) sendMorphToViewer(viewer, target, morph);
}
if (!any) {
s.active = false;
}
}
saveState(s);
if (s.active) c.scheduleScript("skinLoop", LOOP_INTERVAL);
}
```