Package org.bukkit.event.block

Examples of org.bukkit.event.block.BlockPlaceEvent


        if (CraftBookPlugin.inst().getConfiguration().advancedBlockChecks) {

            CompatabilityUtil.disableInterferences(player);
            BlockEvent event;
            if(build)
                event = new BlockPlaceEvent(block, block.getState(), block.getRelative(0, -1, 0), player.getItemInHand(), player, true);
            else
                event = new BlockBreakEvent(block, player);
            EventUtil.ignoreEvent(event);
            CraftBookPlugin.inst().getServer().getPluginManager().callEvent(event);
            CompatabilityUtil.enableInterferences(player);
View Full Code Here


      if (Math.max(Math.abs(result.getX()-spawn.getBlockX()), Math.abs(result.getZ()-spawn.getBlockZ())) > spawnRadius) { // Slower check
        canBuild = true;
      }
    }

    BlockPlaceEvent placeEvent = new BlockPlaceEvent(result, oldState, clicked, item, player, canBuild);
    Bukkit.getPluginManager().callEvent(placeEvent);

    return !placeEvent.isCancelled() && placeEvent.canBuild();
  }
View Full Code Here

        GlowBlockState oldState = target.getState(), newState = target.getState();
        placeBlock(player, newState, face, holding, clickedLoc);
        newState.update(true);

        // call blockPlace event
        BlockPlaceEvent event = new BlockPlaceEvent(target, oldState, against, holding, player, canBuild);
        EventFactory.callEvent(event);
        if (event.isCancelled() || !event.canBuild()) {
            oldState.update(true);
            return;
        }

        // play a sound effect
View Full Code Here

TOP

Related Classes of org.bukkit.event.block.BlockPlaceEvent

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.