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


Java PotionType.INSTANT_HEAL屬性代碼示例

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


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

示例1: potionTypeFromLegacy

private static PotionType potionTypeFromLegacy(PotionEffectType type) {
  if (type == PotionEffectType.NIGHT_VISION) {
    return PotionType.NIGHT_VISION;
  } else if (type == PotionEffectType.INVISIBILITY) {
    return PotionType.INVISIBILITY;
  } else if (type == PotionEffectType.JUMP) {
    return PotionType.JUMP;
  } else if (type == PotionEffectType.FIRE_RESISTANCE) {
    return PotionType.FIRE_RESISTANCE;
  } else if (type == PotionEffectType.SPEED) {
    return PotionType.SPEED;
  } else if (type == PotionEffectType.SLOW) {
    return PotionType.SLOWNESS;
  } else if (type == PotionEffectType.WATER_BREATHING) {
    return PotionType.WATER_BREATHING;
  } else if (type == PotionEffectType.HEALTH_BOOST) {
    return PotionType.INSTANT_HEAL;
  } else if (type == PotionEffectType.HARM) {
    return PotionType.INSTANT_DAMAGE;
  } else if (type == PotionEffectType.HARM) {
    return PotionType.INSTANT_DAMAGE;
  } else if (type == PotionEffectType.POISON) {
    return PotionType.POISON;
  } else if (type == PotionEffectType.REGENERATION) {
    return PotionType.REGEN;
  } else if (type == PotionEffectType.INCREASE_DAMAGE) {
    return PotionType.STRENGTH;
  } else if (type == PotionEffectType.WEAKNESS) {
    return PotionType.WEAKNESS;
  } else if (type == PotionEffectType.LUCK) {
    return PotionType.LUCK;
  } else {
    throw new IllegalArgumentException(type.getName() + " is not convertable.");
  }
}
 
開發者ID:SupaHam,項目名稱:SupaCommons,代碼行數:35,代碼來源:ItemBuilder.java

示例2: getPotionType

public static PotionType getPotionType(String name) {
	if (name != null) {
		for (PotionType potionType : PotionType.values()) {
			if (potionType != null && potionType.name().equals(name)) return potionType;
		}
		switch (name) {
			case "FATIGUE":
				return PotionType.WEAKNESS;
			case "HARM":
			case "HARMING":
			case "DAMAGE":
				return PotionType.INSTANT_DAMAGE;
			case "HEAL":
			case "HEALTH":
			case "HEALING":
				return PotionType.INSTANT_HEAL;
			case "LEAP":
			case "LEAPING":
				return PotionType.JUMP;
			case "REGENERATION":
				return PotionType.REGEN;
			case "SLOW":
				return PotionType.SLOWNESS;
		}
	}
	return null;
}
 
開發者ID:KingFaris10,項目名稱:KingKits,代碼行數:27,代碼來源:Utilities.java

示例3: getType

private PotionType getType(String substring) {
	if(substring.equals("BREAT")) return PotionType.WATER_BREATHING;//例外
	else if(substring.equals("HEAL")) return PotionType.INSTANT_HEAL;
	else if(substring.equals("DAMAG")) return PotionType.INSTANT_HEAL;
       else{ //後ろ切れてるかも
           for(PotionType p : PotionType.values()) {
               if(p.toString().startsWith(substring)) return p;
           }
       }
	return null;
}
 
開發者ID:wackyls6,項目名稱:StorageSign,代碼行數:11,代碼來源:PotionInfo.java

示例4: getShortType

public static String getShortType(PotionType pot){
	if(pot == PotionType.WATER_BREATHING) return "BREAT";
	else if(pot == PotionType.INSTANT_HEAL) return "HEAL";
	else if(pot == PotionType.INSTANT_DAMAGE) return "DAMAG";
	else if(pot.toString().length() <= 5) return pot.toString();
	return pot.toString().substring(0, 5);
}
 
開發者ID:wackyls6,項目名稱:StorageSign,代碼行數:7,代碼來源:PotionInfo.java

示例5: setPotion

