Exemplo n.º 1
0
  @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
  public void onPlayerBucketFill(final PlayerBucketFillEvent event) {
    if (!PlotMe.cPerms(event.getPlayer(), "plotme.admin.buildanywhere")) {
      Block b = event.getBlockClicked();
      if (PlotManager.isPlotWorld(b)) {
        String id = PlotManager.getPlotId(b.getLocation());
        Player p = event.getPlayer();

        if (id.equalsIgnoreCase("")) {
          p.sendMessage(PlotMe.caption("ErrCannotBuild"));
          event.setCancelled(true);
        } else {
          Plot plot = PlotManager.getPlotById(p, id);

          if (plot == null) {
            p.sendMessage(PlotMe.caption("ErrCannotBuild"));
            event.setCancelled(true);
          } else if (!plot.isAllowed(p.getName())) {
            p.sendMessage(PlotMe.caption("ErrCannotBuild"));
            event.setCancelled(true);
          }
        }
      }
    }
  }
Exemplo n.º 2
0
  @EventHandler(priority = EventPriority.HIGH)
  public void liquidFill(PlayerBucketFillEvent event) {
    OwnedLand land = OwnedLand.getApplicableLand(event.getBlockClicked().getLocation());
    if (land == null) {
      return;
    }
    Player p = event.getPlayer();

    if (!land.hasPermTo(p, this)) {
      p.sendMessage(
          ChatColor.RED + getPlugin().getMessageConfig().getString("event.build.bucketFill"));
      event.setCancelled(true);
    }
  }
Exemplo n.º 3
0
  @Override
  public void onPlayerBucketFill(PlayerBucketFillEvent event) {
    if (event.isCancelled()) {
      return;
    }

    Block block = event.getBlockClicked();
    Player player = event.getPlayer();

    if (!this.playerCanUseItemHere(player, block, event.getBucket())) {
      event.setCancelled(true);
      return;
    }
  }
  @EventHandler(priority = EventPriority.HIGHEST)
  public void onPlayerBucketFill(PlayerBucketFillEvent event) {
    if (event.isCancelled()) return;

    final Player player = event.getPlayer();
    final Block block = event.getBlockClicked();

    if (player.getWorld() != plugin.getIslandWorld()) return;
    if (player.isOp()) return;
    if (player.hasPermission("islandworld.bypass.island")) return;

    if (block != null && !plugin.canBuildOnLocation(player, block.getLocation()))
      event.setCancelled(true);

    plugin.debug("Event :" + event.getEventName() + ", cancelled:" + event.isCancelled());
  }
Exemplo n.º 5
0
 @EventHandler
 public void onPlayerFillBucket(PlayerBucketFillEvent PBF) {
   Player PBFP = PBF.getPlayer();
   if (!Authentication.config.getBoolean("Authentication.Events.BlockBreak.Allowed") == true) {
     if (!Authentication.instance.hasPlayerAccepted(PBFP)) {
       PBF.setCancelled(true);
       if (Authentication.instance.RulesMessage == true) {
         PBFP.performCommand("serverrules");
       }
       if (Authentication.instance.EventMessage == true) {
         PBFP.sendMessage(
             ChatColor.translateAlternateColorCodes(
                 '&',
                 Authentication.config.getString("Authentication.Events.BlockBreak.Message")));
       }
     }
   }
 }
Exemplo n.º 6
0
 @EventHandler(priority = EventPriority.HIGH)
 public void playerFillBucket(PlayerBucketFillEvent event) {
   if (event.isCancelled()) {
     return;
   }
   Player player = event.getPlayer();
   if (vanishNoPacket.isPlayerInvisible(player)) {
     return;
   }
   Block block = event.getBlockClicked();
   Set<Snitch> snitches = snitchManager.findSnitches(block.getWorld(), block.getLocation());
   for (Snitch snitch : snitches) {
     if (!isOnSnitch(snitch, player.getName()) || isDebugging()) {
       if (checkProximity(snitch, player.getName())) {
         plugin.getJaLogger().logSnitchBucketFill(snitch, player, block);
       }
     }
   }
 }
Exemplo n.º 7
0
 @EventHandler
 public void onPlayerBucketFill(PlayerBucketFillEvent e) {
   if (!canBuildHere(e.getPlayer(), e.getBlockClicked())) {
     e.setCancelled(true);
   }
 }