// ---------------------------------------------------------------------------------------------------------------- @EventHandler public void onPlayerDropItem(PlayerDropItemEvent e) { if (e.getPlayer() instanceof Player) { Player p = e.getPlayer(); e.setCancelled(true); } }
/** * 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; } } }
@EventHandler public void onItemDrop(PlayerDropItemEvent e) { Player p = e.getPlayer(); if (adminMode.contains(p.getName())) { e.setCancelled(true); } }
@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 onSoulboundDrop(PlayerDropItemEvent e) { if (isSoulbound(e.getItemDrop().getItemStack())) { Player p = e.getPlayer(); SoundManager.playSoundForPlayer(p, Sound.BLAZE_HIT, 1F, 0.25F, 0.5F); e.getItemDrop().remove(); } }
@EventHandler public void onItemDrop(PlayerDropItemEvent e) { SpleefPlayer player = HeavySpleef.getInstance().getSpleefPlayer(e.getPlayer()); if (!player.isActive()) return; e.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 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); } }
@EventHandler(priority = EventPriority.NORMAL) public void onPlayerDropItem(PlayerDropItemEvent event) { ItemStack item = event.getItemDrop().getItemStack(); if (!isItemInfoBook(item)) { return; } 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(); } } }
@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); } } }
/** * Cancel players from dropping the hat in their inventory. * * @param event */ @EventHandler public void cancelHatDropping(PlayerDropItemEvent event) { ItemStack item = event.getItemDrop().getItemStack().clone(); if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().equals("§8§oHat")) { event.getItemDrop().remove(); event.getPlayer().closeInventory(); event.getPlayer().updateInventory(); } }
@Override public void call(Event event) { PlayerDropItemEvent e = (PlayerDropItemEvent) event; if (e.getItemDrop().getItemStack().getType() == Material.SULPHUR) { Item item = e.getItemDrop(); item.getWorld().createExplosion(item.getLocation(), 10f, false); } }
@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!"); } } } }
@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!"); } } }
/** * 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); } }
@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.MONITOR, ignoreCancelled = true) public void onPlayerDropsItem(PlayerDropItemEvent event) { plugin .getServer() .getScheduler() .runTask(plugin, new ResetIgnoreSleepTask(plugin, event.getPlayer().getName())); }
@EventHandler public void onDrop(PlayerDropItemEvent event) { if (isFilly(event.getPlayer())) { ItemStack is = event.getItemDrop().getItemStack(); if (is.getType() == Material.WRITTEN_BOOK) { BookMeta bm = (BookMeta) is.getItemMeta(); if ((bm.hasAuthor() && bm.getAuthor().equals("TheQueenOfPink")) && (bm.hasTitle() && bm.getTitle().equals("MineLittlePony.se Handbook"))) { event.getItemDrop().remove(); } if (PonyManager.getGroup(event.getPlayer()).equals("filly")) { event.getPlayer().getInventory().addItem(getFillyHandbook()); } } } }
@EventHandler public void onDrop(PlayerDropItemEvent e) { if (!Config.separateInv) return; Player p = e.getPlayer(); if (getWorldGroup(p.getWorld()) == null) return; saveInventory(p, p.getInventory()); }
@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) { 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 event) { if (event.getPlayer() == player) { if (step == 2) { long v = getAbsoluteLong(); if (v != -1) { dropItemTime = v; } } } }
@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? }
@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); }
@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()); }
@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); }