예제 #1
0
  @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
  public void onBlockPlace(BlockPlaceEvent event) {
    ZoneManager manager = m_plugin.getZoneManager();
    Zone zone = manager.getZone(event.getBlock().getLocation());

    if (zone == null) {
      return;
    }

    if (!zone.canPlayerUse(event.getPlayer(), event.getBlock())) {
      sendMessageNoSpam(event.getPlayer(), UI.getMessage("NoBuild"));
      event.setCancelled(true);
      if (shouldBurn(event.getBlock())) {
        event.getPlayer().setFireTicks(100);
      }
    }
  }