From cf1c58dd8bad4527fa54341f8cb7cdbf18875758 Mon Sep 17 00:00:00 2001 From: FluffyBear Date: Fri, 4 Sep 2020 00:54:06 -0500 Subject: [PATCH] Got rid of charge command from this branch --- .../commands/subcommands/ChargeCommand.java | 54 ------------------- .../subcommands/SlimefunSubCommands.java | 1 - src/main/resources/languages/messages_en.yml | 4 -- src/main/resources/plugin.yml | 3 -- 4 files changed, 62 deletions(-) delete mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/ChargeCommand.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/ChargeCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/ChargeCommand.java deleted file mode 100644 index 5390ad24c..000000000 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/ChargeCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -package io.github.thebusybiscuit.slimefun4.core.commands.subcommands; - -import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable; -import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; -import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; -import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - -/** - * {@link ChargeCommand} adds an in game command which charges any {@link Rechargeable} - * item to max. - * - * @author FluffyBear - * - */ -class ChargeCommand extends SubCommand { - - ChargeCommand(SlimefunPlugin plugin, SlimefunCommand cmd) { - super(plugin, cmd, "charge", false); - } - - @Override - protected String getDescription() { - return "commands.charge.description"; - } - - @Override - public void onExecute(CommandSender sender, String[] args) { - if (sender instanceof Player) { - if (sender.hasPermission("slimefun.charge.command")) { - Player p = (Player) sender; - ItemStack item = p.getInventory().getItemInMainHand(); - SlimefunItem slimefunItem = SlimefunItem.getByItem(item); - if (slimefunItem instanceof Rechargeable) { - Rechargeable rechargeableItem = (Rechargeable) slimefunItem; - rechargeableItem.setItemCharge(item, rechargeableItem.getMaxItemCharge(item)); - SlimefunPlugin.getLocalization().sendMessage(sender, "commands.charge.charge-success", true); - } - else { - SlimefunPlugin.getLocalization().sendMessage(sender, "commands.charge.not-rechargeable", true); - } - } - else { - SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); - } - } - else { - SlimefunPlugin.getLocalization().sendMessage(sender, "messages.only-players", true); - } - } -} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/SlimefunSubCommands.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/SlimefunSubCommands.java index 10378c3ff..0d337f1f4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/SlimefunSubCommands.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/SlimefunSubCommands.java @@ -37,7 +37,6 @@ public final class SlimefunSubCommands { commands.add(new SearchCommand(plugin, cmd)); commands.add(new DebugFishCommand(plugin, cmd)); commands.add(new BackpackCommand(plugin, cmd)); - commands.add(new ChargeCommand(plugin, cmd)); return commands; } diff --git a/src/main/resources/languages/messages_en.yml b/src/main/resources/languages/messages_en.yml index 44ed4b8b8..92f84b82a 100644 --- a/src/main/resources/languages/messages_en.yml +++ b/src/main/resources/languages/messages_en.yml @@ -22,10 +22,6 @@ commands: backpack-does-not-exist: '&4The specified backpack does not exist!' restored-backpack-given: '&aYour backpack has been restored and was added to your inventory!' - charge: - description: Charges the item you are holding - charge-success: Item has been charged! - not-rechargeable: This item can not be charged! guide: locked: 'LOCKED' diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 702592c14..1841a7839 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -49,9 +49,6 @@ permissions: slimefun.command.backpack: description: Allows you to do /sf backpack default: op - slimefun.command.charge: - description: Allows you to do /sf charge - default: op slimefun.android.bypass: description: Allows you to edit other Players Androids default: op