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.display.EnchantmentCache;
|
||||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||||
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||||
|
import com.willfp.ecoenchants.enchantments.meta.EnchantmentRarity;
|
||||||
import org.apache.commons.lang.WordUtils;
|
import org.apache.commons.lang.WordUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -139,12 +140,14 @@ public class CommandEnchantinfo extends PluginCommand {
|
|||||||
|
|
||||||
final String finalName = EnchantmentCache.getEntry(enchantment).getName();
|
final String finalName = EnchantmentCache.getEntry(enchantment).getName();
|
||||||
final String finalDescription = EnchantmentCache.getEntry(enchantment).getStringDescription(1);
|
final String finalDescription = EnchantmentCache.getEntry(enchantment).getStringDescription(1);
|
||||||
|
final EnchantmentRarity finalRarity = enchantment.getRarity();
|
||||||
final String finalTargets = allTargets;
|
final String finalTargets = allTargets;
|
||||||
final String finalConflicts = allConflicts;
|
final String finalConflicts = allConflicts;
|
||||||
final String finalMaxLevel = maxLevel;
|
final String finalMaxLevel = maxLevel;
|
||||||
Arrays.asList(this.getPlugin().getLangYml().getMessage("enchantinfo").split("\\r?\\n")).forEach((string -> {
|
Arrays.asList(this.getPlugin().getLangYml().getMessage("enchantinfo").split("\\r?\\n")).forEach((string -> {
|
||||||
string = string.replace("%name%", finalName)
|
string = string.replace("%name%", finalName)
|
||||||
.replace("%description%", finalDescription)
|
.replace("%description%", finalDescription)
|
||||||
|
.replace("%rarity%", finalRarity.getName())
|
||||||
.replace("%target%", finalTargets)
|
.replace("%target%", finalTargets)
|
||||||
.replace("%conflicts%", finalConflicts)
|
.replace("%conflicts%", finalConflicts)
|
||||||
.replace("%maxlevel%", finalMaxLevel);
|
.replace("%maxlevel%", finalMaxLevel);
|
||||||
|
@ -13,6 +13,7 @@ messages:
|
|||||||
not-found: "&cCannot find an enchantment matching name: &f%name%."
|
not-found: "&cCannot find an enchantment matching name: &f%name%."
|
||||||
enchantinfo: |
|
enchantinfo: |
|
||||||
%name%: &r%description%
|
%name%: &r%description%
|
||||||
|
&9Rarity: &r%rarity%
|
||||||
&9Max Level: &r%maxlevel%
|
&9Max Level: &r%maxlevel%
|
||||||
&9Can be applied to: &r%target%
|
&9Can be applied to: &r%target%
|
||||||
&9Conflicts with: &r%conflicts%
|
&9Conflicts with: &r%conflicts%
|
||||||
|
@ -26,7 +26,7 @@ general-config:
|
|||||||
list: []
|
list: []
|
||||||
not-met-lore: []
|
not-met-lore: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- altitide
|
- altitude
|
||||||
- aquamarine
|
- aquamarine
|
||||||
- dehydration
|
- dehydration
|
||||||
- rainforest
|
- rainforest
|
||||||
|
Loading…
Reference in New Issue
Block a user