Java 类org.bukkit.event.entity.ItemSpawnEvent 实例源码

项目:SurvivalAPI    文件:RiskyRetrievalModule.java   
/**
 * Add ore to chest on drop
 *
 * @param event Item spawn event instance
 */
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM
            || Meta.hasMeta(event.getEntity().getItemStack())
            || event.getEntity().hasMetadata("playerDrop"))
        return;

    for (int i = 0; i < MATERIALS.length; i++)
    {
        ItemStack stack = event.getEntity().getItemStack();

        if (MATERIALS[i] != stack.getType())
            continue;

        ItemStack newStack = stack.clone();
        this.inventory.addItem(Meta.addMeta(newStack));
        event.getEntity().setItemStack(Meta.addMeta(event.getEntity().getItemStack()));
    }
}
项目:SurvivalAPI    文件:RapidStackingModule.java   
/**
 * Delete different type of certains blocks
 *
 * @param event Event
 */
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM)
        return;

    if (event.getEntity().hasMetadata("playerDrop"))
        return;

    Material material = event.getEntity().getItemStack().getType();

    if (material == Material.LOG || material == Material.LOG_2)
        event.getEntity().setItemStack(new ItemStack(Material.LOG, event.getEntity().getItemStack().getAmount()));
    else if (material == Material.COBBLESTONE)
        event.getEntity().setItemStack(new ItemStack(Material.COBBLESTONE, event.getEntity().getItemStack().getAmount()));
    else if (material == Material.STONE)
        event.getEntity().setItemStack(new ItemStack(Material.COBBLESTONE, event.getEntity().getItemStack().getAmount()));
}
项目:SurvivalAPI    文件:RapidFoodModule.java   
/**
 * Soup dropping
 *
 * @param event Event
 */
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM)
        return;

    if (event.getEntity().hasMetadata("playerDrop"))
        return;

    Material material = event.getEntity().getItemStack().getType();

    if (material == Material.BROWN_MUSHROOM || material == Material.RED_MUSHROOM)
        event.getEntity().setItemStack(new ItemStack(Material.MUSHROOM_SOUP, 2));
    else if (material == Material.POTATO_ITEM)
        event.getEntity().setItemStack(new ItemStack(Material.BAKED_POTATO, 1));
    else if (material == Material.CARROT_ITEM)
        event.getEntity().setItemStack(new ItemStack(Material.GOLDEN_CARROT, 1));
    else if (material == Material.WHEAT)
        event.getEntity().setItemStack(new ItemStack(Material.BREAD, 1));
    else if (material == Material.PUMPKIN)
        event.getEntity().setItemStack(new ItemStack(Material.PUMPKIN_PIE, 1));
}
项目:SurvivalAPI    文件:RapidOresModule.java   
/**
 * Double ore's drop
 *
 * @param event Event
 */
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM)
        return;

    if(Meta.hasMeta(event.getEntity().getItemStack()))
        return;

    ItemStack stack = event.getEntity().getItemStack();

    if (this.drops.containsKey(stack))
    {
        ItemStack newStack = this.drops.get(stack).getDrop(stack, this.random);

        if (newStack != null)
        {
            event.getEntity().setItemStack(Meta.addMeta(newStack));
            this.spawnXP(event.getEntity(), this.drops.get(stack).getExperienceModifier(this.random));
        }
    }
}
项目:SurvivalAPI    文件:DiamondFlowerModule.java   
/**
 * Chance to drop a diamond when a player breaks a flower
 *
 * @param event Event
 */
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM)
        return;

    if (event.getEntity().hasMetadata("playerDrop"))
        return;

    if (event.getEntity().getItemStack().getType() != Material.YELLOW_FLOWER
            && event.getEntity().getItemStack().getType() != Material.RED_ROSE
            && (event.getEntity().getItemStack().getType() != Material.DOUBLE_PLANT
                || (event.getEntity().getItemStack().getDurability() > 1 && event.getEntity().getItemStack().getDurability() < 4)))
        return;

    if (this.random.nextDouble() <= (double) this.moduleConfiguration.get("chance"))
        event.getEntity().getWorld().dropItemNaturally(event.getLocation(), Meta.addMeta(new ItemStack(Material.DIAMOND, (int) this.moduleConfiguration.get("diamonds"))));

    event.setCancelled(true);
}
项目:FastAsyncWorldedit    文件:ChunkListener.java   
@EventHandler(priority = EventPriority.LOWEST)
public void onItemSpawn(ItemSpawnEvent event) {
    if (physicsFreeze) {
        event.setCancelled(true);
        return;
    }
    Location loc = event.getLocation();
    int cx = loc.getBlockX() >> 4;
    int cz = loc.getBlockZ() >> 4;
    int[] count = getCount(cx, cz);
    if (count[2] >= Settings.IMP.TICK_LIMITER.ITEMS) {
        event.setCancelled(true);
        return;
    }
    if (++count[2] >= Settings.IMP.TICK_LIMITER.ITEMS) {
        cleanup(loc.getChunk());
        cancelNearby(cx, cz);
        if (rateLimit <= 0) {
            rateLimit = 20;
            Fawe.debug("[FAWE `tick-limiter`] Detected and cancelled item lag source at " + loc);
        }
        event.setCancelled(true);
        return;
    }
}
项目:FastSurvival    文件:LootReplacer.java   
@EventHandler
public void itemSpawn(ItemSpawnEvent event) {
    ItemStack stack = event.getEntity().getItemStack();
    if (stack == null || isMarked(stack))
        return;

    Material material = stack.getType();
    LootRule rule = LootRule.getRule(material);
    if (rule == null)
        return;

    if (rule.getProbability() < 1 && new Random().nextDouble() > rule.getProbability())
        return;

    MaterialData target = rule.getTarget();
    ItemStack replace = new ItemStack(target.getItemType(), stack.getAmount() * rule.getMultiplier());
    replace.setData(target);

    event.getEntity().setItemStack(mark(replace));
}
项目:AncientGates    文件:PluginBlockListener.java   
@EventHandler(priority = EventPriority.NORMAL)
public void onItemSpawn(final ItemSpawnEvent event) {
    if (event.isCancelled())
        return;

    final Entity item = event.getEntity();
    if (item.getType() != EntityType.DROPPED_ITEM || ((Item) item).getItemStack().getType() != Material.SUGAR_CANE)
        return;

    // Stop sugarcane block from decaying (workaround for lack of 1.7.2-R0.1 physics support)
    final WorldCoord coord = new WorldCoord((Item) item);
    final Gate nearestGate = Gates.gateFromPortal(coord);

    if (nearestGate != null) {
        if (nearestGate.getMaterial() != Material.SUGAR_CANE_BLOCK)
            return;

        event.getEntity().remove();
        plugin.getServer().getScheduler().scheduleSyncDelayedTask(Plugin.instance, new Runnable() {
            @Override
            public void run() {
                coord.getBlock().setType(Material.SUGAR_CANE_BLOCK);
            }
        }, 1);
    }
}
项目:PlotSquared-Chinese    文件:ChunkListener.java   
@EventHandler(priority=EventPriority.LOWEST)
public void onItemSpawn(ItemSpawnEvent event) {
    Item entity = event.getEntity();
    Chunk chunk = entity.getLocation().getChunk();
    if (chunk == lastChunk) {
        event.getEntity().remove();
        event.setCancelled(true);
        return;
    }
    if (!PlotSquared.isPlotWorld(chunk.getWorld().getName())) {
        return;
    }
    Entity[] entities = chunk.getEntities();
    if (entities.length > Settings.CHUNK_PROCESSOR_MAX_ENTITIES) {
        event.getEntity().remove();
        event.setCancelled(true);
        lastChunk = chunk;
    }
    else {
        lastChunk = null;
    }
}
项目:civcraft    文件:CustomItemManager.java   
@EventHandler(priority = EventPriority.HIGHEST)
public void OnItemSpawn(ItemSpawnEvent event) {
    ItemStack stack = event.getEntity().getItemStack();

    if (LoreMaterial.isCustom(stack)) {
        LoreMaterial.getMaterial(stack).onItemSpawn(event);
    }

    if (isUnwantedVanillaItem(stack)) {
        if (!stack.getType().equals(Material.HOPPER) && 
                !stack.getType().equals(Material.HOPPER_MINECART)) {        
            event.setCancelled(true);
            event.getEntity().remove();
        }
    }
}
项目:civcraft    文件:BonusGoodieManager.java   
@EventHandler(priority = EventPriority.MONITOR) 
public void OnItemSpawn(ItemSpawnEvent event) {
    Item item = event.getEntity();

    BonusGoodie goodie = CivGlobal.getBonusGoodie(item.getItemStack());
    if (goodie == null) {
        return;
    }

    // Cant validate here, validate in drop item events...
    goodie.setItem(item);
    try {
        goodie.update(false);
        goodie.updateLore(item.getItemStack());
    } catch (CivException e) {
        e.printStackTrace();
    }
}
项目:PlotSquared    文件:ChunkListener.java   
@EventHandler(priority = EventPriority.LOWEST)
public void onItemSpawn(ItemSpawnEvent event) {
    Item entity = event.getEntity();
    Chunk chunk = entity.getLocation().getChunk();
    if (chunk == this.lastChunk) {
        event.getEntity().remove();
        event.setCancelled(true);
        return;
    }
    if (!PS.get().hasPlotArea(chunk.getWorld().getName())) {
        return;
    }
    Entity[] entities = chunk.getEntities();
    if (entities.length > Settings.Chunk_Processor.MAX_ENTITIES) {
        event.getEntity().remove();
        event.setCancelled(true);
        this.lastChunk = chunk;
    } else {
        this.lastChunk = null;
    }
}
项目:ZentrelaRPG    文件:EnvironmentManager.java   
@EventHandler
public void onItemSpawn(ItemSpawnEvent e) {
    if (e.getEntity().getItemStack().getType() == Material.EGG) {
        if (e.getEntity().getVelocity().getY() * 10 == 2) {
            e.getEntity().remove();
        }
    }
}
项目:ProjectAres    文件:ItemDestroyMatchModule.java   
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void processItemRemoval(ItemSpawnEvent event) {
    final ItemStack item = event.getEntity().getItemStack();
    if(patterns.stream().anyMatch(pattern -> pattern.matches(item))) {
        event.setCancelled(true);
    }
}
项目:ProjectAres    文件:ItemModifyMatchModule.java   
@EventHandler
public void onItemSpawn(ItemSpawnEvent event) {
    ItemStack stack = event.getEntity().getItemStack();
    if(applyRules(stack)) {
        event.getEntity().setItemStack(stack);
    }
}
项目:SurvivalPlus    文件:WaterBowl.java   
@EventHandler
public void onDrop(ItemSpawnEvent event)
{
    if(event.isCancelled()) return;
    final Item itemDrop = event.getEntity();
    if(itemDrop.getItemStack().getType() == Material.BOWL)
    {
        final Runnable task = new Runnable()
        {
            public void run()
            {
                if(itemDrop.getItemStack().getAmount() != 1) return;
                Location itemLocation = itemDrop.getLocation();
                if(itemLocation.getBlock().getType() == Material.WATER || itemLocation.getBlock().getType() == Material.STATIONARY_WATER)
                {
                    itemDrop.remove();

                    ItemStack i_beetroot = new ItemStack(Material.BEETROOT_SOUP, 1);
                    ItemMeta beetrootMeta= i_beetroot.getItemMeta();
                    beetrootMeta.setDisplayName(ChatColor.RESET + Survival.instance.Words.get("Water Bowl"));
                    i_beetroot.setItemMeta(beetrootMeta);

                    itemDrop.getWorld().dropItem(itemLocation, i_beetroot);
                }
            }
        };

        Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Survival.instance, task, 20L);
    }
}
项目:SurvivalPlus    文件:LivingSlime.java   
@EventHandler
public void onGhastTearSlimeBlock(ItemSpawnEvent e)
{
    if(e.getEntityType() == EntityType.DROPPED_ITEM)
    {
        Item i = (Item)e.getEntity();
        switch(i.getItemStack().getType())
        {
            case GHAST_TEAR:
                Bukkit.getScheduler().runTaskLater(Survival.instance, initRunnable(i), 20);
                break;
            default:
        }
    }
}
项目:SurvivalAPI    文件:RapidUsefulModule.java   
/**
 * Drop some utilities
 *
 * @param event Event
 */
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM)
        return;

    if (Meta.hasMeta(event.getEntity().getItemStack()))
        return;

    ItemStack stack = event.getEntity().getItemStack();

    for (ItemStack drop : this.drops.keySet())
    {
        if (drop.getType() == stack.getType())
        {
            if (drop.getDurability() == -1 || (drop.getDurability() == stack.getDurability()))
            {
                ItemStack finalDrop = this.drops.get(drop).getDrop(stack, this.random);

                if (finalDrop == null)
                    event.setCancelled(true);
                else
                    event.getEntity().setItemStack(finalDrop);

                break;
            }
        }
    }
}
项目:SurvivalAPI    文件:NineSlotsModule.java   
/**
 * Remove barrier on drop
 *
 * @param event Event
 */
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM)
        return;

    if (event.getEntity().getItemStack().getType() == Material.BARRIER)
        event.setCancelled(true);
}
项目:SurvivalAPI    文件:WorldDropModule.java   
/**
 * Replace world's drop by custom ones
 *
 * @param event Event
 */
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM)
        return;

    if (Meta.hasMeta(event.getEntity().getItemStack()))
        return;

    if (!this.drops.containsKey(event.getEntity().getItemStack().getType()))
        return;

    event.getEntity().setItemStack(Meta.addMeta(this.drops.get(event.getEntity().getItemStack().getType())));
}
项目:SurvivalAPI    文件:TorchThanCoalModule.java   
/**
 * Replace coal by torch
 *
 * @param event Event
 */
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM)
        return;

    if (event.getEntity().hasMetadata("playerDrop"))
        return;

    if (event.getEntity().getItemStack().getType() == Material.COAL)
        event.getEntity().setItemStack(new ItemStack(Material.TORCH, (int) this.moduleConfiguration.get("torch")));
}
项目:FlexMC    文件:FlexWorld.java   
public FlexItem spawnItem( Location location, ItemStack itemStack ) {
    FlexItem item = new FlexItem( nextEntityId(), location, this );
    item.setItemStack( itemStack );
    if ( !EventFactory.call( new ItemSpawnEvent( item, location ) ).isCancelled() ) {
        this.addEntity( item, false );
    }
    return item;
}
项目:DragonEggDrop    文件:LootListeners.java   
@EventHandler
public void onItemSpawn(ItemSpawnEvent event) {
    Item item = event.getEntity();
    ItemStack stack = item.getItemStack();
    World world = item.getWorld();

    if (world.getEnvironment() != Environment.THE_END || stack.getType() != Material.DRAGON_EGG
            || stack.hasItemMeta()) return;

    DragonTemplate dragon = plugin.getDEDManager().getWorldWrapper(world).getActiveBattle();
    DragonLoot loot = dragon.getLoot();

    String eggName = loot.getEggName().replace("%dragon%", dragon.getName());
    List<String> eggLore = loot.getEggLore().stream()
            .map(s -> s.replace("%dragon%", dragon.getName()))
            .collect(Collectors.toList());

    ItemMeta eggMeta = stack.getItemMeta();

    if (eggName != null && !eggName.isEmpty()) {
        eggMeta.setDisplayName(eggName);
    }
    if (eggLore != null && !eggLore.isEmpty()) {
        eggMeta.setLore(eggLore);
    }

    stack.setItemMeta(eggMeta);
}
项目:KillerMoney    文件:MoneyHandler.java   
@EventHandler
public void onItemSpawn(ItemSpawnEvent e) {
    if (e.isCancelled()) {
        return;
    }

    Item item = e.getEntity();
    ItemStack is = item.getItemStack();

    if (isMoneyItem(is)) {
        item.setCustomName(is.getItemMeta().getDisplayName());
        item.setCustomNameVisible(true);
    }
}
项目:Cardinal    文件:ItemRemoveModule.java   
/**
 * Prevent items from spawning if they are in the item-remove tag in XML.
 *
 * @param event The event.
 */
