當前位置: 首頁>>代碼示例>>Java>>正文


Java PotionEffectType.FAST_DIGGING屬性代碼示例

本文整理匯總了Java中org.bukkit.potion.PotionEffectType.FAST_DIGGING屬性的典型用法代碼示例。如果您正苦於以下問題:Java PotionEffectType.FAST_DIGGING屬性的具體用法?Java PotionEffectType.FAST_DIGGING怎麽用?Java PotionEffectType.FAST_DIGGING使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.bukkit.potion.PotionEffectType的用法示例。


在下文中一共展示了PotionEffectType.FAST_DIGGING屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: 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.FAST_DIGGING屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。