@Override
public ItemStack setPotion(Material itemMaterial, Tag itemTags,
        ItemStack chestItem) {
    // Try some backwards compatibility with new 1.9 schematics
    Map<String,Tag> cont = (Map<String,Tag>) ((CompoundTag) itemTags).getValue();
    if (cont != null) {
        if (((CompoundTag) itemTags).getValue().containsKey("tag")) {
            Map<String,Tag> contents = (Map<String,Tag>)((CompoundTag) itemTags).getValue().get("tag").getValue();
            StringTag stringTag = ((StringTag)contents.get("Potion"));
            if (stringTag != null) {
                String tag = stringTag.getValue().replace("minecraft:", "");
                PotionType type = null;
                boolean strong = tag.contains("strong");
                boolean _long = tag.contains("long");
                //Bukkit.getLogger().info("tag = " + tag);
                if(tag.equals("fire_resistance") || tag.equals("long_fire_resistance")){
                    type = PotionType.FIRE_RESISTANCE;
                }else if(tag.equals("harming") || tag.equals("strong_harming")){
                    type = PotionType.INSTANT_DAMAGE;
                }else if(tag.equals("healing") || tag.equals("strong_healing")){
                    type = PotionType.INSTANT_HEAL;
                }else if(tag.equals("invisibility") || tag.equals("long_invisibility")){
                    type = PotionType.INVISIBILITY;
                }else if(tag.equals("leaping") || tag.equals("long_leaping") || tag.equals("strong_leaping")){
                    type = PotionType.JUMP;
                }else if(tag.equals("night_vision") || tag.equals("long_night_vision")){
                    type = PotionType.NIGHT_VISION;
                }else if(tag.equals("poison") || tag.equals("long_poison") || tag.equals("strong_poison")){
                    type = PotionType.POISON;
                }else if(tag.equals("regeneration") || tag.equals("long_regeneration") || tag.equals("strong_regeneration")){
                    type = PotionType.REGEN;
                }else if(tag.equals("slowness") || tag.equals("long_slowness")){
                    type = PotionType.SLOWNESS;
                }else if(tag.equals("swiftness") || tag.equals("long_swiftness") || tag.equals("strong_swiftness")){
                    type = PotionType.SPEED;
                }else if(tag.equals("strength") || tag.equals("long_strength") || tag.equals("strong_strength")){
                    type = PotionType.STRENGTH;
                }else if(tag.equals("water_breathing") || tag.equals("long_water_breathing")){
                    type = PotionType.WATER_BREATHING;
                }else if(tag.equals("water")){
                    type = PotionType.WATER;
                }else if(tag.equals("weakness") || tag.equals("long_weakness")){
                    type = PotionType.WEAKNESS;
                }else{
                    return chestItem;
                }
                Potion potion = new Potion(type);
                potion.setHasExtendedDuration(_long);
                potion.setLevel(strong ? 2 : 1);
                chestItem = potion.toItemStack(chestItem.getAmount());
            }
        }
    }

    return chestItem;
}
 
開發者ID:tastybento,項目名稱:acidisland,代碼行數:56,代碼來源:NMSHandler.java

示例6: setPotion

@SuppressWarnings("deprecation")
@Override
public ItemStack setPotion(Material itemMaterial, Tag itemTags,
        ItemStack chestItem) {
    // Try some backwards compatibility with new 1.9 schematics
    Map<String,Tag> contents = (Map<String,Tag>) ((CompoundTag) itemTags).getValue().get("tag").getValue();
    StringTag stringTag = ((StringTag)contents.get("Potion"));
    if (stringTag != null) {
        String tag = stringTag.getValue().replace("minecraft:", "");
        PotionType type = null;
        boolean strong = tag.contains("strong");
        boolean _long = tag.contains("long");
        //Bukkit.getLogger().info("tag = " + tag);
        if(tag.equals("fire_resistance") || tag.equals("long_fire_resistance")){
            type = PotionType.FIRE_RESISTANCE;
        }else if(tag.equals("harming") || tag.equals("strong_harming")){
            type = PotionType.INSTANT_DAMAGE;
        }else if(tag.equals("healing") || tag.equals("strong_healing")){
            type = PotionType.INSTANT_HEAL;
        }else if(tag.equals("invisibility") || tag.equals("long_invisibility")){
            type = PotionType.INVISIBILITY;
        }else if(tag.equals("leaping") || tag.equals("long_leaping") || tag.equals("strong_leaping")){
            type = PotionType.JUMP;
        }else if(tag.equals("night_vision") || tag.equals("long_night_vision")){
            type = PotionType.NIGHT_VISION;
        }else if(tag.equals("poison") || tag.equals("long_poison") || tag.equals("strong_poison")){
            type = PotionType.POISON;
        }else if(tag.equals("regeneration") || tag.equals("long_regeneration") || tag.equals("strong_regeneration")){
            type = PotionType.REGEN;
        }else if(tag.equals("slowness") || tag.equals("long_slowness")){
            type = PotionType.SLOWNESS;
        }else if(tag.equals("swiftness") || tag.equals("long_swiftness") || tag.equals("strong_swiftness")){
            type = PotionType.SPEED;
        }else if(tag.equals("strength") || tag.equals("long_strength") || tag.equals("strong_strength")){
            type = PotionType.STRENGTH;
        }else if(tag.equals("water_breathing") || tag.equals("long_water_breathing")){
            type = PotionType.WATER_BREATHING;
        }else if(tag.equals("water")){
            type = PotionType.WATER;
        }else if(tag.equals("weakness") || tag.equals("long_weakness")){
            type = PotionType.WEAKNESS;
        }else{
            return chestItem;
        }
        Potion potion = new Potion(type);
        potion.setHasExtendedDuration(_long);
        potion.setLevel(strong ? 2 : 1);
        chestItem = potion.toItemStack(chestItem.getAmount());
    }

    return chestItem;
}
 
