Case insensitive package names for commands #30


  • New
  • Enhancment
Open
Assigned to _ForgeUser7535878
  • _ForgeUser6950607 created this issue Jan 6, 2014

    What is the enhancement in mind? How should it look and feel?

    When a player issues a package info or purchase, the package name supplied should be case insensitive

    Please provide any additional information below.

    For example, I where the info or purchase command is parsed you could do something like this :

    if (args[1].equalsIgnoreCase("info")) {
                            String packName = args[2];
                            String caseSensitivePackName = packName;

                            // Resolve the supplied package name to the case sensitive equivalent from the config.
                            List<String> packages = new ArrayList<String>(plugin.getConfig().getConfigurationSection("packages").getKeys(false));
                            for (String packageName : packages)
                            {
                                if (packageName.toLowerCase().equals(packName.toLowerCase()))
                                {
                                    caseSensitivePackName = packageName;
                                    break;
                                }
                            }
                                                    packName  = caseSensitivePackName ;

  • _ForgeUser6950607 added the tags New Enhancment Jan 6, 2014

To post a comment, please login or register a new account.