YamlConfiguration...

Discussion in 'Plugin Development' started by Bammerbom, Jul 11, 2014.

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

    Bammerbom

    I recently added some new Strings in the messages of my plugin. But everytime I get them they return null. I am 100% sure my "EN.yml" is updated on my testserver and contains the new Strings.
    Messages: http://pastebin.com/7XJDNtze
    Code:
    Code:java
    1. YamlConfiguration.loadConfiguration(new File(getDataFolder() + "/Messages", "EN.yml")).getString("Words.Yes")





    I try to get: Words.Yes (Line 64)

    When I get the keys (YamlConfiguration.getKeys()) it doesnt contain the new Words.Yes
     
  2. Offline

    Syd

    Bammerbom
    I would guess your file constructor does not link to your actual file.
     
  3. Offline

    Bammerbom

  4. Offline

    marwzoor

    Try to debug some?

    Code:java
    1.  
    2. File file = new File(getDataFolder() + "/Messages/EN.yml");
    3.  
    4. if(!file.exists())
    5. {
    6. System.out.println("File doesn't exist at this path: " + file.getAbsolutePath());
    7. }
    8.  
     
  5. Offline

    Syd

    Bammerbom
    I don't doubt that these files exists, I doubt that your File constructor is correctly pointing to the file your think.

    Try
    getDataFolder(), "Messages" + File.seperator + "EN.yml"
     
  6. Offline

    Bammerbom

    marwzoor
    Did that, the file exists :)

    Syd
    Did that, still not working.
    Code:java
    1. YamlConfiguration.loadConfiguration(new File(getDataFolder() + File.separator + "Messages", "EN.yml")).getString("Words.Yes");
     
  7. Offline

    marwzoor

    Okey this is how I usually do it:

    Code:java
    1.  
    2. File file = new File(getDataFolder() + "/Messages/EN.yml");
    3.  
    4. FileConfiguration config = new YamlConfiguration();
    5.  
    6. try
    7. {
    8. config.load(file);
    9. }
    10. catch(Exception e)
    11. {
    12. e.printStackTrace();
    13. return;
    14. }
    15.  
    16. System.out.println(config.getString("Words.Yes"));
    17.  


    Try if it works :)
     
  8. Offline

    Syd

    Bammerbom
    Please try it exactly the way I wrote it.
    Adding a String to a File will most likely not result in what you want. ;)

    (Btw. does you server log say something when you try to load the config?)
     
  9. Offline

    Bammerbom

    marwzoor
    I am sure this
    File file =newFile(getDataFolder()+"/Messages/EN.yml");
    has to be
    File file = new File(getDataFolder() + "/Messages", "EN.yml");

    both didnt work :(

    Syd
    Again didnt work.

    Code:java
    1. YamlConfiguration.loadConfiguration(new File(getDataFolder(), "Messages" + File.separator + "EN.yml")).getString("Words.Yes")


    Bammerbom
    As said in the Java new file:

    File(String parent, String child)
    Creates a new File instance from a parent pathname string and a child pathname string.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  10. Offline

    Syd

    Bammerbom
    Well, that is strange. I use exactly this format in my own plugins and it works without a problem.

    Have you tried to create some debug output, like the path of the File object and the content of the file, the plugin found?
     
  11. Offline

    Bammerbom

    Syd
    The strange thing is this ussually works for me too.
    Debugging:
    The file object: (Correct)
    Code:
    plugins\UltimateCore\Messages\EN.yml
    getKeys(true)
    Code:
    [JoinMessage, LeaveMessage, FirstJoin, WhitelistMessage, FullMessage, DeathMessages, DeathMessages.Player, DeathMessages.Cactus, DeathMessages.TNT, DeathMessages.Drowning, DeathMessages.Fall, DeathMessages.Fire, DeathMessages.Suffocated, DeathMessages.OutOfWorld, DeathMessages.Hunger, DeathMessages.Suicide, DeathMessages.Potion, DeathMessages.Lightning, DeathMessages.Lava, DeathMessages.Enderpearl, DeathMessages.Fireball, DeathMessages.Projectile, DeathMessages.EnderCrystal, DeathMessages.Zombie, DeathMessages.ZombiePigMan, DeathMessages.Skeleton, DeathMessages.Creeper, DeathMessages.Ghast, DeathMessages.Blaze, DeathMessages.Slime, DeathMessages.MagmaCube, DeathMessages.Wolf, DeathMessages.Spider, DeathMessages.CaveSpider, DeathMessages.Silverfish, DeathMessages.Enderman, DeathMessages.EnderDragon, DeathMessages.Wither, DeathMessages.WitherSkeleton, DeathMessages.IronGolem, DeathMessages.Unknown, UnknownCommandMessage, NeedToBePlayer, NoPermissions, PlayerNotFound, AntiBan, NumberFormat, Words, Words.Premium, Words.NotPremium, Words.true, Words.false, AccountStatus, AccountStatus.Usage, AccountStatus.FailedSupport, AccountStatus.FailedConnect, AccountStatus.Succes, Afk, Afk.Afk, Afk.Unafk, Afk.Kick, EditSign, EditSign.Usage, EditSign.Clear, EditSign.Set, Warp, Warp.NoWarpsFound, Warp.Warps, Warp.Warped, Warp.WarpNotExist, Warp.Warpset, Warp.Warpmoved, Warp.WarpDeleted, Home, Home.Usage, Home.Usage2, Home.NoHomesFound, Home.Homes, Home.Hometp, Home.HomeNotExist, Home.Homeset, Home.Homemoved, Home.HomeDeleted, Weather, Weather.Set, Weather.Usage, Back, Whisper, Whisper.Usage, Whisper.Usage2, Speed, Speed.Usage, Speed.Self, Speed.OtherSelf, Speed.OtherOther, Hat, Save, Save.Start, Save.Done, Time, Stop, Stop.Stop, Stop.StandardKickMessage, Reload, Reload.Start, Reload.Done, Tp, Tp.Tpa, Tp.Tpa.Send, Tp.Tpa.TpaTarget1, Tp.Tpa.TpaTarget1_HERE, Tp.Tpa.TpaTarget2, Tp.Tpa.TpaTarget3, Tp.Tpa.NoRequests, Tp.Tpa.AcceptSender, Tp.Tpa.AcceptTarget, Tp.Tpa.DenySender, Tp.Tpa.DenyTarget, Tp.Tp1, Tp.Tp2, Tp.Tp3, Tp.Tp4, Plugin, Plugin.SuccesUnload, Plugin.SuccesLoad, Plugin.SuccesEnable, Plugin.SuccesDisable, Plugin.SuccesRestart, Plugin.SuccesReload, Plugin.AlreadyDisabled, Plugin.AlreadyEnabled, Plugin.Error, Plugin.NotFound, Plugin.UsageInfo, Plugin.UsageEnable, Plugin.UsageDisable, Plugin.UsageLoad, Plugin.UsageUnload, Plugin.UsageReload, Realname, Realname.Usage, Realname.Message, Gamemode, Gamemode.Usage, Gamemode.setSelf, Gamemode.selfMessage, Gamemode.otherMessage, Fly, Fly.Message, Fly.toSelf, Fly.toOther, God, God.forSelf, God.selfMessage, God.otherMessage, Repair, Repair.forSelf, Repair.selfMessage, Repair.otherMessage, Repair.forSelfMode, Repair.selfMessageMode, Repair.otherMessageMode, Feed, Feed.forSelf, Feed.selfMessage, Feed.otherMessage, Feed.forSelfMode, Feed.selfMessageMode, Feed.otherMessageMode, Clear, Clear.SelfMessage, Clear.ToSelf, Clear.ToOther, Invsee, Invsee.Usage, IP, IP.Server, IP.Player1, IP.Player2, Heal, Heal.Message, Heal.ToSelf, Heal.ToOther, Extinguish, Extinguish.Message, Extinguish.ToSelf, Extinguish.ToOther, Kill, Kill.Suicide, Kill.target, Kill.killer, Set, Set.Spawn, Set.SpawnNotSet, World, World.Create, World.Create.Created, World.Create.Creating, World.Create.Usage, World.List, World.Import, World.Import.Importing, World.Import.Imported, World.Import.Usage, World.Remove, World.NotFound, World.AlreadyExist, World.NotAlpha, Me, Me.Usage, List, List.List, Ban, Ban.Usage, Ban.Usage2, Ban.Message, Ban.StandardReason, Ban.TimeForever, Ban.Broadcast, Ban.BroadcastUnban, Ban.joinAfterUnban, Ban.NotBanned, Ban.List, Kick, Kick.Usage, Kick.KickMessage, Kick.StandardReason, Kick.Broadcast, Kick.Broadcast2, Freeze, Freeze.Usage, Freeze.Usage2, Freeze.Freezed, Freeze.Unfreezed, Freeze.MoveMessage, Freeze.List, Mute, Mute.Usage, Mute.Usage2, Mute.Muted, Mute.Unmuted, Mute.Mutetarget, Mute.Unmutetarget, Mute.Forever, Mute.ChatMessage, Mute.ChatMessageTime, Mute.List, Deaf, Deaf.Usage, Deaf.Usage2, Deaf.Deaf, Deaf.Undeaf, Deaf.Deaftarget, Deaf.Undeaftarget, Deaf.List, Butcher, KillAll, RemoveAll, Vanish, Vanish.Vanished, Vanish.Unvanished, Vanish.Vanishtarget, Vanish.Unvanishtarget, Vanish.Forever, More, Say, Say.Usage, Ping, Ping.Message, Nick, Nick.Usage, Nick.Message, Nick.MessageOthers, Nick.NonAlpha, Spawnmob, Spawnmob.MobNotFound, Spawnmob.PropertyNotCompitable, Powertool, Powertool.NoItemInHand, Powertool.CommandSet, Powertool.CommandReset, Enchant, Enchant.Usage, Enchant.EnchantNotFound, Enchant.NoItemInHand, Enchant.Succes, Effect, Effect.Usage, Effect.EffectNotFound, Effect.AmountNotValid, Effect.Succes, Effect.Clear, Give, Give.Usage, Give.Usage2, Give.ItemNotFound, Give.InventoryFull, Give.AmountNotValid, Give.MetadataFailed, Give.Succes, Give.SuccesSelf, Top, Top.Succes, Top.Failed, XP, XP.Show, XP.Give, XP.Take, XP.Tip, XP.Set, XP.Usage, XP.Usage2, XP.AmountNotValid, Damage, Hunger, Hunger.Usage, Hunger.Run, Sethealth, Sethunger, Setarmor, Setarmor.Usage, Setarmor.Set, Setarmor.To, Setarmor.NotFound, Seen, Seen.Usage, Seen.Message1, Seen.NotFound, Seen.Location, Seen.Banned, Seen.Bantime, Seen.Banreason, Seen.Muted, Seen.Mutetime, Seen.Deaf, Seen.Deaftime, Seen.Jailed, Seen.Jailtime, Seen.Frozen, Alert, Alert.Usage, Alert.Format, Coords, Coords.Self, Coords.Other, Jail, Jail.Usage, Jail.List, Jail.Unjail, Jail.AlreadyJailed, Jail.NotJailed, Jail.NotFound, Jail.JailTarget, Jail.JailSender, Jail.UnjailSender, Jail.Usage2, Jail.Usage3, Jail.Usage4, Jail.JailSet, Jail.JailRemoved, Jail.CantUseCommands, Jail.List2, GC, Skull, Spawner, Spawner.Usage, Spawner.NotLooking, Spawner.NotFound, Spawner.Set]
    getValues(true)
    Code:
    {JoinMessage=&6%Player &9joined the game., LeaveMessage=&6%Player &9left the game., FirstJoin=&6%Player &5joined the server for the first time!, WhitelistMessage=&9You have not been whitelisted on this server, FullMessage=&9The server is full. Try again later., DeathMessages=MemorySection[path='DeathMessages', root='YamlConfiguration'], DeathMessages.Player=&6%Killer &9killed &6%Killed &9with &9%Weapon., DeathMessages.Cactus=&6%Player &9has been killed by a cactus., DeathMessages.TNT=&6%Player &9was blown up by TNT., DeathMessages.Drowning=&6%Player &9drowned., DeathMessages.Fall=&6%Player &9fell to death., DeathMessages.Fire=&6%Player &9burned to death., DeathMessages.Suffocated=&6%Player &9suffocated., DeathMessages.OutOfWorld=&6%Player &9fell out of the world., DeathMessages.Hunger=&6%Player &9starve to their death., DeathMessages.Suicide=&6%Player &9comitted suicide., DeathMessages.Potion=&6%Player &9has been killed by a potion., DeathMessages.Lightning=&6%Player &9got smited by lightning., DeathMessages.Lava=&6%Player &9tried to swim in lava., DeathMessages.Enderpearl=&6%Player &9died by an enderpearl., DeathMessages.Fireball=&6%Player &9died by a fireball., DeathMessages.Projectile=&6%Player &9died by a projectile, DeathMessages.EnderCrystal=&6%Player &9died by a ender crystal, DeathMessages.Zombie=&6%Player &9has been killed by a Zombie., DeathMessages.ZombiePigMan=&6%Player &9has been killed by a Zombie Pigman., DeathMessages.Skeleton=&6%Player &9has been killed by a Skeleton., DeathMessages.Creeper=&6%Player &9has been killed by a Creeper., DeathMessages.Ghast=&6%Player &9has been killed by a Ghast., DeathMessages.Blaze=&6%Player &9has been killed by a Blaze., DeathMessages.Slime=&6%Player &9has been killed by a Slime., DeathMessages.MagmaCube=&6%Player &9has been killed by a Magma Cube., DeathMessages.Wolf=&6%Player &9has been killed by a Wolf., DeathMessages.Spider=&6%Player &9has been killed by a Spider., DeathMessages.CaveSpider=&6%Player &9has been killed by a Cave Spider., DeathMessages.Silverfish=&6%Player &9has been killed by a Silver Fish., DeathMessages.Enderman=&6%Player &9has been killed by an Enderman., DeathMessages.EnderDragon=&6%Player &9has been killed by The Enderdragon., DeathMessages.Wither=&6%Player &9has been killed by the Wither., DeathMessages.WitherSkeleton=&6%Player &9has been killed by a Wither Skeleton., DeathMessages.IronGolem=&6%Player &9has been killed by an Iron Golem., DeathMessages.Unknown=&6%Player &9died., UnknownCommandMessage=Command not found., NeedToBePlayer=The console cannot use this command., NoPermissions=You do not have permissions to execute this command., PlayerNotFound=Player not found: @2%Player., AntiBan=You may not %Action %Player, NumberFormat=The amount (@2%Amount@1) is not a number!, Words=MemorySection[path='Words', root='YamlConfiguration'], Words.Premium=premium, Words.NotPremium=not premium, Words.true=Yes, Words.false=No, AccountStatus=MemorySection[path='AccountStatus', root='YamlConfiguration'], AccountStatus.Usage=@1/accountstatus @2<Player>, AccountStatus.FailedSupport=@1System does not support UTF-8, AccountStatus.FailedConnect=@1Failed to connect to the Minecraft Servers, AccountStatus.Succes=@1Account @2%Account @1is %Status, Afk=MemorySection[path='Afk', root='YamlConfiguration'], Afk.Afk=&6%Player &9is now afk., Afk.Unafk=&6%Player &9is no longer afk., Afk.Kick=You have been kicked for being afk for too long, EditSign=MemorySection[path='EditSign', root='YamlConfiguration'], EditSign.Usage=@1/editsign @2<1-4> [Text], EditSign.Clear=@1Cleared line @2%Line@1., EditSign.Set=@1Line @2%Line @1set to @2%Text, Warp=MemorySection[path='Warp', root='YamlConfiguration'], Warp.NoWarpsFound=No warps found., Warp.Warps=Warps: @2%Warps., Warp.Warped=Warped to: @2%Warp., Warp.WarpNotExist=Warp does not exist! (@2%Warp@1)., Warp.Warpset=Warp set: @2%Warp, Warp.Warpmoved=Warp moved: @2%Warp, Warp.WarpDeleted=Warp deleted: @2%Warp, Home=MemorySection[path='Home', root='YamlConfiguration'], Home.Usage=@1/sethome @2<Name>, Home.Usage2=@1/delhome @2<Name>, Home.NoHomesFound=No homes found, Home.Homes=Homes: @2%Homes, Home.Hometp=Teleported to: @2%Home, Home.HomeNotExist=Home does not exist! (@2%Home@1), Home.Homeset=Home set: @2%Home, Home.Homemoved=Home moved: @2%Home, Home.HomeDeleted=Home deleted: @2%Home, Weather=MemorySection[path='Weather', root='YamlConfiguration'], Weather.Set=Weather set to @2%Weather, Weather.Usage=/weather @2sun/rain/thunder, Back=Teleported back, Whisper=MemorySection[path='Whisper', root='YamlConfiguration'], Whisper.Usage=@1/w @2<Player> <Message>, Whisper.Usage2=@1/r @2<Player> <Message>, Speed=MemorySection[path='Speed', root='YamlConfiguration'], Speed.Usage=@1/speed @2<0-10> [Player], Speed.Self=Walk/Fly speed set to: @2%Speed, Speed.OtherSelf=Walk/Fly speed of @2%Player @1set to @2%Speed, Speed.OtherOther=Your walk/fly speed has been set to: @2%Speed, Hat=Here is your new hat!, Save=MemorySection[path='Save', root='YamlConfiguration'], Save.Start=Saving the world..., Save.Done=Save complete!, Time=Time set to: @2%Time, Stop=MemorySection[path='Stop', root='YamlConfiguration'], Stop.Stop=[@2%Player@1] @1stopping the server..., Stop.StandardKickMessage=%Player @1stopped the server, Reload=MemorySection[path='Reload', root='YamlConfiguration'], Reload.Start=[@2%Player@1] @1Reloading the server..., Reload.Done=[@2%Player@1] @1Reload complete!, Tp=MemorySection[path='Tp', root='YamlConfiguration'], Tp.Tpa=MemorySection[path='Tp.Tpa', root='YamlConfiguration'], Tp.Tpa.Send=Request send to: @2%Player, Tp.Tpa.TpaTarget1=@1%Player @2has requested to teleport to you!, Tp.Tpa.TpaTarget1_HERE=@1%Player @2has requested to teleport you to him!, Tp.Tpa.TpaTarget2=@2Type: @1/tpaccept @2if you want to accept, Tp.Tpa.TpaTarget3=@2Type: @1/tpdeny @2if you want to deny, Tp.Tpa.NoRequests=@1No pending requests, Tp.Tpa.AcceptSender=@1Your teleport request of @2%Player @1has been accepted, Tp.Tpa.AcceptTarget=@1Teleport request successfully accepted, Tp.Tpa.DenySender=@1Teleport request successfully denied, Tp.Tpa.DenyTarget=@1The teleport request of @2%Player @1has been denied, Tp.Tp1=Teleported to @2%Player, Tp.Tp2=Teleported @2%Player1 @1to @2%Player2, Tp.Tp3=Teleported to @2%x %y %z, Tp.Tp4=Teleported @2%Player @1to @2%x %y %z, Plugin=MemorySection[path='Plugin', root='YamlConfiguration'], Plugin.SuccesUnload=Successfully unloaded plugin: @2%Plugin, Plugin.SuccesLoad=Successfully loaded plugin: @2%Plugin, Plugin.SuccesEnable=Successfully enabled plugin: @2%Plugin, Plugin.SuccesDisable=Successfully disabled plugin: @2%Plugin, Plugin.SuccesRestart=Successfully restarted plugin: @2%Plugin, Plugin.SuccesReload=Successfully reloaded plugin: @2%Plugin, Plugin.AlreadyDisabled=Plugin already disabled, Plugin.AlreadyEnabled=Plugin already enabled, Plugin.Error=ERROR. Try again., Plugin.NotFound=Plugin not found: @2%Plugin, Plugin.UsageInfo=@1/plugin @2info <Plugin> @1- Info about plugin, Plugin.UsageEnable=@1/plugin @2enable <Plugin> @1- Enable a plugin, Plugin.UsageDisable=@1/plugin @2disable <Plugin> @1- Disable a plugin, Plugin.UsageLoad=@1/plugin @2load <Plugin> @1- Load a plugin, Plugin.UsageUnload=@1/plugin @2unload <Plugin> @1- Unload a plugin, Plugin.UsageReload=@1/plugin @2reload <Plugin> @1- Reloads a plugin, Realname=MemorySection[path='Realname', root='YamlConfiguration'], Realname.Usage=@1/realname @2<Player>, Realname.Message=@1Real name of %Nick: @2%Name, Gamemode=MemorySection[path='Gamemode', root='YamlConfiguration'], Gamemode.Usage=@1/gm @2<Gamemode> [Player], Gamemode.setSelf=Gamemode set to: @2%Gamemode, Gamemode.selfMessage=Gamemode of @2%Player @1set to: @2%Gamemode, Gamemode.otherMessage=Your gamemode has been set to: @2%Gamemode, Fly=MemorySection[path='Fly', root='YamlConfiguration'], Fly.Message=Fly mode is now @2%Status, Fly.toSelf=Fly mode from @2%Player @1is now @2%Status, Fly.toOther=Fly mode is now @2%Status, God=MemorySection[path='God', root='YamlConfiguration'], God.forSelf=God mode is now @2%Status, God.selfMessage=God mode from @2%Player @1is now @2%Status, God.otherMessage=God mode is now @2%Status, Repair=MemorySection[pat
    [13:22:27] [Server thread/INFO]: h='Repair', root='YamlConfiguration'], Repair.forSelf=Repaired all items, Repair.selfMessage=Repaired all items of @2%Player, Repair.otherMessage=Your items have been repaired, Repair.forSelfMode=Repair mode is now @2%Status, Repair.selfMessageMode=Repair mode from @2%Player @1is now @2%Status, Repair.otherMessageMode=Repair mode is now @2%Status, Feed=MemorySection[path='Feed', root='YamlConfiguration'], Feed.forSelf=You saturated yourself, Feed.selfMessage=You saturated @2%Player, Feed.otherMessage=You have been saturated, Feed.forSelfMode=Feed mode is now @2%Status, Feed.selfMessageMode=Feed mode from @2%Player @1is now @2%Status, Feed.otherMessageMode=Feed mode is now @2%Status, Clear=MemorySection[path='Clear', root='YamlConfiguration'], Clear.SelfMessage=Your inventory is cleared!, Clear.ToSelf=You have cleared the inventory of: @2%Player, Clear.ToOther=Your inventory has been cleared by: @2%Player, Invsee=MemorySection[path='Invsee', root='YamlConfiguration'], Invsee.Usage=@1/inv @2 <Player>, IP=MemorySection[path='IP', root='YamlConfiguration'], IP.Server=@1Server IP: @2%IP, IP.Player1=@1%Player Hostname: @2%Hostname, IP.Player2=@1%Player IP: @2%IP, Heal=MemorySection[path='Heal', root='YamlConfiguration'], Heal.Message=You have been healed!, Heal.ToSelf=You have healed @2%Player, Heal.ToOther=You have been healed by @2%Player, Extinguish=MemorySection[path='Extinguish', root='YamlConfiguration'], Extinguish.Message=You have been Extinguished!, Extinguish.ToSelf=You have extinguished @2%Player, Extinguish.ToOther=You have been extinguished by @2%Player, Kill=MemorySection[path='Kill', root='YamlConfiguration'], Kill.Suicide=You suicided!, Kill.target=You have been killed by: @2%Player, Kill.killer=You killed: @2%Player, Set=MemorySection[path='Set', root='YamlConfiguration'], Set.Spawn=Spawn set!, Set.SpawnNotSet=Spawn is not set., World=MemorySection[path='World', root='YamlConfiguration'], World.Create=MemorySection[path='World.Create', root='YamlConfiguration'], World.Create.Created=Created world: @2%world, World.Create.Creating=Creating world: @2%world, World.Create.Usage=@1/world @2create <Name> [Options...], World.List=Worlds: @2%worlds, World.Import=MemorySection[path='World.Import', root='YamlConfiguration'], World.Import.Importing=Importing world: @2%world, World.Import.Imported=Imported world: @2%world, World.Import.Usage=@1/world @2import <Name> [Normal/Nether/End], World.Remove=Removed world: @2%world, World.NotFound=World not found: @2%world, World.AlreadyExist=World does already exist, World.NotAlpha=World name is not alphanumeric, Me=MemorySection[path='Me', root='YamlConfiguration'], Me.Usage=@1/me @2<Message>, List=MemorySection[path='List', root='YamlConfiguration'], List.List=@1There are @2%Online@1/@2%Max @1players online: \n@2%List, Ban=MemorySection[path='Ban', root='YamlConfiguration'], Ban.Usage=@1/ban @2<Player> [Time] [Reason], Ban.Usage2=@1/unban @2<Player>, Ban.Message=You have been banned.\n Time left: @2%Time @1Reason: @2%Reason, Ban.StandardReason=@2no reason given, Ban.TimeForever=@2forever, Ban.Broadcast=@2%Banner @1banned @2%Banned@1. Time: @2%Time @1Reason: @2%Reason, Ban.BroadcastUnban=@2%Unbanner @1unbanned @2%Banned., Ban.joinAfterUnban=Welcome back after your ban!, Ban.NotBanned=Player @2%Player @1is not banned., Ban.List=There are @2%Amount @1players banned: @2%Banned, Kick=MemorySection[path='Kick', root='YamlConfiguration'], Kick.Usage=@1/kick @2<Player> [Reason], Kick.KickMessage=You have been kicked. Reason: @2%Reason., Kick.StandardReason=@2No reason given!, Kick.Broadcast=@1%Kicker @2kicked player: @1%Player, Kick.Broadcast2=Reason: @2%Reason, Freeze=MemorySection[path='Freeze', root='YamlConfiguration'], Freeze.Usage=@1/freeze @2<Player>, Freeze.Usage2=@1/unfreeze @2<Player>, Freeze.Freezed=You froze @2%Player, Freeze.Unfreezed=You unfroze @2%Player, Freeze.MoveMessage=You are frozen!, Freeze.List=There are @2%Amount @1frozen players: %Frozen, Mute=MemorySection[path='Mute', root='YamlConfiguration'], Mute.Usage=@1/mute @2<Player> [Time], Mute.Usage2=@1/unmute @2<Player> [Time], Mute.Muted=You muted: @2%Player, Mute.Unmuted=You unmuted: @2%Player, Mute.Mutetarget=You have been muted, Mute.Unmutetarget=You have been unmuted, Mute.Forever=forever, Mute.ChatMessage=You are muted! (@2Forever@1), Mute.ChatMessageTime=You are muted! (@2%Time left@1), Mute.List=There are @2%Amount @1mutes: %List, Deaf=MemorySection[path='Deaf', root='YamlConfiguration'], Deaf.Usage=@1/deaf @2<Player> [Time], Deaf.Usage2=@1/undeaf @2<Player> [Time], Deaf.Deaf=You made @2%Player @1deaf., Deaf.Undeaf=You made @2%Player @1no longer deaf., Deaf.Deaftarget=You are now deaf, Deaf.Undeaftarget=You are no longer deaf, Deaf.List=There are @2%Amount @1deaf players: %List, Butcher=Killed @2%Amount @1monsters in a radius of @2%Radius, KillAll=Killed @2%Amount @1mobs in a radius of @2%Radius, RemoveAll=Killed @2%Amount @1entities in a radius of @2%Radius, Vanish=MemorySection[path='Vanish', root='YamlConfiguration'], Vanish.Vanished=You vanished: @2%Player @1(@2%Time@1), Vanish.Unvanished=You unvanished: @2%Player, Vanish.Vanishtarget=You have been vanished, Vanish.Unvanishtarget=You have been unvanished, Vanish.Forever=@2forever, More=You have now 64 of the item in your hand!, Say=MemorySection[path='Say', root='YamlConfiguration'], Say.Usage=@1/say @2[Message], Ping=MemorySection[path='Ping', root='YamlConfiguration'], Ping.Message=@1Ping of %Player: @2%Ping, Nick=MemorySection[path='Nick', root='YamlConfiguration'], Nick.Usage=@1/nick @2<Name>/off [Player], Nick.Message=Nickname of %Player set to: @2%Name, Nick.MessageOthers=The player @2%Player @1has set your nickname to: @2%Name, Nick.NonAlpha=Name is not alphanumeric., Spawnmob=MemorySection[path='Spawnmob', root='YamlConfiguration'], Spawnmob.MobNotFound=Mob not found: @2%Mob, Spawnmob.PropertyNotCompitable=Property @2%Property @1not compitable with @2%Type, Powertool=MemorySection[path='Powertool', root='YamlConfiguration'], Powertool.NoItemInHand=You must have an item in your hand for powertool, Powertool.CommandSet=Powertool set: @2%Item @1> @2%Command, Powertool.CommandReset=Powertool reset: @2%Item @1cleared, Enchant=MemorySection[path='Enchant', root='YamlConfiguration'], Enchant.Usage=@1/enchant @2<Enchantment> [Level], Enchant.EnchantNotFound=Enchantment not found: @2%Enchant, Enchant.NoItemInHand=No item in hand to enchant!, Enchant.Succes=Succesfull added @2%Enchant @1level @2%Level @1to your @2%Item, Effect=MemorySection[path='Effect', root='YamlConfiguration'], Effect.Usage=@1/effect @2<Player> <Effect/Clear> [Duration] [Level], Effect.EffectNotFound=Effect not found: @2%Effect, Effect.AmountNotValid=The amount (@2%Amount@1) is not a number!, Effect.Succes=Succesfull given @2%Target @1effect @2%Effect @1level @2%Level @1for @2%Duration @1seconds, Effect.Clear=Succesfull cleared all effects off @2%Target, Give=MemorySection[path='Give', root='YamlConfiguration'], Give.Usage=@1/give @2<Player> <Item> [Amount] [Data...], Give.Usage2=@1/item @2<Item> <Amount> [Data...], Give.ItemNotFound=Item not found: @2%Item@1., Give.InventoryFull=Targets inventory is full!, Give.AmountNotValid=The amount (@2%Amount@1) is not a number!, Give.MetadataFailed=The metadata parsing failed, Give.Succes=Given @2%Amount @1of @2%Item @1to @2%Player, Give.SuccesSelf=Given @2%Amount @1of @2%Item @1to yourself!, Top=MemorySection[path='Top', root='YamlConfiguration'], Top.Succes=Teleported to the highest block!, Top.Failed=Failed to teleport. Hole in the floor?, XP=MemorySection[path='XP', root='YamlConfiguration'], XP.Show=@1%Player xp: @2%XP@1, %Player levels: @2%Levels, XP.Give=Given @2%XP %Type @1to %Player, XP.Take=Taken @2%XP %Type @1from %Player, XP.Tip=&7Tip: If you want to give/take levels use %Command1L%Command2, XP.Set=Set %Type of @2%Player @1to @2%XP, XP.Usage=/setxp @2<XP> [Player], XP.Usage2=/setlevel @2<LEVEL> [Player], XP.AmountNotValid=The amount (@2%Amount@1) is not a number!, Damage=Damaged @2%Player @1for @2%Health @2health, Hunger=MemorySection[path='Hunger', root='YamlConfiguration'], Hunger.Usage=@1/hunger @2<Amount> [Player], Hunger.Run=Removed @2%Hunger @
    [13:22:27] [Server thread/INFO]: 1hunger of @2%Player, Sethealth=Set health of @2%Player @1to @2%Health, Sethunger=Set hunger of @2%Player @1to @2%Food, Setarmor=MemorySection[path='Setarmor', root='YamlConfiguration'], Setarmor.Usage=/setarmor @2<ArmorType> [Player], Setarmor.Set=Set armor of @2%Player @1to @2%Armor, Setarmor.To=@2%Player @1set your armor to @2%Armor, Setarmor.NotFound=ArmorType not found: @2%Armor, Seen=MemorySection[path='Seen', root='YamlConfiguration'], Seen.Usage=@1/seen @2<Player>, Seen.Message1=@1Player @2%Player @1is @2%Status @1since @2%Time, Seen.NotFound=@1The player @2%Player @1has never joined this server., Seen.Location=@1- Last location: @2%Location, Seen.Banned=@1- Banned: %Banned, Seen.Bantime=@1 - Bantime left: @2%Bantime, Seen.Banreason= - Banreason: @2%Reason, Seen.Muted=- Muted: %Muted, Seen.Mutetime= - Mutetime left: @2%Mutetime, Seen.Deaf=- Deaf: %Deaf, Seen.Deaftime= - Deaftime left: @2%Deaftime, Seen.Jailed=- Jailed: %Jailed, Seen.Jailtime= - Jailtime left: @2%Jailtime, Seen.Frozen=- Frozen: %Frozen, Alert=MemorySection[path='Alert', root='YamlConfiguration'], Alert.Usage=@1/alert @2<Message>, Alert.Format=&0[&4&lALERT&0] @2%Message, Coords=MemorySection[path='Coords', root='YamlConfiguration'], Coords.Self=Your location: @2%Location, Coords.Other=%Players location: @2%Location, Jail=MemorySection[path='Jail', root='YamlConfiguration'], Jail.Usage=@1/jail @2<Player> [Time] [Jail], Jail.List=@1Jails: @2%Jails, Jail.Unjail=@1You have been unjailed., Jail.AlreadyJailed=%Player is already jailed!, Jail.NotJailed=%Player is not jailed!, Jail.NotFound=Jail not found: %Jail, Jail.JailTarget=You have been jailed for @2%Time, Jail.JailSender=Jailed @2%Player in jail @2%Jail @1for @2%Time, Jail.UnjailSender=Unjailed @2%Player, Jail.Usage2=@1/unjail @2<Name>, Jail.Usage3=@1/setjail @2<Name>, Jail.Usage4=@1/deljail @2<Name>, Jail.JailSet=@1Jail set: @2%Name, Jail.JailRemoved=@1Jail removed: @2%Name, Jail.CantUseCommands=@1You cant use commands while jailed!, Jail.List2=There are @2%Amount @1jailed players: @2%List, GC=Garbage Collector has been runned!, Skull=You obtained the head of @2%Player, Spawner=MemorySection[path='Spawner', root='YamlConfiguration'], Spawner.Usage=@1/spawner @2<MobType>, Spawner.NotLooking=You are not looking at a mob spawner!, Spawner.NotFound=MobType not found: @2%MobType, Spawner.Set=Spawner set to: @2%Name}
    getDefaults()
    Code:
    null
    I was looking at the results and saw this:
    Words, Words.Premium, Words.NotPremium, Words.true, Words.false
    Wat is weird because the file looks like this:
    Code:java
    1. Words:
    2. Premium: 'premium'
    3. NotPremium: 'not premium'
    4. Yes: 'Yes'
    5. No: 'No'

    I think this is problem solved, because I need to use Words.true.
    But can anyone explain me why?


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  12. Offline

    xize

    Bammerbom

    I actually really don't know why Words.true would work, perhaps that does something like getConfiguration().getKeys(true) and that prints it like a array?, but what I don't understand is you actually do .getString("Words.Yes"); this should work if that doesn't I'm wondering if the children values of that key have case insentity problems try to use it as lowercase.

    normally I use File f = new File(getDataFolder() + File.Seperator + "Messages" + File.Seperator + "EN.yml"); rather than using that comma there, that comma is ment to define the difference between the folder and the file, so that would like something like this:

    File f = new File(getDataFolder() + File.Seperator + "Messages", "EN.yml"); left is the folder, right is the file, both methods should do the same.

    -edit-
    I may see the issue, I see you have made an commentary tag "#Words" just above the main key, that may cause a problem it may doesn't but it could.
     
  13. Offline

    Syd

    Bammerbom
    I understood your problem a bit wrong, I assumed it does not work with any string. ;)

    However, your outputs make everything clear.
    Keys like yes, no, on and off are reserved by the YAML standard for bools, this is why Words.Yes results to Words.true in the parsed YAML file.
    To let it be actually "Yes" you have to put it in ' ', then it will be identified as String. (I think so)

    Pretty strange thing :D
     
Thread Status:
Not open for further replies.

Share This Page