Exemplo n.º 1
0
  public PainSpell(MagicConfig config, String spellName) {
    super(config, spellName);

    damage = getConfigFloat("damage", 4);
    spellDamageType = getConfigString("spell-damage-type", "");
    ignoreArmor = getConfigBoolean("ignore-armor", false);
    checkPlugins = getConfigBoolean("check-plugins", true);

    String type = getConfigString("damage-type", "ENTITY_ATTACK");
    for (DamageCause cause : DamageCause.values()) {
      if (cause.name().equalsIgnoreCase(type)) {
        damageType = cause;
        break;
      }
    }
    if (damageType == null) {
      damageType = DamageCause.ENTITY_ATTACK;
    }
  }
Exemplo n.º 2
0
  public ResistSpell(MagicConfig config, String spellName) {
    super(config, spellName);

    spellDamageTypes = getConfigStringList("spell-damage-types", null);
    List<String> list = getConfigStringList("normal-damage-types", null);
    multiplier = getConfigFloat("multiplier", 0.5F);

    if (list != null) {
      normalDamageTypes = new ArrayList<DamageCause>();
      for (String s : list) {
        for (DamageCause cause : DamageCause.values()) {
          if (cause.name().equalsIgnoreCase(s)) {
            normalDamageTypes.add(cause);
            break;
          }
        }
      }
      if (normalDamageTypes.size() == 0) normalDamageTypes = null;
    }
  }