Examples of CHBlockHealEvent


Examples of com.nitnelave.CreeperHeal.events.CHBlockHealEvent

     *            but the block is dropped.
     * @return False if the replacement was postponed.
     */
    public boolean replace(boolean shouldDrop)
    {
        CHBlockHealEvent event = new CHBlockHealEvent(block, shouldDrop, CHBlockHealReason.BURNT);
        Bukkit.getPluginManager().callEvent(event);
        if (event.isCancelled())
            return event.shouldDrop();
        return block.replace(event.shouldDrop());
    }
View Full Code Here

Examples of com.nitnelave.CreeperHeal.events.CHBlockHealEvent

    {
        Iterator<Replaceable> iter = blockList.iterator();
        while (iter.hasNext())
        {
            Replaceable block = iter.next();
            CHBlockHealEvent event = new CHBlockHealEvent(block, shouldDrop, reason);
            Bukkit.getPluginManager().callEvent(event);
            if (!event.isCancelled() && block.replace(event.shouldDrop()))
                iter.remove();
        }
        if (shouldDrop)
        {
            blockList.clear();
View Full Code Here

Examples of com.nitnelave.CreeperHeal.events.CHBlockHealEvent

    {
        Replaceable block;
        if (blockList.isEmpty())
            return;
        block = blockList.remove();
        CHBlockHealEvent event = new CHBlockHealEvent(block, false, CHBlockHealReason.BLOCK_BY_BLOCK);
        Bukkit.getPluginManager().callEvent(event);
        if (!event.isCancelled() && !block.replace(event.shouldDrop()))
            block.delayReplacement(CHBlockHealReason.BLOCK_BY_BLOCK);
        if (CreeperConfig.getBool(CfgVal.TELEPORT_ON_SUFFOCATE))
            Suffocating.checkPlayerOneBlock(block.getBlock().getLocation());
    }
View Full Code Here

Examples of com.nitnelave.CreeperHeal.events.CHBlockHealEvent

            if ((blockState instanceof Attachable && blockState.getBlock().getRelative(((Attachable) blockState).getAttachedFace()).getType() == Material.AIR)
                || blockState.getBlock().getRelative(BlockFace.DOWN).getType() == Material.AIR)
                counter++;
            else
            {
                CHBlockHealEvent event = new CHBlockHealEvent(blockState, true, reason);
                Bukkit.getPluginManager().callEvent(event);
                if (!event.isCancelled())
                    blockState.replace(event.shouldDrop());
                Bukkit.getScheduler().cancelTask(id);
            }
        }
        else
        {
            CHBlockHealEvent event = new CHBlockHealEvent(blockState, true, reason);
            Bukkit.getPluginManager().callEvent(event);
            if (!event.isCancelled())
                blockState.replace(event.shouldDrop());
            Bukkit.getScheduler().cancelTask(id);
        }

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.