9
0
mirror of https://github.com/Auxilor/EcoArmor.git synced 2025-12-27 02:49:22 +00:00

Removed CommandEditor

This commit is contained in:
Auxilor
2021-11-20 12:12:50 +00:00
parent 3b0e68d2bf
commit ab980f68df
4 changed files with 1 additions and 66 deletions

View File

@@ -16,8 +16,7 @@ public class CommandEcoarmor extends PluginCommand {
super(plugin, "ecoarmor", "ecoarmor.command.ecoarmor", false);
this.addSubcommand(new CommandReload(plugin))
.addSubcommand(new CommandGive(plugin))
.addSubcommand(new CommandEditor(plugin));
.addSubcommand(new CommandGive(plugin));
}
@Override

View File

@@ -1,59 +0,0 @@
package com.willfp.ecoarmor.commands;
import com.willfp.eco.core.EcoPlugin;
import com.willfp.eco.core.command.CommandHandler;
import com.willfp.eco.core.command.impl.Subcommand;
import com.willfp.eco.core.config.interfaces.JSONConfig;
import com.willfp.eco.core.web.Paste;
import com.willfp.eco.util.StringUtils;
import com.willfp.ecoarmor.EcoArmorPlugin;
import com.willfp.libreforge.api.conditions.Condition;
import com.willfp.libreforge.api.conditions.Conditions;
import com.willfp.libreforge.api.effects.Effect;
import com.willfp.libreforge.api.effects.Effects;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.potion.PotionEffectType;
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 CommandEditor extends Subcommand {
/**
* Instantiate a new /eaeditor command handler.
*
* @param plugin The plugin for the commands to listen for.
*/
public CommandEditor(@NotNull final EcoPlugin plugin) {
super(plugin, "editor", "ecoarmor.command.editor", false);
}
@Override
public CommandHandler getHandler() {
return (sender, args) -> {
JSONConfig config = ((EcoArmorPlugin) this.getPlugin()).getEcoArmorJson().clone();
Map<String, Object> meta = new HashMap<>();
List<String> enchants = Arrays.stream(Enchantment.values()).map(Enchantment::getKey).map(NamespacedKey::getKey).collect(Collectors.toList());
meta.put("enchants", enchants);
List<String> potionEffects = Arrays.stream(PotionEffectType.values()).map(PotionEffectType::getName).collect(Collectors.toList());
meta.put("potion-effects", potionEffects);
List<String> effects = Effects.INSTANCE.values().stream().map(Effect::getId).collect(Collectors.toList());
meta.put("effects", effects);
List<String> conditions = Conditions.INSTANCE.values().stream().map(Condition::getId).collect(Collectors.toList());
meta.put("conditions", conditions);
config.set("meta", meta);
new Paste(config.toPlaintext()).getHastebinToken(token -> {
sender.sendMessage(StringUtils.format("&cThe editor is coming soon!") + token);
});
};
}
}

View File

@@ -9,5 +9,4 @@ messages:
needs-item: "&cYou must specify an item!"
invalid-item: "&cInvalid item!"
give-success: "Gave &a%item%&r to &a%recipient%"
open-editor: "Open the editor here: &a%url%"
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"

View File

@@ -29,7 +29,6 @@ permissions:
ecoarmor.command.reload: true
ecoarmor.command.ecoarmor: true
ecoarmor.command.give: true
ecoarmor.command.editor: true
ecoarmor.command.reload:
description: Allows reloading the config
@@ -40,9 +39,6 @@ permissions:
ecoarmor.noflydisable:
description: Prevents losing fly.
default: op
ecoarmor.command.editor:
description: Allows the user of /ecoarmor editor.
default: op
ecoarmor.command.ecoarmor:
description: Allows the user of /ecoarmor.
default: true