@EventHandler public void itemKillEvent(ItemDespawnEvent event){ if(Minigame.getCurrentMinigame()!=null){ switch(Minigame.getCurrentMinigame().getMap().getType()){ case CIRCLE_OF_BOOM: if(Minigame.getCurrentMinigame().getState().equals(MatchState.STARTED)){ event.setCancelled(true); } break; case KEY_QUEST: break; case WATER_THE_MONUMENT: break; default: break; } } }
@EventHandler public void handle(ItemDespawnEvent e) { MobSelector.MobImpl mob = CollectionWrapper.filter(MobSelector.getInstance().getMobs().values(), new Acceptable<MobSelector.MobImpl>() { @Override public boolean isAccepted(MobSelector.MobImpl value) { return ((Entity) value.getDisplayMessage()).getPassenger() != null && e.getEntity().getEntityId() == ((Entity) value.getDisplayMessage()).getPassenger().getEntityId(); } }); if (mob != null) { e.setCancelled(true); } }
@EventHandler public void onItemDespawn(ItemDespawnEvent event) { if (event.getEntity().hasMetadata(RMetadata.META_NO_PICKUP)) { event.setCancelled(true); return; } removeLabel(event.getEntity()); }
@EventHandler public void onDespawn(ItemDespawnEvent event) { for (Entry<Block, CraftingOperation> entry : operations.entrySet()) { CraftingOperation op = entry.getValue(); for (Item item : op.getItemEntities()) { if (item == event.getEntity()) { op.clear(true); operations.remove(entry.getKey()); return; } } } }
@EventHandler public void onItemDespawnEvent(ItemDespawnEvent event) { for (final Game game : this.controller.games) { if (game.getArena().isLocationInArea(event.getLocation())) game.getArena().getBoostItemHandler().removeItem(event.getEntity()); } }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onItemDespawn(ItemDespawnEvent e) { if (plugin.cfg.dropProtectMode == DropProtectMode.OFF) return; Item ent = e.getEntity(); if (items.getIfPresent(ent.getEntityId()) != null) { e.setCancelled(true); } }
/** * Prevents a pearl from despawning * @param e The event args */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onItemDespawn(ItemDespawnEvent e) { ExilePearl pearl = pearlApi.getPearlFromItemStack(e.getEntity().getItemStack()); if (pearl != null) { e.setCancelled(true); pearlApi.log("Prevented pearl from despawning at %s for player %s.", pearl.getLocation().toString(), pearl.getPlayerName()); } }
@EventHandler public void onItemDespawn(ItemDespawnEvent e) { if (e.getEntity().hasMetadata("codnodespawn")) e.setCancelled(true); if (e.getEntity().hasMetadata("codredflag")) e.setCancelled(true); if (e.getEntity().hasMetadata("codblueflag")) e.setCancelled(true); if (e.getEntity().hasMetadata("codRedTag")) e.setCancelled(true); if (e.getEntity().hasMetadata("codBlueTag")) e.setCancelled(true); }
@EventHandler(priority = EventPriority.MONITOR) public void onItemDespawn(ItemDespawnEvent event) { BonusGoodie goodie = CivGlobal.getBonusGoodie(event.getEntity().getItemStack()); if (goodie == null) { return; } goodie.replenish(event.getEntity().getItemStack(), event.getEntity(), null, null); }
public void onDropsDespawn(ItemDespawnEvent event) { Entity item = event.getEntity(); if (item.equals(droppedBook) || item.equals(droppedShovel) || item.equals(droppedStick)) { event.setCancelled(true); log("Renewing item"); } }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) private void onItemDespawn(ItemDespawnEvent event) { final FloatingItem item = _floatingItems.get(event.getEntity().getUniqueId()); if (item == null) return; if (item.isSpawned()) event.setCancelled(true); }
@EventHandler public void onItemDespawn(ItemDespawnEvent e) { if(pl.getManagers().getBackPackManager().isBackpack(e.getEntity().getItemStack())) { Backpack pack = pl.getManagers().getBackPackManager().getBackpackByItem(e.getEntity().getItemStack()); pack.remove(); } }
@EventHandler private void itemDespawnItem(ItemDespawnEvent event) { CustomItem customItem = CustomItemManager.getCustomItem(event.getEntity().getItemStack()); if (verifyCustomItem(customItem, event.getEntity().getWorld())) { customItem.onDespawn(event); } }
public ShearFinder() { super(ItemDespawnEvent.getHandlerList()); }
@EventHandler(ignoreCancelled = true) // Prevent Barley's shears from despawning. public void onItemDespawn(ItemDespawnEvent evt) { evt.setCancelled(evt.getEntity().getItemStack().getType() == Material.SHEARS && isPuzzle(evt.getEntity())); }
@EventHandler public void onItemDespawn(ItemDespawnEvent event) { if (bones.containsKey(event.getEntity())) { this.bones.remove(event.getEntity()); } }
@EventHandler public void onEntityDamage(ItemDespawnEvent event) { if (event.getEntity().hasMetadata(this.invulnerable)) { event.setCancelled(true); } }
@SuppressWarnings("deprecation") @EventHandler(ignoreCancelled = true) public void onItemDespawn(ItemDespawnEvent event) { //respect config option if (!ConfigData.regrowTrees) return; //only care about dropped items Entity entity = event.getEntity(); if (entity.getType() != EntityType.DROPPED_ITEM) return; if (!(entity instanceof Item)) return; //get info about the dropped item ItemStack item = ((Item) entity).getItemStack(); //only care about saplings if (item.getType() != Material.SAPLING) return; //only care about the newest region if (!Region.getOpenRegion().equals(Region.fromLocation(entity.getLocation()))) return; //only replace these blocks with saplings Block block = entity.getLocation().getBlock(); if (block.getType() != Material.AIR && block.getType() != Material.LONG_GRASS && block.getType() != Material.SNOW) return; //don't plant saplings next to other saplings or logs Block[] neighbors = new Block[]{ block.getRelative(BlockFace.EAST), block.getRelative(BlockFace.WEST), block.getRelative(BlockFace.NORTH), block.getRelative(BlockFace.SOUTH), block.getRelative(BlockFace.NORTH_EAST), block.getRelative(BlockFace.SOUTH_EAST), block.getRelative(BlockFace.SOUTH_WEST), block.getRelative(BlockFace.NORTH_WEST)}; for (Block b : neighbors) { if (b.getType() == Material.SAPLING || b.getType() == Material.LOG) return; } //only plant trees in grass or dirt Block underBlock = block.getRelative(BlockFace.DOWN); if (underBlock.getType() == Material.GRASS || underBlock.getType() == Material.DIRT) block.setTypeIdAndData(item.getTypeId(), item.getData().getData(), false); }
@EventHandler public void onItemDespawn(ItemDespawnEvent event) { if (directionBook != null) directionBook.onDropsDespawn(event); }
@Override public void onDespawn(ItemDespawnEvent event) { if (shouldBroadcastMessage()) { UtilsMc.broadcastToWorld(event.getEntity().getWorld(), MessageFormat.format("The {0}§f has been lost forever!", getName())); } }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void handlePassiveCleaning(ItemDespawnEvent e) { auctionDataManager.addLot(e.getEntity()); }
public void onDespawn(ItemDespawnEvent event) { }