Package org.bukkit.entity

Examples of org.bukkit.entity.TNTPrimed


        if (targetBlock.getType() != Material.TNT || !EventUtils.simulateBlockBreak(targetBlock, player, true) || !blastMiningCooldownOver()) {
            return;
        }

        TNTPrimed tnt = player.getWorld().spawn(targetBlock.getLocation(), TNTPrimed.class);

        SkillUtils.sendSkillMessage(player, AbilityType.BLAST_MINING.getAbilityPlayer(player));
        player.sendMessage(LocaleLoader.getString("Mining.Blast.Boom"));

        tnt.setMetadata(mcMMO.tntMetadataKey, mcMMOPlayer.getPlayerMetadata());
        tnt.setFuseTicks(0);
        targetBlock.setType(Material.AIR);

        mcMMOPlayer.setAbilityDATS(AbilityType.BLAST_MINING, System.currentTimeMillis());
        mcMMOPlayer.setAbilityInformed(AbilityType.BLAST_MINING, false);
        new AbilityCooldownTask(mcMMOPlayer, AbilityType.BLAST_MINING).runTaskLaterAsynchronously(mcMMO.p, AbilityType.BLAST_MINING.getCooldown() * Misc.TICK_CONVERSION_FACTOR);
 
View Full Code Here


        }

        if (Misc.getRandom().nextBoolean()) {
            player.sendMessage(LocaleLoader.getString("Fishing.Ability.TH.Boom"));

            TNTPrimed tnt = (TNTPrimed) player.getWorld().spawnEntity(fishingCatch.getLocation(), EntityType.PRIMED_TNT);
            fishingCatch.setPassenger(tnt);

            Vector velocity = fishingCatch.getVelocity();
            double magnitude = velocity.length();
            fishingCatch.setVelocity(velocity.multiply((magnitude + 1) / magnitude));

            tnt.setMetadata(mcMMO.tntsafeMetadataKey, mcMMO.metadataValue);
            tnt.setFuseTicks(3 * Misc.TICK_CONVERSION_FACTOR);
        }
        else {
            player.sendMessage(LocaleLoader.getString("Fishing.Ability.TH.Poison"));

            ThrownPotion thrownPotion = player.getWorld().spawn(fishingCatch.getLocation(), ThrownPotion.class);
View Full Code Here

            if(!loc.getChunk().isLoaded())
                return;

            while(!BlockType.canPassThrough(loc.getBlock().getTypeId()))
                loc = loc.add(0, 1, 0);
            TNTPrimed tnt = (TNTPrimed) loc.getWorld().spawnEntity(BlockUtil.getBlockCentre(loc.getBlock()),
                    EntityType.PRIMED_TNT);
            tnt.setIsIncendiary(flamey);
            if (ticks > 0) {
                tnt.setFuseTicks(ticks);
            }
            if (yield > 0) {
                tnt.setYield(yield);
            }
        }
    }
View Full Code Here

    public boolean doAction(Dispenser dis, ItemStack item, Vector velocity, BlockDispenseEvent event) {

        org.bukkit.material.Dispenser disp = (org.bukkit.material.Dispenser) dis.getData();
        BlockFace face = disp.getFacing();
        Location location = dis.getBlock().getRelative(face).getLocation().add(0.5, 0.5, 0.5);
        TNTPrimed a = (TNTPrimed) dis.getWorld().spawnEntity(location, EntityType.PRIMED_TNT);
        a.setVelocity(velocity.normalize().multiply(2));
        return true;
    }
View Full Code Here

TOP

Related Classes of org.bukkit.entity.TNTPrimed

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.