usuniecie mscadmin add

This commit is contained in:
2025-11-02 03:43:45 +01:00
parent 3d55e39704
commit f7e3dc39bb
11 changed files with 0 additions and 71 deletions

View File

@@ -32,9 +32,6 @@ public class MscroleAdminCommand implements CommandExecutor {
String subCommand = args[0].toLowerCase();
switch (subCommand) {
case "add":
addItem(sender, args);
break;
case "remove":
removeItem(sender, args);
break;
@@ -58,55 +55,14 @@ public class MscroleAdminCommand implements CommandExecutor {
private void sendHelp(CommandSender sender) {
sender.sendMessage("");
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-header"));
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-add"));
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-remove"));
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-give"));
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-take"));
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-set"));
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-list"));
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-footer"));
sender.sendMessage("");
}
private void addItem(CommandSender sender, String[] args) {
if (args.length < 5) {
sender.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("invalid-usage").replace("{usage}", "/mscrolladmin add <slot> <price> <item> <amount> <commands>"));
return;
}
int slot;
int price;
Material material;
int amount = 1;
List<String> commands = new ArrayList<>();
try {
slot = Integer.parseInt(args[1]);
price = Integer.parseInt(args[2]);
material = Material.getMaterial(args[3].toUpperCase());
amount = Integer.parseInt(args[4]);
for (int i = 5; i < args.length; i++) {
commands.add(args[i]);
}
} catch (NumberFormatException e) {
sender.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("invalid-amount"));
return;
}
if (material == null) {
sender.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("material-not-found").replace("{material}", args[3]));
return;
}
if (slot < 10 || slot > 43) {
sender.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("invalid-slot"));
return;
}
plugin.getShopManager().addItem(slot, price, commands, new ItemStack(material, amount));
sender.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("item-added").replace("{slot}", String.valueOf(slot)).replace("{price}", String.valueOf(price)));
}
private void removeItem(CommandSender sender, String[] args) {
if (args.length < 2) {
sender.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("invalid-usage").replace("{usage}", "/mscrolladmin remove <slot>"));

View File

@@ -13,10 +13,6 @@ public class MscroleAdminCommandTabCompleter implements TabCompleter {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
if (args.length == 1) {
List<String> subCommands = new ArrayList<>();
subCommands.add("add");
subCommands.add("remove");
subCommands.add("give");
subCommands.add("take");
subCommands.add("set");
return subCommands;
}

View File

@@ -63,15 +63,6 @@ public class GuiListener implements Listener {
player.closeInventory();
switch (clickedItem.getType()) {
case EMERALD:
player.sendMessage("");
player.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("admin-add-item-help-header"));
player.sendMessage(plugin.getMessageManager().getMessage("admin-add-item-help-command"));
player.sendMessage("");
player.sendMessage(plugin.getMessageManager().getMessage("admin-add-item-help-example-command"));
player.sendMessage(plugin.getMessageManager().getMessage("admin-add-item-help-example-description"));
player.sendMessage("");
break;
case DIAMOND:
player.sendMessage("");
player.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("admin-give-currency-help-header"));

View File

@@ -38,8 +38,6 @@ help-admin: "&e/mscroll admin &7- Panel administratora"
help-footer: "&6&l═══════════════════════"
admin-help-header: "&c&l════ Panel Administratora ════"
admin-help-add: "&e/mscrolladmin add <slot> <price> <item> <amount> <command1;command2;...>
&7- Add item with multiple commands"
admin-help-remove: "&e/mscrolladmin remove <slot> &7- Usuń przedmiot"
admin-help-give: "&e/mscrolladmin give <gracz> <ilość> &7- Daj walutę"
admin-help-take: "&e/mscrolladmin take <gracz> <ilość> &7- Zabierz walutę"
@@ -53,11 +51,6 @@ list-items-format: "&7[Slot {slot}] &e{item} &7- &a{price} {currency}"
item-purchased: "&aZakupiono przedmiot za &e{price} {currency}!"
not-enough-currency-shop: "&cNie masz wystarczająco {currency}! Potrzebujesz: &e{price}"
admin-add-item-help-header: "&aAby dodać przedmiot do sklepu, użyj:"
admin-add-item-help-command: "&e/mscrolladmin add <slot> <cena> <przedmiot> [ilość]"
admin-add-item-help-example-command: "&7Przykład: &e/mscrolladmin add 20 500 diamond 1"
admin-add-item-help-example-description: "&7To doda diament do slotu 20 za 500 MSCROLE"
admin-give-currency-help-header: "&aAby dać walutę graczowi, użyj:"
admin-give-currency-help-command: "&e/mscrolladmin give <gracz> <ilość>"

Binary file not shown.

View File

@@ -38,8 +38,6 @@ help-admin: "&e/mscroll admin &7- Panel administratora"
help-footer: "&6&l═══════════════════════"
admin-help-header: "&c&l════ Panel Administratora ════"
admin-help-add: "&e/mscrolladmin add <slot> <price> <item> <amount> <command1;command2;...>
&7- Add item with multiple commands"
admin-help-remove: "&e/mscrolladmin remove <slot> &7- Usuń przedmiot"
admin-help-give: "&e/mscrolladmin give <gracz> <ilość> &7- Daj walutę"
admin-help-take: "&e/mscrolladmin take <gracz> <ilość> &7- Zabierz walutę"
@@ -53,11 +51,6 @@ list-items-format: "&7[Slot {slot}] &e{item} &7- &a{price} {currency}"
item-purchased: "&aZakupiono przedmiot za &e{price} {currency}!"
not-enough-currency-shop: "&cNie masz wystarczająco {currency}! Potrzebujesz: &e{price}"
admin-add-item-help-header: "&aAby dodać przedmiot do sklepu, użyj:"
admin-add-item-help-command: "&e/mscrolladmin add <slot> <cena> <przedmiot> [ilość]"
admin-add-item-help-example-command: "&7Przykład: &e/mscrolladmin add 20 500 diamond 1"
admin-add-item-help-example-description: "&7To doda diament do slotu 20 za 500 MSCROLE"
admin-give-currency-help-header: "&aAby dać walutę graczowi, użyj:"
admin-give-currency-help-command: "&e/mscrolladmin give <gracz> <ilość>"

Binary file not shown.