[SOLVED] Null when getting string from config -.-

Discussion in 'Spigot Plugin Development' started by AdrianPMC, Jul 12, 2015.

  1. Hi,

    people may think I'm a noob for asking this question... but i just can't see the problem... to start off, here are the 2 classes that I'm using (not including all because these are the only 2 needed!

    http://hastebin.com/edehayurey.avrasm - kills command class
    http://hastebin.com/apamoxazoz.coffee - Main class

    i have methods for getting my lang.yml (getLangConfig()) and stuff like that... getting config.yml and storage.yml and values inside them works fine, i have printed out the kills, that equals 0... but when i use the getLangConfig it returns null or just prints a blank line in game, i have read over all of my code, some of it won't be relevant in this problem but i just cannot see the problem, i have checked the lang.yml AFTER reloading and typing /kills and this is what it looks like

    Code (Text):
    deathMessage: &c{killed}&f[&6{killedStat}&f]&7 was killed by &c{killer}&f[&6{killerStat}&f]&7 using &b{item}
    noPermission: &cYou do not have permission to do that!
    notPlayer: &cYou must be a player to use that!
    sendPlayerDeaths: &c{player} &7has &6{stat} &7deaths!
    sendPlayerKills: "&c{player} &7has &6{stat} &7kills!"
    playerDoesNotExist: &cThat player does not exist or is not online!
    tooManyArguments: &cToo many arguments, try shortening the command!
    tooFewArguments: &cToo few arguments, ty shortening the command!
    deathSignsKilledBy: &awas killed by
    deathSignName: &4Death Sign
    enderPearlCooldown: &cYou cannot use an enderpearl for another &7{time} &cseconds!
    configReloaded: &7All configurations have been reloaded!
    configInvalidArguments: &cInvalid argument, try the help menu!
    pathDoesNotExist: &cThat path does not exist in the config.yml
    notInt: &cThat value is not an Integer (number)
    notBoolean: &cThat value is not a Boolean (true/false)
    notString: &cThat value is not a string (words)
    notEditable: &cThat value is not editable in game, try editing the config.yml manually
    valueChanged: &7The value has been changed
    noWrenchesLeft: &cYou do not have any wrenches left to use!
    wrenchOnGround: &7One of the wrenches you requested couldnt fit in your inventory, we dropped it on the ground.
    mustBeNumber: &cThe amount of wrenches you want ust be a number, please use a number!
    i have tried swapping sending the "sendPlayerKills" message with "noPermission" but it still sends a blank line, i have tried adding in "" and '' as you can see in the lang.yml i have given but its still sending a blank line... please if any one can spot something maybe if its really obvious that would be great... been working on this problem for 2 hours straight now... and i still can't seem to find the solution
     
  2. Don't use " in YAML.
     
  3. did you not read it xD i said i have tried them but nothing works... its not the '' that is breaking it xD i just tried it to see if it made a difference... you got any ideas??? I'm still stuck
     
  4. Copy the Config into an online YAML parser and see if it's formatted right.
     
  5. How did you solve it?
     
  6. i can search google for links... but thanks :D

    didn't realise that {} needed to be inside "" for my config to work :D http://www.yamllint.com was what i used, it organised my file and added in the necessary ""s for the YAML to work (for anyone that stumbles on this looking for the answer)
     
    • Funny Funny x 1