mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Merge pull request #57
Fixed a NPE and added a simple rarity placeholder
This commit is contained in:
commit
828557e5e1
@ -9,6 +9,7 @@ import com.willfp.eco.util.StringUtils;
|
||||
import com.willfp.ecoenchants.display.EnchantmentCache;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentRarity;
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -139,12 +140,14 @@ public class CommandEnchantinfo extends PluginCommand {
|
||||
|
||||
final String finalName = EnchantmentCache.getEntry(enchantment).getName();
|
||||
final String finalDescription = EnchantmentCache.getEntry(enchantment).getStringDescription(1);
|
||||
final EnchantmentRarity finalRarity = enchantment.getRarity();
|
||||
final String finalTargets = allTargets;
|
||||
final String finalConflicts = allConflicts;
|
||||
final String finalMaxLevel = maxLevel;
|
||||
Arrays.asList(this.getPlugin().getLangYml().getMessage("enchantinfo").split("\\r?\\n")).forEach((string -> {
|
||||
string = string.replace("%name%", finalName)
|
||||
.replace("%description%", finalDescription)
|
||||
.replace("%rarity%", finalRarity.getName())
|
||||
.replace("%target%", finalTargets)
|
||||
.replace("%conflicts%", finalConflicts)
|
||||
.replace("%maxlevel%", finalMaxLevel);
|
||||
|
@ -13,6 +13,7 @@ messages:
|
||||
not-found: "&cCannot find an enchantment matching name: &f%name%."
|
||||
enchantinfo: |
|
||||
%name%: &r%description%
|
||||
&9Rarity: &r%rarity%
|
||||
&9Max Level: &r%maxlevel%
|
||||
&9Can be applied to: &r%target%
|
||||
&9Conflicts with: &r%conflicts%
|
||||
|
@ -26,7 +26,7 @@ general-config:
|
||||
list: []
|
||||
not-met-lore: []
|
||||
conflicts:
|
||||
- altitide
|
||||
- altitude
|
||||
- aquamarine
|
||||
- dehydration
|
||||
- rainforest
|
||||
|
Loading…
Reference in New Issue
Block a user