/** @return Returns in textual form the health of the reinforcement. */ public String getHealthText() { double health = getHealth(); if (CitadelConfigManager.showHealthAsPercent()) { return health * 100 + "%"; } else { if (health > 0.75) { return "excellently"; } else if (health > 0.50) { return "well"; } else if (health > 0.25) { return "decently"; } else { return "poorly"; } } }
public static void initializeReinforcementTypes() { List<String> types = CitadelConfigManager.getReinforcementTypes(); for (String type : types) { Material mat = CitadelConfigManager.getMaterial(type); int amount = CitadelConfigManager.getRequireMents(type); int percentReturn = CitadelConfigManager.getPercentReturn(type); int returnValue = CitadelConfigManager.getReturns(type); int hitpoints = CitadelConfigManager.getHitPoints(type); int maturation = CitadelConfigManager.getMaturationTime(type); int acid = CitadelConfigManager.getAcidTime(type); int maturation_scale = CitadelConfigManager.getMaturationScale(type); List<String> lore = CitadelConfigManager.getLoreValues(type); ReinforcementEffect effect = CitadelConfigManager.getReinforcementEffect(type); List<String> reinforceableMatString = CitadelConfigManager.getReinforceableMaterials(type); Set<Material> reinforceableMats = CitadelConfigManager.parseMaterialList(reinforceableMatString); List<String> unreinforceableMatString = CitadelConfigManager.getNonReinforceableMaterials(type); Set<Material> nonReinforceableMats = CitadelConfigManager.parseMaterialList(unreinforceableMatString); new ReinforcementType( mat, amount, percentReturn, returnValue, hitpoints, maturation, acid, maturation_scale, lore, effect, reinforceableMats, nonReinforceableMats); if (CitadelConfigManager.shouldLogInternal()) { Citadel.getInstance() .getLogger() .log( Level.INFO, "Adding Reinforcement {0} with:\n material {1} \n amount {2} " + "\n return rate {3} \n return? {4} \n health {5} \n maturation {6} " + "\n acid {7} \n scaling {8} \n lore: {9} \n effect: \n {10}", new Object[] { type, mat.toString(), amount, percentReturn, returnValue, hitpoints, maturation, acid, maturation_scale, (lore != null ? String.join(" ", lore) : ""), (effect != null ? effect : "") }); } } }