@EventHandler(ignoreCancelled = true)
public void onItemSpawn(ItemSpawnEvent event) {
  Match match = Cardinal.getMatch(event.getWorld());
  MaterialData data = event.getEntity().getItemStack().getData();
  for (MaterialType type : materials.get(match)) {
    if (type.isType(data)) {
      event.setCancelled(true);
      break;
    }
  }
}
项目:ExilePearl    文件:PlayerListener.java   
/**
 * Track the location of a pearl if it spawns as an item for any reason
 * @param e The event args
 */
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onItemSpawn(ItemSpawnEvent e) {
    Item item = e.getEntity();

    ExilePearl pearl = pearlApi.getPearlFromItemStack(item.getItemStack());
    if (pearl == null) {
        return;
    }

    pearl.setHolder(item);
}
项目:ExilePearl    文件:PlayerListener.java   
/**
 * Removes the help item when dropped
 * @param e The event args
 */
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onHelpItemDrop(ItemSpawnEvent e) {
    if (isHelpItem(e.getEntity().getItemStack())) {
        e.setCancelled(true);
    }
}
项目:GriefPreventionPlus    文件:EntityEventHandler.java   
@EventHandler(priority = EventPriority.LOWEST)
public void onItemSpawn(ItemSpawnEvent event)
{
    //if in a creative world, cancel the event (don't drop items on the ground)
    if(GriefPrevention.instance.creativeRulesApply(event.getLocation()))
    {
        event.setCancelled(true);
    }
}
项目:vanillacraft    文件:GriefProtectListeners.java   
@EventHandler(priority = EventPriority.MONITOR)
public void onItemSpawn(ItemSpawnEvent event)
{
    if (!data.getChestCache().isChestListEmpty() && event.getEntity() instanceof Item )//&& plugin.worldSet.contains(event.getEntity().getWorld().getName()))
    {
        for (Loc loc : data.getChestCache().getChestList())
        {
            Location l = loc.toLocation();
            if (event.getEntity().getLocation().getWorld().getName().equals(l.getWorld().getName()) && l.distanceSquared(event.getEntity().getLocation()) < 4)
            {
                ((Item) event.getEntity()).setPickupDelay(20);
            }
        }
    }
}
项目:libelula    文件:EventManager.java   
@EventHandler(ignoreCancelled = true)
public void onItemSpawnEvent(ItemSpawnEvent e) {
    plugin.tm.onArmourDrop(e);
    if (!e.isCancelled()) {
        if (plugin.rm.isInGame(e.getEntity().getWorld())) {
            if (plugin.rm.isProhibited(e.getEntity())) {
                e.setCancelled(true);
            }
        }
    }
}
项目:libelula    文件:TeamManager.java   
public void onArmourDrop(ItemSpawnEvent e) {
    List<String> lore = e.getEntity().getItemStack().getItemMeta().getLore();
    if (lore == null) {
        return;
    }
    if (lore.contains(armourBrandName)) {
        e.setCancelled(true);
    }
}
项目:libelula    文件:EventManager.java   
@EventHandler(ignoreCancelled = true)
public void onItemSpawnEvent(ItemSpawnEvent e) {
    plugin.tm.onArmourDrop(e);
    if (!e.isCancelled()) {
        if (plugin.rm.isInGame(e.getEntity().getWorld())) {
            if (plugin.rm.isProhibited(e.getEntity())) {
                e.setCancelled(true);
            }
        }
    }
}
项目:libelula    文件:TeamManager.java   
public void onArmourDrop(ItemSpawnEvent e) {
    List<String> lore = e.getEntity().getItemStack().getItemMeta().getLore();
    if (lore == null) {
        return;
    }
    if (lore.contains(armourBrandName)) {
        e.setCancelled(true);
    }
}
项目:civcraft    文件:LoreCraftableMaterial.java   
@Override
public void onItemSpawn(ItemSpawnEvent event) {
    for (ItemComponent comp : this.components.values()) {
        comp.onItemSpawn(event);
    }

}
项目:HorseMount    文件:HorseMount.java   
@EventHandler
public void onItemSpawn(ItemSpawnEvent event) {
    if ((event.getEntity().getItemStack().getType() == Material.SADDLE || event.getEntity().getItemStack().getType() == Material.IRON_BARDING || event.getEntity().getItemStack().getType() == Material.GOLD_BARDING || event.getEntity().getItemStack().getType() == Material.DIAMOND_BARDING) && this.DisableItemDrops == true) {
        // Workaround to prevent saddle/armor drops due to bukkit bug
        if (event.getEntity().getVelocity().getY() == 0.20000000298023224) {
            event.setCancelled(true);
        }
    }
}
项目:Warzone    文件:ItemRemoveModule.java   
@EventHandler
public void onItemSpawn(ItemSpawnEvent event) {
    if (removed.contains(event.getEntity().getItemStack().getType())) {
        event.setCancelled(true);
    }
}
项目:Hub    文件:BalloonManager.java   
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntity().getItemStack() != null && event.getEntity().getItemStack().getType() == Material.LEASH)
        event.setCancelled(true);
}
项目:SurvivalAPI    文件:OptimizationListener.java   
/**
 * Concentrate stacks
 *
 * @param event Event
 */
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM)
        return;

    Item newEntity = event.getEntity();
    List<Entity> entityList = newEntity.getNearbyEntities(this.radius, 1, this.radius);
    int maxSize = newEntity.getItemStack().getMaxStackSize();

    for (Entity anEntityList : entityList)
    {
        if (anEntityList instanceof Item)
        {
            Item curEntity = (Item) anEntityList;

            if (!curEntity.isDead()
                    && curEntity.getItemStack().getType().equals(newEntity.getItemStack().getType())
                    && curEntity.getItemStack().getData().getData() == newEntity.getItemStack().getData().getData()
                    && curEntity.getItemStack().getDurability() == newEntity.getItemStack().getDurability()
                    && Math.abs(curEntity.getLocation().getX() - newEntity.getLocation().getX()) <= this.radius
                    && Math.abs(curEntity.getLocation().getY() - newEntity.getLocation().getY()) <= this.radius
                    && Math.abs(curEntity.getLocation().getZ() - newEntity.getLocation().getZ()) <= this.radius)
            {
                int newAmount = newEntity.getItemStack().getAmount();
                int curAmount = curEntity.getItemStack().getAmount();
                int more = Math.min(newAmount, maxSize - curAmount);

                curAmount += more;
                newAmount -= more;
                curEntity.getItemStack().setAmount(curAmount);
                newEntity.getItemStack().setAmount(newAmount);

                if (newAmount <= 0)
                    event.setCancelled(true);

                return;
            }
        }
    }
}
项目:NeverLag    文件:AntiNegativeItemDupe.java   
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onSpawn(ItemSpawnEvent e) {
    if (cm.isAntiNegativeItemDupe && e.getEntity() != null && e.getEntity().getItemStack() != null && e.getEntity().getItemStack().getAmount() <= 0) {
        e.setCancelled(true);
    }
}
项目:Arcade2    文件:MatchListeners.java   
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onItemSpawn(ItemSpawnEvent event) {
    if (this.isMatchIdle()) {
        event.setCancelled(true);
    }
}