Files

1.8 KiB
Raw Permalink Blame History

starrr.js — main() (satır 1)

← starrr.js · ← Master

Parça 1/6 · sonraki

function main(c) {
    var player = c.getPlayer();
    if (!player) return;

    var world = c.getWorld();
    var cx = Math.floor(player.getPosition().x);
    var cy = Math.floor(player.getPosition().y);
    var cz = Math.floor(player.getPosition().z);

    function spawnFx(ctx, name, x, y, z, count, dx, dy, dz, speed) {
        var w = ctx.getWorld();
        var type = mappet.getParticleType(name);
        if (type && w) w.spawnParticles(type, true, x, y, z, count, dx, dy, dz, speed);
    }

    var radius = 30; 
    var targetBlocks = ["athenastudios:worldbuster"];
    var airState = mappet.createBlockState("minecraft:air", 0);
    var blocksAbsorbed = 0;

    // --- 1. AŞAMA: WORLD BUSTER BLOKLARINI EMME ---
    for (var x = -radius; x <= radius; x++) {
        for (var y = -radius; y <= radius; y++) {
            for (var z = -radius; z <= radius; z++) {
                if (x*x + y*y + z*z > radius*radius) continue; 
                
                var tx = cx + x; 
                var ty = cy + y; 
                var tz = cz + z;
                
                var bs = world.getBlock(tx, ty, tz);
                if (!bs) continue;
                
                if (targetBlocks.indexOf(bs.getBlockId()) !== -1) {
                    world.setBlock(airState, tx, ty, tz);
                    if (Math.random() < 0.15) {
                        world.playSound("minecraft:block.fire.extinguish", tx, ty, tz, 0.5, 1.0);
                    }
                    blocksAbsorbed++;
                }
            }
        }
    }

    // --- GÜÇ DEVREYE GİRİYOR ---
    if (blocksAbsorbed > 0) {