Package org.spout.vanilla.event.cause

Examples of org.spout.vanilla.event.cause.PlayerBreakCause


          continue;
        }
        block = block.translate(BlockFace.TOP);
        Cause<Entity> cause;
        if (entity instanceof Player) {
          cause = new PlayerBreakCause((Player) entity, block);
        } else {
          cause = new EntityCause(entity);
        }
        if (this.canCreate(block, (short) 0, cause)) {
          this.onCreate(block, (short) 0, cause);
View Full Code Here


            if (isInteractable) {
              Block neigh = block.translate(clickedFace);
              boolean fire = neigh.getMaterial().equals(VanillaMaterials.FIRE);
              if (fire) {
                // put out fire
                if (VanillaMaterials.FIRE.onDestroy(neigh, new PlayerBreakCause(player, neigh))) {
                  GeneralEffects.RANDOM_FIZZ.playGlobal(block.getPosition());
                }
              } else if (human.isSurvival() && blockMaterial.getHardness() != 0.0f) {
                ItemStack currentItem = PlayerUtil.getHeldSlot(player).get();
                if (currentItem != null) {
View Full Code Here

    }
    ItemStack heldItem = PlayerUtil.getHeldSlot(session.getPlayer()).get();
    if (heldItem != null) {
      heldItem.getMaterial().getItemFlags(heldItem, flags);
    }
    if (!blockMaterial.destroy(block, flags, new PlayerBreakCause((Player) human.getOwner(), block))) {
      RepositionManager rm = session.getPlayer().getNetwork().getRepositionManager();
      session.send(new BlockChangeMessage(block, rm));
      Sign sign = block.get(Sign.class);
      if (sign != null) {
        session.send(new SignMessage(block.getX(), block.getY(), block.getZ(), sign.getText(), rm));
View Full Code Here

TOP

Related Classes of org.spout.vanilla.event.cause.PlayerBreakCause

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.