Files
MAPPET-ULTIMATE-WIKI/scripts/Ae/transparentOwnerMorphNbt-2.md

1.9 KiB
Raw Permalink Blame History

Ae.js — transparentOwnerMorphNbt() (satır 808)

← Ae.js · ← Master

Parça 2/38 · önceki · sonraki

        state.ownerVanishGhostMorphNbt = transparentOwnerMorphNbt(owner, morphNbtText(owner));
        forceMorph = true;
    }

    if (forceMorph)
    {
        try
        {
            applyTargetMorph(owner, state.ownerVanishGhostMorphNbt);
        }
        catch (e1) {}
    }

    setOwnerInvisible(owner, false);
    try { owner.extinguish(); } catch (e2) {}

    if (sendPackets && c) applyVanishPacketsToAll(c, owner);
}

function restoreOwnerVanishMorph(owner, state)
{
    if (!owner || !state) return;

    try
    {
        if (state.ownerVanishOriginalHadMorph && state.ownerVanishOriginalMorphNbt !== "")
        {
            applyTargetMorph(owner, state.ownerVanishOriginalMorphNbt);
        }
        else
        {
            try { owner.setMorph(null); } catch (e1) {}
        }
    }
    catch (e2) {}
}

function spawnBlockBloodParticle(world, name, x, y, z, speed)
{
    try
    {
        var type = mappet.getParticleType(name);
        if (type)
        {
            world.spawnParticles(type, true, x, y, z, 1, 0.0, 0.0, 0.0, speed, BLOOD_DUST_BLOCK_STATE);
            return true;
        }
    }
    catch (e) {}

    return false;
}

function spawnBloodParticle(world, x, y, z, speed)
{
    if (spawnBlockBloodParticle(world, "blockdust", x, y, z, speed)) return;
    if (spawnBlockBloodParticle(world, "blockcrack", x, y, z, speed)) return;
    if (spawnBlockBloodParticle(world, "fallingdust", x, y, z, speed)) return;

    try
    {
        var red = mappet.getParticleType("reddust");
        if (red)
        {
            world.spawnParticles(red, true, x, y, z, 0, 1.0, 0.0, 0.0, 1.0);
        }
    }
    catch (e1) {}
}