@EventHandler(priority = EventPriority.LOW)
  public void onPlayerDropItem(PlayerDropItemEvent event) {
    if (event == null) return;
    if (event.getPlayer() == null) event.setCancelled(true);

    if (validateAuthorizer(event.getPlayer())) event.setCancelled(true);
    else if (validateClickAuth(event.getPlayer(), null)) event.setCancelled(true);
  }
 /**
  * Handles item dropping.<br>
  * If the player is in an arena, the game's onItemDrop method is called.<br>
  * If the player is spectating an arena, the event is cancelled.
  */
 @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
 public void onItemDrop(PlayerDropItemEvent event) {
   String playerName = event.getPlayer().getName();
   if (ultimateGames.getPlayerManager().isPlayerInArena(playerName)) {
     Arena arena = ultimateGames.getPlayerManager().getPlayerArena(playerName);
     if (arena.getStatus() == ArenaStatus.RUNNING) {
       arena.getGame().getGamePlugin().onItemDrop(arena, event);
     } else {
       event.setCancelled(true);
     }
   } else if (ultimateGames.getPlayerManager().isPlayerSpectatingArena(playerName)) {
     event.setCancelled(true);
   }
 }
Beispiel #3
0
 // ----------------------------------------------------------------------------------------------------------------
 @EventHandler
 public void onPlayerDropItem(PlayerDropItemEvent e) {
   if (e.getPlayer() instanceof Player) {
     Player p = e.getPlayer();
     e.setCancelled(true);
   }
 }
  @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
  public void onItemDrop(PlayerDropItemEvent event) {
    if (!isInDropOffArea(event.getPlayer().getLocation())) return;

    ItemStack stack = event.getItemDrop().getItemStack();
    if (!isAllowedToDrop(stack.getType())) {
      event.setCancelled(true);
      return;
    }
    if (!isScoringItemType(stack.getType())) return;

    FarmTeamInfo team = (FarmTeamInfo) getTeam(event.getPlayer());
    int teamNum = indexOfTeam(team);
    long dropScore = 0;

    for (int i = 0; i < stack.getAmount(); i++)
      dropScore += getScoreForItem(stack.getType(), teamNum);

    event.getPlayer().sendMessage(stack.getType().name() + ": score +" + dropScore);
    team.addScore(dropScore);

    event
        .getItemDrop()
        .remove(); // don't actually DROP the item ... should we schedule a brief delay here?
  }
  /**
   * Called when a player attempts to drop an item
   *
   * @param event Relevant event details
   */
  @Override
  public void onPlayerDropItem(PlayerDropItemEvent event) {

    if (event.isCancelled()) {
      return;
    }

    GlobalConfiguration cfg = plugin.getGlobalConfiguration();
    WorldConfiguration wcfg = cfg.getWorldConfig(event.getPlayer().getWorld().getName());

    if (wcfg.getBlacklist() != null) {
      Item ci = event.getItemDrop();

      if (!wcfg.getBlacklist()
          .check(
              new ItemDropBlacklistEvent(
                  BukkitPlayer.wrapPlayer(plugin, event.getPlayer()),
                  toVector(ci.getLocation()),
                  ci.getItemStack().getTypeId()),
              false,
              false)) {
        event.setCancelled(true);
        return;
      }
    }
  }
Beispiel #6
0
  @EventHandler
  public void onItemDrop(PlayerDropItemEvent e) {
    Player p = e.getPlayer();

    if (adminMode.contains(p.getName())) {
      e.setCancelled(true);
    }
  }
