当前位置: 首页>>代码示例>>Java>>正文


Java ItemDespawnEvent类代码示例

本文整理汇总了Java中org.bukkit.event.entity.ItemDespawnEvent的典型用法代码示例。如果您正苦于以下问题:Java ItemDespawnEvent类的具体用法?Java ItemDespawnEvent怎么用?Java ItemDespawnEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ItemDespawnEvent类属于org.bukkit.event.entity包,在下文中一共展示了ItemDespawnEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: itemKillEvent

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@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;
		}
	}
}
 
开发者ID:tatanpoker09,项目名称:TCMinigames,代码行数:19,代码来源:EntityListener.java

示例2: handle

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:Dytanic,项目名称:CloudNet,代码行数:16,代码来源:ArmorStandListener.java

示例3: onItemDespawn

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@EventHandler
public void onItemDespawn(ItemDespawnEvent event) {
    if (event.getEntity().hasMetadata(RMetadata.META_NO_PICKUP)) {
        event.setCancelled(true);
        return;
    }
    removeLabel(event.getEntity());
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:9,代码来源:DropManager.java

示例4: onDespawn

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@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;
			}
		}
	}
}
 
开发者ID:mcardy,项目名称:MystiCraft,代码行数:14,代码来源:CraftingManager.java

示例5: onItemDespawnEvent

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@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());
    }
}
 
开发者ID:Shynixn,项目名称:BlockBall,代码行数:8,代码来源:GameListener.java

示例6: onItemDespawn

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:NyaaCat,项目名称:NyaaUtils,代码行数:9,代码来源:DropProtectListener.java

示例7: onItemDespawn

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
/**
 * 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());
	}
}
 
开发者ID:DevotedMC,项目名称:ExilePearl,代码行数:13,代码来源:PlayerListener.java

示例8: onItemDespawn

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@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);
}
 
开发者ID:frostythedev,项目名称:COD-Warfare,代码行数:9,代码来源:Listeners.java

示例9: onItemDespawn

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@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);	
}
 
开发者ID:netizen539,项目名称:civcraft,代码行数:10,代码来源:BonusGoodieManager.java

示例10: onDropsDespawn

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
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");
	}
}
 
开发者ID:Esaych,项目名称:DDCustomPlugin,代码行数:8,代码来源:DirectionBook.java

示例11: onItemDespawn

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@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);
}
 
开发者ID:JCThePants,项目名称:NucleusFramework,代码行数:11,代码来源:BukkitListener.java

示例12: onItemDespawn

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@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();
	}
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:8,代码来源:BackpackDespawningEvent.java

示例13: itemDespawnItem

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@EventHandler
private void itemDespawnItem(ItemDespawnEvent event) {
	CustomItem customItem = CustomItemManager.getCustomItem(event.getEntity().getItemStack());
	if (verifyCustomItem(customItem, event.getEntity().getWorld())) {
		customItem.onDespawn(event);
	}
}
 
开发者ID:goncalomb,项目名称:NBTEditor,代码行数:8,代码来源:CustomItemListener.java

示例14: ShearFinder

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
public ShearFinder() {
    super(ItemDespawnEvent.getHandlerList());
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:4,代码来源:ShearFinder.java

示例15: onItemDespawn

import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
@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()));
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:5,代码来源:ShearFinder.java


注:本文中的org.bukkit.event.entity.ItemDespawnEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。