usuniecie mscadmin add
This commit is contained in:
@@ -32,9 +32,6 @@ public class MscroleAdminCommand implements CommandExecutor {
|
|||||||
String subCommand = args[0].toLowerCase();
|
String subCommand = args[0].toLowerCase();
|
||||||
|
|
||||||
switch (subCommand) {
|
switch (subCommand) {
|
||||||
case "add":
|
|
||||||
addItem(sender, args);
|
|
||||||
break;
|
|
||||||
case "remove":
|
case "remove":
|
||||||
removeItem(sender, args);
|
removeItem(sender, args);
|
||||||
break;
|
break;
|
||||||
@@ -58,55 +55,14 @@ public class MscroleAdminCommand implements CommandExecutor {
|
|||||||
private void sendHelp(CommandSender sender) {
|
private void sendHelp(CommandSender sender) {
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-header"));
|
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-remove"));
|
||||||
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-give"));
|
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-give"));
|
||||||
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-take"));
|
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-take"));
|
||||||
sender.sendMessage(plugin.getMessageManager().getMessage("admin-help-set"));
|
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(plugin.getMessageManager().getMessage("admin-help-footer"));
|
||||||
sender.sendMessage("");
|
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) {
|
private void removeItem(CommandSender sender, String[] args) {
|
||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
sender.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("invalid-usage").replace("{usage}", "/mscrolladmin remove <slot>"));
|
sender.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("invalid-usage").replace("{usage}", "/mscrolladmin remove <slot>"));
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ public class MscroleAdminCommandTabCompleter implements TabCompleter {
|
|||||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
List<String> subCommands = new ArrayList<>();
|
List<String> subCommands = new ArrayList<>();
|
||||||
subCommands.add("add");
|
|
||||||
subCommands.add("remove");
|
|
||||||
subCommands.add("give");
|
|
||||||
subCommands.add("take");
|
|
||||||
subCommands.add("set");
|
subCommands.add("set");
|
||||||
return subCommands;
|
return subCommands;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,15 +63,6 @@ public class GuiListener implements Listener {
|
|||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
|
|
||||||
switch (clickedItem.getType()) {
|
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:
|
case DIAMOND:
|
||||||
player.sendMessage("");
|
player.sendMessage("");
|
||||||
player.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("admin-give-currency-help-header"));
|
player.sendMessage(plugin.getPrefix() + plugin.getMessageManager().getMessage("admin-give-currency-help-header"));
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ help-admin: "&e/mscroll admin &7- Panel administratora"
|
|||||||
help-footer: "&6&l═══════════════════════"
|
help-footer: "&6&l═══════════════════════"
|
||||||
|
|
||||||
admin-help-header: "&c&l════ Panel Administratora ════"
|
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-remove: "&e/mscrolladmin remove <slot> &7- Usuń przedmiot"
|
||||||
admin-help-give: "&e/mscrolladmin give <gracz> <ilość> &7- Daj walutę"
|
admin-help-give: "&e/mscrolladmin give <gracz> <ilość> &7- Daj walutę"
|
||||||
admin-help-take: "&e/mscrolladmin take <gracz> <ilość> &7- Zabierz 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}!"
|
item-purchased: "&aZakupiono przedmiot za &e{price} {currency}!"
|
||||||
not-enough-currency-shop: "&cNie masz wystarczająco {currency}! Potrzebujesz: &e{price}"
|
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-header: "&aAby dać walutę graczowi, użyj:"
|
||||||
admin-give-currency-help-command: "&e/mscrolladmin give <gracz> <ilość>"
|
admin-give-currency-help-command: "&e/mscrolladmin give <gracz> <ilość>"
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -38,8 +38,6 @@ help-admin: "&e/mscroll admin &7- Panel administratora"
|
|||||||
help-footer: "&6&l═══════════════════════"
|
help-footer: "&6&l═══════════════════════"
|
||||||
|
|
||||||
admin-help-header: "&c&l════ Panel Administratora ════"
|
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-remove: "&e/mscrolladmin remove <slot> &7- Usuń przedmiot"
|
||||||
admin-help-give: "&e/mscrolladmin give <gracz> <ilość> &7- Daj walutę"
|
admin-help-give: "&e/mscrolladmin give <gracz> <ilość> &7- Daj walutę"
|
||||||
admin-help-take: "&e/mscrolladmin take <gracz> <ilość> &7- Zabierz 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}!"
|
item-purchased: "&aZakupiono przedmiot za &e{price} {currency}!"
|
||||||
not-enough-currency-shop: "&cNie masz wystarczająco {currency}! Potrzebujesz: &e{price}"
|
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-header: "&aAby dać walutę graczowi, użyj:"
|
||||||
admin-give-currency-help-command: "&e/mscrolladmin give <gracz> <ilość>"
|
admin-give-currency-help-command: "&e/mscrolladmin give <gracz> <ilość>"
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user