error while enabling plugin

Discussion in 'Plugin Development' started by KiF, Jun 17, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    KiF

    I'm trying to run my plugin on my server, but when it gets enabled, an error occurs. Here's the stacktrace (bottom to top):
    As for that part where it specifies line 39 in my code (lines 31-56):
    Code:
    @Override
        public void onEnable(){
            String enability = "enabled";
            ScoreboardManager sbManager = Bukkit.getScoreboardManager();
            Scoreboard sBoard = sbManager.getNewScoreboard();
            Inventory wrGadget2Inv = Bukkit.createInventory(null, 9, ChatColor.GREEN + "Choose a gadget!");
            Inventory wrGadget1Inv = Bukkit.createInventory(null, 9, ChatColor.GREEN + "Choose a gadget!");
            Inventory wrPrimaryInv = Bukkit.createInventory(null, 9, ChatColor.GREEN + "Choose a primary weapon!");
            Inventory wrCustomInv = Bukkit.createInventory(null, 9, ChatColor.GREEN + "Choose which item to customize!");
            Inventory customizeInv = Bukkit.createInventory(null, 9, ChatColor.GREEN + "Choose a class to customize!");
            Inventory AGclassInv = Bukkit.createInventory(null, 9, ChatColor.GREEN + "Choose a Class!");
            Team team1 = sBoard.registerNewTeam("Red Team");
            Team team2 = sBoard.registerNewTeam("Yellow Team");
            onInventoryClick(null, team1, team2, "enabled", wrGadget2Inv, wrGadget1Inv, wrPrimaryInv, wrCustomInv, customizeInv, AGclassInv);
            onCommand(null, null, null, "enabled", null);
            onPlayerQuit(null, team1, team2);
            int playerCount;
            playerCount = Bukkit.getOnlinePlayers().length;
            if(enability == "enabled"){
                if(playerCount == 6){
                thing1.arenaStart(null, team1, team2);
                }else if(playerCount <= 5){
                thing1.arenaWait(team1, team2);
                }
            }
        }
     
  2. Offline

    Ice3ider4

    The problem is that you have an inventory title that has more than 32 characters and this throws an exception ;)
    Code:
    17.06 10:49:45 [Server] INFO java.lang.IllegalArgumentException: Title cannot be longer than 32 characters
     
  3. Offline

    Seadragon91

    Well here is the error
    Code:
    Title cannot be longer than 32 characters
    You are try to set a title from the inventory longer than 32 characters. Remember 1 color needs 2 characters.
     
  4. Offline

    DrTURTLE2

    I counted this one:
    Code:java
    1. Inventory wrCustomInv = Bukkit.createInventory(null, 9, ChatColor.GREEN + "Choose which item to customize!");

    Looks right around 32 charachters. I would try and make it shorter.
     
  5. Offline

    KiF

    Thanks everyone! I didn't know about the limit for characters, whoops. :D
     
  6. Offline

    cs475x

    33 to be exact, chat colors/formats add 2 characters each.
     
Thread Status:
Not open for further replies.

Share This Page