Removed /ecoskip

This commit is contained in:
Auxilor
2020-09-22 19:48:53 +01:00
parent 29e00ad554
commit cc780be1fe
3 changed files with 0 additions and 45 deletions

View File

@@ -1,36 +0,0 @@
package com.willfp.ecoenchants.command.commands;
import com.willfp.ecoenchants.command.AbstractCommand;
import com.willfp.ecoenchants.config.ConfigManager;
import com.willfp.ecoenchants.display.EnchantDisplay;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import java.util.List;
public final class CommandEcoskip extends AbstractCommand {
public CommandEcoskip() {
super("ecoskip", "ecoenchants.skip", true);
}
@Override
public void onExecute(CommandSender sender, List<String> args) {
Player player = (Player) sender;
ItemStack item = player.getInventory().getItemInMainHand();
ItemMeta meta = item.getItemMeta();
if(meta == null) {
return;
}
if(meta.getPersistentDataContainer().has(EnchantDisplay.KEY_SKIP, PersistentDataType.INTEGER)) {
meta.getPersistentDataContainer().remove(EnchantDisplay.KEY_SKIP);
player.sendMessage(ConfigManager.getLang().getMessage("skip-removed"));
} else {
meta.getPersistentDataContainer().set(EnchantDisplay.KEY_SKIP, PersistentDataType.INTEGER, 1);
player.sendMessage(ConfigManager.getLang().getMessage("skip-added"));
}
item.setItemMeta(meta);
}
}

View File

@@ -5,7 +5,6 @@ import com.willfp.ecoenchants.EcoEnchantsPlugin;
import com.willfp.ecoenchants.anvil.AnvilListeners;
import com.willfp.ecoenchants.command.commands.CommandEcodebug;
import com.willfp.ecoenchants.command.commands.CommandEcoreload;
import com.willfp.ecoenchants.command.commands.CommandEcoskip;
import com.willfp.ecoenchants.command.commands.CommandEnchantinfo;
import com.willfp.ecoenchants.config.ConfigManager;
import com.willfp.ecoenchants.display.EnchantDisplay;
@@ -375,7 +374,6 @@ public class Loader {
Bukkit.getPluginCommand("ecoreload").setExecutor(new CommandEcoreload());
Bukkit.getPluginCommand("ecodebug").setExecutor(new CommandEcodebug());
Bukkit.getPluginCommand("enchantinfo").setExecutor(new CommandEnchantinfo());
Bukkit.getPluginCommand("ecoskip").setExecutor(new CommandEcoskip());
Logger.info("");
/*

View File

@@ -26,9 +26,6 @@ commands:
ecodebug:
description: Debug information
permission: ecoenchants.ecodebug
ecoskip:
description: Toggle hiding enchantments on item
permission: ecoenchants.skip
enchantinfo:
description: Show information about an enchantment
permission: ecoenchants.enchantinfo
@@ -43,7 +40,6 @@ permissions:
ecoenchants.updateannounce: true
ecoenchants.enchantinfo: true
ecoenchants.ecodebug: true
ecoenchants.skip: true
ecoenchants.fromtable.*:
description: Allows getting all enchantments from an enchanting table
default: true
@@ -257,9 +253,6 @@ permissions:
ecoenchants.ecodebug:
description: Allows the use of /ecodebug to print verbose debug information to console
default: true
ecoenchants.skip:
description: Allows the use of /ecoskip to toggle hiding enchantments on an item
default: op
ecoenchants.enchantinfo:
description: Allows the use of /enchantinfo to show enchant info
default: true