Package org.spout.api.event.cause

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


   * @param item to set to
   * @return True if the slot can be set to the item, False if not
   */
  protected boolean canSet(Inventory inventory, int index, ItemStack item) {
    final boolean canSet = inventory.canSet(index, item);
    InventoryCanSetEvent event = owner.getEngine().getEventManager().callEvent(new InventoryCanSetEvent(inventory, new PlayerCause(getPlayer()), index, item, !canSet));
    return !event.isCancelled();
  }
View Full Code Here


      }

      // 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

    String prefix = VanillaPlugin.getInstance().getPrefix();
    if (c == null || !(c instanceof CommandBlock)) {
      player.getEngine().getLogger().warning("CommandBlock information received, but there is no CommandBlock at {" + x + "," + y + "," + z + "}.");
      return;
    }
    c.setCommand(text, new PlayerCause(player));
  }
View Full Code Here

    String[] text = message.getMessage();
    if (text.length != 4) {
      return;
    }

    sign.setText(text, new PlayerCause(player));
  }
View Full Code Here

    String[] text = message.getMessage();
    if (text.length != 4) {
      return;
    }

    sign.setText(text, new PlayerCause(player));
  }
View Full Code Here

    super.onInteract(entity, block, type, clickedface);
    if (type == Action.RIGHT_CLICK) {
      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
View Full Code Here

TOP

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

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.