Beispiel #7
0
 @EventHandler(priority = EventPriority.HIGH)
 public void dropItem(PlayerDropItemEvent event) {
   if (PVPGT.equals("RBR") && (ringBearers.size() > 0)) {
     if (event.getItemDrop().getItemStack().getType().equals(Material.GLOWSTONE)) {
       event.setCancelled(true);
     }
   }
 }
	@EventHandler
	public void onItemDrop(PlayerDropItemEvent e) {
		SpleefPlayer player = HeavySpleef.getInstance().getSpleefPlayer(e.getPlayer());

		if (!player.isActive())
			return;

		e.setCancelled(true);
	}
  @EventHandler
  public void onDrop(PlayerDropItemEvent die) {
    Player p = die.getPlayer();
    Game g = Main.getInstance().getGameManager().getGameOfPlayer(p);
    if (g == null) {
      return;
    }

    if (g.getState() != GameState.WAITING) {
      if (g.isSpectator(p)) {
        die.setCancelled(true);
      }

      return;
    }

    die.setCancelled(true);
  }
  public void onPlayerDropItem(PlayerDropItemEvent event) {

    String eventplayer = event.getPlayer().getName();
    if (admin.freeze.contains(eventplayer)) {
      // cancel here
      event.setCancelled(true);
      event.getPlayer().sendMessage(ChatColor.RED + "Can't do that while frozen!");
    }
  }
 @EventHandler(priority = EventPriority.NORMAL)
 public void onPlayerDropItem(PlayerDropItemEvent event) {
   if (TotalFreedomMod.autoEntityWipe) {
     if (event.getPlayer().getWorld().getEntities().size() > 750) {
       event.setCancelled(true);
     } else {
       event.getItemDrop().remove();
     }
   }
 }
 @EventHandler(priority = EventPriority.NORMAL)
 public void onPlayerDropItem(PlayerDropItemEvent event) {
   if (TFM_ConfigEntry.AUTO_ENTITY_WIPE.getBoolean()) {
     if (event.getPlayer().getWorld().getEntities().size() > 750) {
       event.setCancelled(true);
     } else {
       event.getItemDrop().remove();
     }
   }
 }
Beispiel #13
0
 public void onPlayerDropItem(PlayerDropItemEvent event) {
   Player p = event.getPlayer();
   // Handle field builder condition
   Builder fb = plugin.getBattlefieldManager().getBuilder(p);
   if (fb != null) {
     if (fb.getTool() != null) {
       fb.getTool().cycleParameters();
       event.setCancelled(true);
     }
   }
   // Handle item drops on battlefield
   TeamMember m = plugin.getBattlefieldManager().getPlayer(p);
   if (m != null) {
     if (m.getTeam().getField().isActive()) {
       p.sendMessage(Format.errorTag + "Dropping items is disallowed on the battlefield.");
       event.setCancelled(true);
     }
   }
 }
 @EventHandler
 public void onPlayerDropItem(PlayerDropItemEvent e) {
   Player player = e.getPlayer();
   if (!player.hasPermission("spawn.interact")
       && Util.getConfig()
           .getStringList("inventory_interact_worlds")
           .contains(player.getWorld().getName())) {
     e.setCancelled(true);
   }
 }
Beispiel #15
0
 @EventHandler
 public void onPlayerDropItem(PlayerDropItemEvent e) {
   Player p = e.getPlayer();
   if (p.getLocation()
       .getWorld()
       .getName()
       .equals(settings.getConfig().getString("spawn.world"))) {
     if (!p.hasPermission("hub.editinventory")) {
       e.setCancelled(true);
     }
   }
 }
 @EventHandler(priority = EventPriority.MONITOR)
 public void onDropEvent(PlayerDropItemEvent event) {
   Player player = event.getPlayer();
   if (!plugin.isSkyWorld(player.getWorld())) {
     return;
   }
   if (!visitorsCanDrop && !plugin.playerIsOnIsland(player) && !plugin.playerIsInSpawn(player)) {
     event.setCancelled(true);
     plugin.notifyPlayer(player, "\u00a7eVisitors can't drop items!");
     return;
   }
   addDropInfo(player, event.getItemDrop().getItemStack());
 }
 @EventHandler
 public void SpectatorDrops(PlayerDropItemEvent event) {
   Player p = event.getPlayer();
   String pname = p.getName();
   for (i = 0; i < plugin.Watching.size(); i++) {
     if (plugin.Watching.get(i) != null) {
       if (plugin.Watching.get(i).contains(pname)) {
         event.setCancelled(true);
         p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
       }
     }
   }
 }
