Пример #1
0
  @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
  public void onBlockForm(final BlockFormEvent event) {
    Block b = event.getBlock();

    if (PlotManager.isPlotWorld(b)) {
      String id = PlotManager.getPlotId(b.getLocation());

      if (id.equalsIgnoreCase("")) {
        event.setCancelled(true);
      }
    }
  }
  /*
   * Called when a block is formed based on world conditions.
   */
  @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
  public void onBlockForm(BlockFormEvent event) {
    ConfigurationManager cfg = plugin.getGlobalStateManager();
    WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld());

    if (cfg.activityHaltToggle) {
      event.setCancelled(true);
      return;
    }

    int type = event.getNewState().getTypeId();

    if (type == BlockID.ICE) {
      if (wcfg.disableIceFormation) {
        event.setCancelled(true);
        return;
      }
      if (wcfg.useRegions
          && !plugin
              .getGlobalRegionManager()
              .allows(DefaultFlag.ICE_FORM, event.getBlock().getLocation())) {
        event.setCancelled(true);
        return;
      }
    }

    if (type == BlockID.SNOW) {
      if (wcfg.disableSnowFormation) {
        event.setCancelled(true);
        return;
      }
      if (wcfg.useRegions
          && !plugin
              .getGlobalRegionManager()
              .allows(DefaultFlag.SNOW_FALL, event.getBlock().getLocation())) {
        event.setCancelled(true);
        return;
      }
    }
  }
Пример #3
0
 /*    */ @EventHandler
 /*    */ public void onBlockForm(BlockFormEvent event) /*    */ {
   /* 41 */ if (this.noFreeze) /* 42 */ event.setCancelled(true);
   /*    */ }
Пример #4
0
 @EventHandler
 public void BlockFormEvent(BlockFormEvent event) {
   if (!arena.getRegion().isInside(event.getBlock().getLocation()) || arena.getEditMode()) return;
   event.setCancelled(true);
 }