PermissionsEx getPrefix() stops working on reload.

Discussion in 'Plugin Development' started by EnderLance, Apr 22, 2014.

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

    EnderLance

    So for compatibility reasons with my other custom plugins, I'm trying to make my own Chat plugin. It works pretty well so far, except that PEX group prefixes reset to null on reload. What I mean is that I have to reassign a prefix to every group every time PEX reloads, through /reload or /pex reload.

    This is my code:

    Here is the line which gets the sender's prefix.
    Code:java
    1. String senderGroupPrefix = PermissionsEx.getUser(sender).getPrefix();


    And even here, the problem occurs. The very next line is
    Code:java
    1. plugin.getLogger().info(sender.getName()+"'s prefix is "+senderGroupPrefix);


    And the console shows that I have no prefix. I checked my PermissionsEx permissions.yml file and the group I'm in does have a prefix. So in-game, I run /pex group admin prefix &f[&cAdministrator&f]&r and then the prefix works again. Then I run /pex reload and it's gone.

    Any ideas?

    Thanks,

    EnderLance
     
  2. I'd recommend using Vault and hooking into that. It has chat.getPlayerPrefix() or something.
     
    EnderLance likes this.
  3. Offline

    EnderLance

    Thanks I'll try that! :D
     
  4. Offline

    Gamecube762

    I also recommend not /reloading. Most plugins end up glitching when reloading(PEX being one of them).
     
    KingFaris11 likes this.
  5. Offline

    EnderLance

    The same thing happens when I use vault. Anybody knows what's causing this?
     
  6. Offline

    ZachBora

    I would say PEX is the problem.
     
    EnderLance and KingFaris11 like this.
  7. What ZachBora said. You've probably got the wrong builds of Pex for your version of CraftBukkit, update both to the latest.
     
    EnderLance likes this.
  8. Offline

    EnderLance


    Thanks guys, it works now. :D
     
    KingFaris11 likes this.
Thread Status:
Not open for further replies.

Share This Page