9
0
mirror of https://github.com/Auxilor/EcoArmor.git synced 2025-12-28 03:19:25 +00:00

Added meta

This commit is contained in:
Auxilor
2021-06-24 13:39:19 +01:00
parent b250e289c0
commit fe15256678

View File

@@ -11,7 +11,9 @@ import org.bukkit.enchantments.Enchantment;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class CommandEaeditor extends AbstractCommand {
@@ -29,7 +31,9 @@ public class CommandEaeditor extends AbstractCommand {
@NotNull final List<String> args) {
JSONConfig config = ((EcoArmorPlugin) this.getPlugin()).getEcoArmorJson().clone();
List<String> enchantKeys = Arrays.stream(Enchantment.values()).map(Enchantment::getKey).map(NamespacedKey::getKey).collect(Collectors.toList());
config.set("meta.enchants", enchantKeys);
Map<String, Object> meta = new HashMap<>();
meta.put("enchants", enchantKeys);
config.set("meta", meta);
String token = new Paste(config.toPlaintext()).getHastebinToken();
String message = this.getPlugin().getLangYml().getMessage("open-editor")
.replace("%url%", "https://auxilor.io/editor/ecoarmor?token=" + token);