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


Java LingeringPotionSplashEvent类代码示例

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


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

示例1: onLingeringPotionSplash

import org.bukkit.event.entity.LingeringPotionSplashEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOW, ignoreCancelled=true)
public void onLingeringPotionSplash(final LingeringPotionSplashEvent e) {
    if (DEBUG) {
        plugin.getLogger().info("1.9 " + e.getEventName());
        plugin.getLogger().info("1.9 entity = " + e.getEntity());
        plugin.getLogger().info("1.9 entity type = " + e.getEntityType());
        plugin.getLogger().info("1.9 radius = " + e.getAreaEffectCloud().getRadius());
        plugin.getLogger().info("1.9 id = " + e.getAreaEffectCloud().getEntityId());
        plugin.getLogger().info("1.9 hit entity = " + e.getHitEntity());
    }
    if (!Util.inWorld(e.getEntity().getLocation())) {
        return;
    }
    // Try to get the shooter
    Projectile projectile = e.getEntity();
    plugin.getLogger().info("shooter = " + projectile.getShooter());
    if (projectile.getShooter() != null && projectile.getShooter() instanceof Player) {
        UUID uuid = ((Player)projectile.getShooter()).getUniqueId();
        // Store it and remove it when the effect is gone
        thrownPotions.put(e.getAreaEffectCloud().getEntityId(), uuid);
        plugin.getServer().getScheduler().runTaskLater(plugin, () -> thrownPotions.remove(e.getAreaEffectCloud().getEntityId()), e.getAreaEffectCloud().getDuration());
    }
}
 
开发者ID:tastybento,项目名称:bskyblock,代码行数:24,代码来源:IslandGuard1_9.java

示例2: onLingerPotion

import org.bukkit.event.entity.LingeringPotionSplashEvent; //导入依赖的package包/类
@EventHandler
public void onLingerPotion(LingeringPotionSplashEvent e){
	if (!(e.getEntity().getShooter() instanceof Player)){
   		return;
   	}
   	
   	Player p = (Player)e.getEntity().getShooter();
   	Entity ent = e.getEntity();
   	
   	RedProtect.get().logger.debug("Is LingeringPotionSplashEvent event.");
       
   	Region r = RedProtect.get().rm.getTopRegion(ent.getLocation());
   	if (r != null && !r.allowEffects(p)){
   		RPLang.sendMessage(p, "playerlistener.region.cantuse");
   		e.setCancelled(true);
   		return;
   	}    
   	
   	if (RPUtil.denyPotion(e.getEntity().getItem())){
   		e.setCancelled(true);
		if (e.getEntity().getShooter() instanceof Player){
			RPLang.sendMessage((Player)e.getEntity().getShooter(), RPLang.get("playerlistener.denypotion"));
		}
   	}
}
 
开发者ID:FabioZumbi12,项目名称:RedProtect,代码行数:26,代码来源:RPMine19.java

示例3: check

import org.bukkit.event.entity.LingeringPotionSplashEvent; //导入依赖的package包/类
@SuppressWarnings("SimplifiableIfStatement")
@Override
public boolean check(Event event) {
	if (event instanceof LingeringPotionSplashEvent) {
		if (effectTypes != null && effectTypes.getArray().length > 0) {
			return ((LingeringPotionSplashEvent) event).getEntity()
													   .getEffects()
													   .containsAll(Arrays.asList(effectTypes.getArray()));
		}
		return true;
	}
	return false;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:14,代码来源:EvtLingeringPotionSplash.java

示例4: onPlayerThrowLingeringPotion

import org.bukkit.event.entity.LingeringPotionSplashEvent; //导入依赖的package包/类
/**
 * Prevent exiled players from using lingering splash potions
 * @param e The event
 */
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerThrowLingeringPotion(LingeringPotionSplashEvent e) {
	if(e.getEntity() != null && e.getEntity().getShooter() instanceof Player) {
		checkAndCancelRule(ExileRule.USE_POTIONS, e, (Player)e.getEntity().getShooter());
	}
}
 
开发者ID:DevotedMC,项目名称:ExilePearl,代码行数:11,代码来源:ExileListener.java

示例5: onLingeringPotionSplash

import org.bukkit.event.entity.LingeringPotionSplashEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOW, ignoreCancelled=true)
public void onLingeringPotionSplash(final LingeringPotionSplashEvent e) {
    if (DEBUG) {
        plugin.getLogger().info("1.9 " + e.getEventName());
        plugin.getLogger().info("1.9 entity = " + e.getEntity());
        plugin.getLogger().info("1.9 entity type = " + e.getEntityType());
        plugin.getLogger().info("1.9 radius = " + e.getAreaEffectCloud().getRadius());
        plugin.getLogger().info("1.9 id = " + e.getAreaEffectCloud().getEntityId());
        plugin.getLogger().info("1.9 hit entity = " + e.getHitEntity());
    }
    if (!IslandGuard.inWorld(e.getEntity().getLocation())) {
        return;
    }
    // Try to get the shooter
    Projectile projectile = (Projectile) e.getEntity();
    if (DEBUG)
        plugin.getLogger().info("shooter = " + projectile.getShooter());
    if (projectile.getShooter() != null && projectile.getShooter() instanceof Player) {
        UUID uuid = ((Player)projectile.getShooter()).getUniqueId();
        // Store it and remove it when the effect is gone
        thrownPotions.put(e.getAreaEffectCloud().getEntityId(), uuid);
        plugin.getServer().getScheduler().runTaskLater(plugin, new Runnable() {

            @Override
            public void run() {
                if (DEBUG)
                    plugin.getLogger().info("DEBUG: Effect finished");
                thrownPotions.remove(e.getAreaEffectCloud().getEntityId());

            }}, e.getAreaEffectCloud().getDuration());
    }
}
 
开发者ID:tastybento,项目名称:acidisland,代码行数:33,代码来源:IslandGuard1_9.java

示例6: onPotionSplash

import org.bukkit.event.entity.LingeringPotionSplashEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPotionSplash(LingeringPotionSplashEvent event) {
    LingeringPotion entity = event.getEntity();
    Location l = BukkitUtil.getLocation(entity);
    if (!PS.get().hasPlotArea(l.getWorld())) {
        return;
    }
    if (!parent.onProjectileHit(event)) {
        event.setCancelled(true);
    }
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:12,代码来源:PlayerEvents_1_9.java


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