MessageManager Help

Discussion in 'Plugin Development' started by bramhaag, Feb 20, 2014.

Thread Status:
Not open for further replies.
  1. Hi guys,

    I've a problem. I want to create an message manager, but i don't know how.

    What i want:

    I want to use this at an random class. "p.sendMessage(MessageManager.noPermsMessage);". And in the MessageManager class i will set the value of noPermsMessage to plugin.getConfig().getString("no-perms-message);

    So i hope someone can help me with this.

    Kind Regards,

    -Bramhaag
     
  2. Offline

    alex123099

    I don't understand what your plugin is supposed to do:
    "I want to use this at an random class. "p.sendMessage(MessageManager.noPermsMessage);". "
    What do you mean by that?
     
  3. I want to send that in an e.g an command. So i do p.sendMessage(MessageManager.noPermsMessage); And in the MessageManager class is the noPermsMessage located with the value of plugin.getConfig.getString("no-perms-message")
    Get it? alex123099
     
  4. Offline

    alex123099

    bramhaag
    Ok, so what is the problem?
     
  5. Offline

    alex123099

    bramhaag
    Oh, ok, so you just create a class, called MesageManager.
    In that class you create static, probably final, strings, and you set values to them.
    For you it will be:
    public static final String noPermsMessage = plugin.getConfig().getString("no-perms-message");

    BUT, before any string declarations, you will have to figure out a way to make an object that will be a reference to your class that extends JavaPlugin. You could make either a seperate config handler for that or create an instance of the extends JavaPlugin class in that class and use that, use your imagination.
     
  6. alex123099
    Thanks, i will try this out tomorrow :) I let you know if it worked
     
Thread Status:
Not open for further replies.

Share This Page