mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-25 14:21:51 +01:00
A bit of optimalization
This commit is contained in:
parent
6a48340dc6
commit
4415b52986
@ -178,7 +178,7 @@ public class MaterialUtil {
|
|||||||
} else {
|
} else {
|
||||||
Map<org.bukkit.enchantments.Enchantment, Integer> enchantments = getEnchantments(itemName); //TODO - it's obsolete, left only for backward compatibility
|
Map<org.bukkit.enchantments.Enchantment, Integer> enchantments = getEnchantments(itemName); //TODO - it's obsolete, left only for backward compatibility
|
||||||
|
|
||||||
if (!enchantments.isEmpty()) {
|
if (enchantments != null) {
|
||||||
try {
|
try {
|
||||||
itemStack.addEnchantments(enchantments);
|
itemStack.addEnchantments(enchantments);
|
||||||
} catch (IllegalArgumentException exception) {
|
} catch (IllegalArgumentException exception) {
|
||||||
@ -225,7 +225,7 @@ public class MaterialUtil {
|
|||||||
Matcher m = ENCHANTMENT.matcher(itemName);
|
Matcher m = ENCHANTMENT.matcher(itemName);
|
||||||
|
|
||||||
if (!m.find()) {
|
if (!m.find()) {
|
||||||
return new HashMap<org.bukkit.enchantments.Enchantment, Integer>();
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String group = m.group().substring(1);
|
String group = m.group().substring(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user