mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Added permission names to essentials
This commit is contained in:
parent
8f12323c00
commit
80f740cdea
@ -1,6 +1,7 @@
|
||||
package com.willfp.ecoenchants.integrations.essentials.plugins;
|
||||
|
||||
import com.earth2me.essentials.Enchantments;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||
import com.willfp.ecoenchants.integrations.essentials.EssentialsWrapper;
|
||||
import org.apache.commons.lang.reflect.FieldUtils;
|
||||
@ -13,8 +14,9 @@ public class IntegrationEssentials implements EssentialsWrapper {
|
||||
@Override
|
||||
public void registerAllEnchantments() {
|
||||
try {
|
||||
for (Enchantment enchantment : EcoEnchants.values()) {
|
||||
for (EcoEnchant enchantment : EcoEnchants.values()) {
|
||||
((Map<String, Enchantment>) FieldUtils.readDeclaredStaticField(Enchantments.class, "ENCHANTMENTS", true)).put(enchantment.getKey().getKey(), enchantment);
|
||||
((Map<String, Enchantment>) FieldUtils.readDeclaredStaticField(Enchantments.class, "ENCHANTMENTS", true)).put(enchantment.getPermissionName(), enchantment);
|
||||
}
|
||||
} catch (IllegalAccessException ignored) {
|
||||
// Ignore reflective errors that won't happen.
|
||||
|
Loading…
Reference in New Issue
Block a user