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


Java PotionEffectType.SPEED属性代码示例

本文整理汇总了Java中org.bukkit.potion.PotionEffectType.SPEED属性的典型用法代码示例。如果您正苦于以下问题:Java PotionEffectType.SPEED属性的具体用法?Java PotionEffectType.SPEED怎么用?Java PotionEffectType.SPEED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.potion.PotionEffectType的用法示例。


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

示例1: onPreStart

@Override
public void onPreStart() {
    Location spawnLocation = Utils.parseLocation((String) this.getGameMap().fetchSetting("startPosition"));
    PotionEffect potionEffect = new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 199);
    PotionEffect potionEffect2 = new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 2);
    for(Player player : Bukkit.getOnlinePlayers()) {
        if(!this.getAPI().getGameManager().isAlive(player)) continue;
        player.teleport(spawnLocation);
        player.setGameMode(GameMode.ADVENTURE);
        player.addPotionEffect(potionEffect, true);
        player.addPotionEffect(potionEffect2, true);
    }
}
 
开发者ID:ArcadiaPlugins,项目名称:Arcadia-Spigot,代码行数:13,代码来源:DeadEndGame.java

示例2: getPotionType

private static PotionEffectType getPotionType(String type) {
	switch (type.toLowerCase()) {
	case "speed": return PotionEffectType.SPEED;
	case "slowness": return PotionEffectType.SLOW;
	case "haste": return PotionEffectType.FAST_DIGGING;
	case "miningfatique": return PotionEffectType.SLOW_DIGGING;
	case "strength": return PotionEffectType.INCREASE_DAMAGE;
	case "instanthealth": return PotionEffectType.HEAL;
	case "instantdamage": return PotionEffectType.HARM;
	case "jumpboost": return PotionEffectType.JUMP;
	case "nausea": return PotionEffectType.CONFUSION;
	case "regeneration": return PotionEffectType.REGENERATION;
	case "resistance": return PotionEffectType.DAMAGE_RESISTANCE;
	case "fireresistance": return PotionEffectType.FIRE_RESISTANCE;
	case "waterbreathing": return PotionEffectType.WATER_BREATHING;
	case "invisibility": return PotionEffectType.INVISIBILITY;
	case "blindness": return PotionEffectType.BLINDNESS;
	case "nightvision": return PotionEffectType.NIGHT_VISION;
	case "hunger": return PotionEffectType.HUNGER;
	case "weakness": return PotionEffectType.WEAKNESS;
	case "poison": return PotionEffectType.POISON;
	case "wither": return PotionEffectType.WITHER;
	case "healthboost": return PotionEffectType.HEALTH_BOOST;
	case "absorption": return PotionEffectType.ABSORPTION;
	case "saturation": return PotionEffectType.SATURATION;
	default: return null;	
	}
}
 
开发者ID:smessie,项目名称:SkyWarsReloaded,代码行数:28,代码来源:ItemUtils.java

示例3: handleTimedEffects

/**
 * Adding potion effects to ability items
 * @param player The player
 * @param item The item with ability
 */
private void handleTimedEffects(Player player, ItemStack item) {
	if(item == null)
		return;
	
	if(!plugin.getAbilityManager().hasAbility(item))
		return;
	
	Ability ability = plugin.getAbilityManager().getAbility(item);
	
	PotionEffectType type;
	switch(ability.getName()) {
		case "Haste":
			type = PotionEffectType.FAST_DIGGING;
			break;
		case "High Jump":
			type = PotionEffectType.JUMP;
			break;
		case "Speed":
			type = PotionEffectType.SPEED;
			break;
		default:
			return;
	}
	if(player.hasPotionEffect(type)) {
		player.removePotionEffect(type);
	}
	player.addPotionEffect(new PotionEffect(type, 60, 1));
}
 
开发者ID:benNek,项目名称:AsgardAscension,代码行数:33,代码来源:AbilityManager.java


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