public void IncrementStatistic(BlockEvent event, Player player) {
    McPlayerStats.debugMsg(
        String.format(
            "You %1s %2s %3s",
            event.getEventName().toString(), 1, event.getBlock().getType().toString()));

    IncrementStatistic(
        player, event.getBlock().getType().toString(), event.getEventName().toString(), 1);
  }
  /**
   * Notify mechanics about a changed block that they are watching.
   *
   * @param event
   */
  public void notify(BlockEvent event) {

    Set<PersistentMechanic> pms = watchBlocks.get(BukkitUtil.toWorldVector(event.getBlock()));

    if (pms == null) return;

    for (PersistentMechanic m : pms) {
      m.onWatchBlockNotification(event);
    }
  }
Exemple #3
0
  /**
   * Check when a player deposits fire and add it to list
   *
   * @param event the events
   * @param player the player
   */
  private void checkForPvpFire(BlockEvent event, Player player) {

    ApiPlayerConfEntry entry;

    if (player != null && (entry = playerConf.get(player)) != null) {

      Location loc = event.getBlock().getLocation();
      ApiDummyLand land = Secuboid.getThisPlugin().getLands().getLandOrOutsideArea(loc);

      if (land.getFlagAndInherit(FlagList.FULL_PVP.getFlagType()).getValueBoolean() == false
          || land.getFlagAndInherit(FlagList.FULL_PVP.getFlagType()).getValueBoolean() == false) {

        // Add fire for pvp listen
        playerFireLocation.put(loc, entry.getPlayerContainer());
      }
    }
  }