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

项目:ZentrelaRPG    文件:DropManager.java   
@EventHandler
public void onItemMerge(ItemMergeEvent event) {
    if (event.getEntity().hasMetadata(RMetadata.META_NO_PICKUP) || event.getTarget().hasMetadata(RMetadata.META_NO_PICKUP)) {
        event.setCancelled(true);
        return;
    }
    removeLabel(event.getEntity());
}
项目:NyaaUtils    文件:DropProtectListener.java   
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onItemMerge(ItemMergeEvent e) {
    if (plugin.cfg.dropProtectMode == DropProtectMode.OFF) return;
    Item ent = e.getEntity();
    Item target = e.getTarget();
    if (items.getIfPresent(ent.getEntityId()) != null && items.getIfPresent(target.getEntityId()) == null) {
        items.put(target.getEntityId(), items.getIfPresent(ent.getEntityId()));
    } else if (items.getIfPresent(ent.getEntityId()) == null && items.getIfPresent(target.getEntityId()) != null) {
        items.put(target.getEntityId(), items.getIfPresent(target.getEntityId()));//Refresh
    } else if (items.getIfPresent(ent.getEntityId()) != null && items.getIfPresent(target.getEntityId()) != null && items.getIfPresent(ent.getEntityId()) != items.getIfPresent(target.getEntityId())) {
        e.setCancelled(true);
    }
}
项目:Pore    文件:PoreItemMergeEvent.java   
public PoreItemMergeEvent(org.spongepowered.api.event.inventory.ItemMergeEvent handle) {
    super(null, null);
    this.handle = checkNotNull(handle, "handle");
}
项目:Pore    文件:PoreItemMergeEvent.java   
public org.spongepowered.api.event.inventory.ItemMergeEvent getHandle() {
    return handle;
}