開發者ID:tastybento,項目名稱:acidisland,代碼行數:52,代碼來源:NMSHandler.java

示例7: getPotionType

public static PotionType getPotionType(ItemMeta meta) {
	
	String string = meta.toString();
	
	if(string.contains("water")) {
		return PotionType.WATER;
	}
	else if(string.contains("mundane")) {
		return PotionType.MUNDANE;
	}
	else if(string.contains("thick")) {
		return PotionType.THICK;
	}
	else if(string.contains("awkward")) {
		return PotionType.AWKWARD;
	}
	else if(string.contains("night_vision")) {
		return PotionType.NIGHT_VISION;
	}
	else if(string.contains("invisibility")) {
		return PotionType.INVISIBILITY;
	}
	else if(string.contains("leaping")) {
		return PotionType.JUMP;
	}
	else if(string.contains("fire_resistance")) {
		return PotionType.FIRE_RESISTANCE;
	}
	else if(string.contains("swiftness")) {
		return PotionType.SPEED;
	}
	else if(string.contains("slowness")) {
		return PotionType.SLOWNESS;
	}
	else if(string.contains("water_breathing")) {
		return PotionType.WATER_BREATHING;
	}
	else if(string.contains("healing")) {
		return PotionType.INSTANT_HEAL;
	}
	else if(string.contains("harming")) {
		return PotionType.INSTANT_DAMAGE;
	}
	else if(string.contains("poison")) {
		return PotionType.POISON;
	}
	else if(string.contains("regeneration")) {
		return PotionType.REGEN;
	}
	else if(string.contains("strength")) {
		return PotionType.STRENGTH;
	}
	else if(string.contains("weakness")) {
		return PotionType.WEAKNESS;
	}
	else if(string.contains("luck")) {
		return PotionType.LUCK;
	}
	else if(string.contains("empty")) {
		return PotionType.UNCRAFTABLE;
	}
	
	return PotionType.AWKWARD;
}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:64,代碼來源:TowerGUI.java

示例8: PotionInfo

public PotionInfo(Material mat, String[] str){
	this.mat = mat;
	if(str.length == 2){//ダメージ値
		short old = NumberConversions.toShort(str[1]);
		if(old >= 16384) this.mat = Material.SPLASH_POTION;
		switch(old % 16){
		case 1:
			pot = PotionType.REGEN;
		    break;
		case 2:
			pot = PotionType.SPEED;
		    break;
		case 3:
			pot = PotionType.FIRE_RESISTANCE;
		    break;
		case 4:
			pot = PotionType.POISON;
		    break;
		case 5:
			pot = PotionType.INSTANT_HEAL;
		    break;
		case 6:
			pot = PotionType.NIGHT_VISION;
		    break;
		case 8:
			pot = PotionType.WEAKNESS;
		    break;
		case 9:
			pot = PotionType.STRENGTH;
		    break;
		case 10:
			pot = PotionType.SLOWNESS;
		    break;
		case 11:
			pot = PotionType.JUMP;
		    break;
		case 12:
			pot = PotionType.INSTANT_DAMAGE;
		    break;
		case 13:
			pot = PotionType.WATER_BREATHING;
			break;
		case 14:
			pot = PotionType.INVISIBILITY;
			break;

		default:
			if(old == 16) pot = PotionType.AWKWARD;
			else if(old == 32) pot = PotionType.THICK;
			else if(old == 64 || old == 8192 || old == 16384) pot = PotionType.MUNDANE;
			else pot = PotionType.WATER;
		}

		if(old % 8192 > 64 && pot.isExtendable()) damage = 1;//延長
		else if(old % 64 > 32 && pot.isUpgradeable()) damage = 2;//強化

	}else if(str.length == 1) pot = PotionType.WATER;

	else{
		pot = getType(str[1]);
		damage = NumberConversions.toShort(str[2]);
	}
}
 
開發者ID:wackyls6,項目名稱:StorageSign,代碼行數:63,代碼來源:PotionInfo.java


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