Package org.spout.api.event.cause

Examples of org.spout.api.event.cause.EntityCause


      // Change the clicked block to air
      final Cause<?> cause;
      if (entity instanceof Player) {
        cause = new PlayerCause((Player) entity);
      } else {
        cause = new EntityCause(entity);
      }
      block.setMaterial(BlockMaterial.AIR, cause);
    }
  }
View Full Code Here


    final Point position = getOwner().getPhysics().getPosition();
    final int x = position.getFloorX();
    final int y = position.getFloorY() - 1;
    final int z = position.getFloorZ();
    if (isBlockEatableTallGrass(x, y, z)) {
      getOwner().getWorld().setBlockMaterial(x, y, z, VanillaMaterials.AIR, (short) 0, new EntityCause(getOwner()));
      onGrassEaten();
    } else if (getOwner().getWorld().getBlockMaterial(x, y, z) == VanillaMaterials.GRASS) {
      getOwner().getWorld().setBlockMaterial(x, y, z, VanillaMaterials.DIRT, (short) 0, new EntityCause(getOwner()));
      onGrassEaten();
    }
  }
View Full Code Here

        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);

          //TODO Subtract from inventory component
View Full Code Here

      BlockMaterial clickedmat = block.getMaterial();
      Cause<Entity> cause;
      if (entity instanceof Player) {
        cause = new PlayerCause((Player) entity);
      } else {
        cause = new EntityCause(entity);
      }
      if (clickedmat.equals(VanillaMaterials.TNT)) {
        // Detonate TntBlock
        VanillaMaterials.TNT.onIgnite(block, cause);
      } else {
View Full Code Here

TOP

Related Classes of org.spout.api.event.cause.EntityCause

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.