Beispiel #18
0
 @EventHandler(priority = EventPriority.HIGHEST)
 public void onItemDrop(PlayerDropItemEvent event) {
   Player player = event.getPlayer();
   ItemStack item = event.getItemDrop().getItemStack();
   int amount = item.getAmount();
   if (!player.hasPermission("antihax.check.dropinv")) {
     if (amount > 64) {
       event.setCancelled(true);
       tellPlayer(
           player,
           "[" + ChatColor.RED + "AntiHax" + ChatColor.RESET + "] You dropped items too fast!");
     }
   }
 }
Beispiel #19
0
  @EventHandler(priority = EventPriority.LOW)
  public void onPlayerDropItems(PlayerDropItemEvent event) {
    Player player = event.getPlayer();
    Client client = Client.getClient(player);

    if (client.isObserver() || !Rixor.getRotation().getSlot().getMatch().isCurrentlyRunning()) {
      event.setCancelled(true);
      return;
    }

    if (!client.isObserver()) {
      /*Map map = Rixor.getRotation().getSlot().getMap();
       */
    }
  }
  @EventHandler(priority = EventPriority.LOWEST)
  public void onItemDrop(PlayerDropItemEvent event) {
    if (event.isCancelled()) return;

    final Player player = event.getPlayer();
    final Item item = event.getItemDrop();

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

    if (!(plugin.canBuildOnLocation(player, item.getLocation()))) event.setCancelled(true);

    plugin.debug("Event :" + event.getEventName() + ", cancelled:" + event.isCancelled());
  }
Beispiel #21
0
 @EventHandler
 protected void onItemDrop(PlayerDropItemEvent event) {
   if (event.getItemDrop().getItemStack().getType() == type.getMaterial()) {
     if (event.getItemDrop().getItemStack().getData().getData() == type.getData()) {
       if (event.getItemDrop().getItemStack().getItemMeta().hasDisplayName()) {
         if (event
             .getItemDrop()
             .getItemStack()
             .getItemMeta()
             .getDisplayName()
             .endsWith(getName())) {
           if (SettingsManager.getConfig().getBoolean("Remove-Gadget-With-Drop")) {
             Core.getCustomPlayer(getPlayer()).removeGadget();
             event.getItemDrop().remove();
             return;
           }
           event.setCancelled(true);
         }
       }
     }
   }
 }
 @EventHandler
 public void onPlayerDropItem(PlayerDropItemEvent e) {
   if (!plugin.getConfig().getBoolean("Complete")) return;
   e.setCancelled(true);
 }
 @EventHandler
 public void onPlayerDropitem(PlayerDropItemEvent event) {
   if (Suffocate.isTempHelmet(event.getItemDrop().getItemStack())) {
     event.setCancelled(true);
   }
 }
 @EventHandler
 public void onItemDrop(PlayerDropItemEvent event) {
   if (um.isSpectator(event.getPlayer().getName())) event.setCancelled(true);
 }
 @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
 public void onDropItem(PlayerDropItemEvent event) {
   if (plugin.noInteract(event.getPlayer())) {
     event.setCancelled(true);
   }
 }
 @EventHandler
 public void onQ(PlayerDropItemEvent e) {
   e.setCancelled(true);
   return;
 }
 @EventHandler
 public void drop(PlayerDropItemEvent event) {
   if (!event.getPlayer().getWorld().getName().equals(getName())) return;
   event.setCancelled(true);
 }
Beispiel #28
0
 @EventHandler
 public void DropEvent(PlayerDropItemEvent e) {
   if (e.getPlayer().getGameMode() == GameMode.CREATIVE) {
     e.setCancelled(true);
   }
 }