Per-Player Config (Access from other classes)?

Discussion in 'Plugin Development' started by Potatoez_, May 24, 2017.

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

    Potatoez_

    Hello all, I am writing a big plugin similar to Essentials, and I need a per-player data file that is accessible from all classes. This file will contain the player's nickname, username and uuid stuff, etc.. But the big thing I need is multiple class access. Any suggestions?
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Potatoez_ Put them in a variable in the main class.
    Make sure that all handling classes can access the main class.
     
  3. Offline

    S1ant

    @Potatoez_ You could just use the normal Config.yml and make it like this:
    Code:
    S1ant:
      UUID: fsfsfsdfsdfsdfsdfs
      nickname: &4S1ant
      username: S1ant
    You would access it using, getConfig().get("S1ant.nickname");
     
  4. But how could you access other config files? You probably can't access getConfig()

    Sent from my E2303 using Tapatalk
     
  5. Offline

    Potatoez_

    Thanks, everyone!
     
Thread Status:
Not open for further replies.

Share This Page