From dc7ed331087f40d19eae2edf68c2ddab7135df29 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 24 Jun 2021 14:33:18 +0100 Subject: [PATCH] Added more to meta --- .../ecoarmor/commands/CommandEaeditor.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/commands/CommandEaeditor.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/commands/CommandEaeditor.java index c37a292..f18e712 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/commands/CommandEaeditor.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/commands/CommandEaeditor.java @@ -5,9 +5,14 @@ import com.willfp.eco.core.command.AbstractCommand; import com.willfp.eco.core.config.JSONConfig; import com.willfp.eco.core.web.Paste; import com.willfp.ecoarmor.EcoArmorPlugin; +import com.willfp.ecoarmor.conditions.Condition; +import com.willfp.ecoarmor.conditions.Conditions; +import com.willfp.ecoarmor.effects.Effect; +import com.willfp.ecoarmor.effects.Effects; import org.bukkit.NamespacedKey; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; +import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; import java.util.Arrays; @@ -30,9 +35,20 @@ public class CommandEaeditor extends AbstractCommand { public void onExecute(@NotNull final CommandSender sender, @NotNull final List args) { JSONConfig config = ((EcoArmorPlugin) this.getPlugin()).getEcoArmorJson().clone(); - List enchantKeys = Arrays.stream(Enchantment.values()).map(Enchantment::getKey).map(NamespacedKey::getKey).collect(Collectors.toList()); Map meta = new HashMap<>(); - meta.put("enchants", enchantKeys); + + List enchants = Arrays.stream(Enchantment.values()).map(Enchantment::getKey).map(NamespacedKey::getKey).collect(Collectors.toList()); + meta.put("enchants", enchants); + + List potionEffects = Arrays.stream(PotionEffectType.values()).map(PotionEffectType::getName).collect(Collectors.toList()); + meta.put("potion-effects", potionEffects); + + List effects = Effects.values().stream().map(Effect::getName).collect(Collectors.toList()); + meta.put("effects", effects); + + List conditions = Conditions.values().stream().map(Condition::getName).collect(Collectors.toList()); + meta.put("conditions", conditions); + config.set("meta", meta); String token = new Paste(config.toPlaintext()).getHastebinToken(); String message = this.getPlugin().getLangYml().getMessage("open-editor")