本文整理汇总了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;
}
}
}
示例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);
}
}
示例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());
}
示例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;
}
}
}
}
示例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());
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
示例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);
}
示例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");
}
}
示例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);
}
示例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();
}
}
示例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);
}
}
示例14: ShearFinder
import org.bukkit.event.entity.ItemDespawnEvent; //导入依赖的package包/类
public ShearFinder() {
super(ItemDespawnEvent.getHandlerList());
}
示例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()));
}