PexAPI get Prefix doesn't work

Discussion in 'Plugin Development' started by MordorKing78, Jan 15, 2017.

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

    MordorKing78

    How would I obtain a player's prefix with the api?
     
  2. @MordorKing78
    I wouldn't use the PEX API directly, I'd use Vault. It's much more reliable and it'll give you compatibility with nearly all prefix plugins, not just PEX.
     
  3. Offline

    MordorKing78

    @AlvinB I'd be able to get the prefix of a player using the Vault API? Let me try.
     
  4. Offline

    MordorKing78

    @AlvinB I never knew that Vault had something to do with chat and prefix/suffixes, I would just use setupChat() instead of setupEconomy(), wouldn't I?
     
  5. @MordorKing78
    Correct.

    (Although to be perfectly honest, I wouldn't use the example methods, as they are rather cluttery, I usually write my own).
     
  6. Offline

    MordorKing78

    @AlvinB It's giving me a NullPointerException when I set the format like this,
    Code:
                e.setFormat(plugin.chat.getPlayerPrefix(p) + " §c[" + plugin.eloManager.getFormat(p) + "§c] §8»§r " + e.getMessage());                       
    
     
  7. Offline

    MordorKing78

    Hastebin: https://hastebin.com/etewexodup.vbs


    PHP:
    [22:57:01 ERROR]: Could not pass event AsyncPlayerChatEvent to KitPVP v0.1
    org
    .bukkit.event.EventException
            at org
    .bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va
    :305) ~[craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a
    :62) ~[craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava
    :502) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava
    :484) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            
    at net.minecraft.server.v1_8_R2.PlayerConnection.chat(PlayerConnection.j
    ava
    :1055) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            
    at net.minecraft.server.v1_8_R2.PlayerConnection.a(PlayerConnection.java
    :993) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            
    at net.minecraft.server.v1_8_R2.PacketPlayInChat$1.run(PacketPlayInChat.
    java:39) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
    ?:
    1.8.0_101]
            
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_101]
            
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:
    1.8.0_101]
            
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?
    :
    1.8.0_101]
            
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    Caused byjava.lang.NullPointerException
            at org
    .m.KitPVP.Listener.ChatListener.onChat(ChatListener.java:22) ~[?:?
    ]
            
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
    _101
    ]
            
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
    _101
    ]
            
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .8.0_101
    ]
            
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
            
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va
    :301) ~[craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            ... 
    11 more
     
  8. @MordorKing78
    plugin.chat or plugin.eloManager is null. Print out these values to see which one is the problem.
     
  9. Offline

    MordorKing78

    @AlvinB its plugin.chat (Vault API) thats returning null.
     
  10. Offline

    JanTuck

    http://milkbowl.github.io/VaultAPI/


    From their example

    Code:java
    1.  
    2. public static Chat chat = null;
    3.  
    4. In the onEanble method.
    5.  
    6. RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class);
    7. chat = rsp.getProvider();
    8.  
    9.  
     
  11. Offline

    MordorKing78

    @JanTuck I already had something like that, it's still not working.

    Logs
    Show Spoiler


    HTML:
    [21:37:04 INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [21:37:04 INFO]: Max TNT Explosions: 100
    [21:37:04 INFO]: Sending up to 10 chunks per packet
    [21:37:04 INFO]: Zombie Aggressive Towards Villager: true
    [21:37:04 INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617
    [21:37:04 INFO]: Max Entity Collisions: 8
    [21:37:04 INFO]: -------- World Settings For [world_the_end] --------
    [21:37:04 INFO]: Arrow Despawn Rate: 1200
    [21:37:04 INFO]: Item Despawn Rate: 6000
    [21:37:04 INFO]: Item Merge Radius: 2.5
    [21:37:04 INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [21:37:04 INFO]: View Distance: 10
    [21:37:04 INFO]: Chunks to Grow per Tick: 650
    [21:37:04 INFO]: Clear tick list: false
    [21:37:04 INFO]: Experience Merge Radius: 3.0
    [21:37:04 INFO]: Random Lighting Updates: false
    [21:37:04 INFO]: Structure Info Saving: true
    [21:37:04 INFO]: Cactus Growth Modifier: 100%
    [21:37:04 INFO]: Cane Growth Modifier: 100%
    [21:37:04 INFO]: Melon Growth Modifier: 100%
    [21:37:04 INFO]: Mushroom Growth Modifier: 100%
    [21:37:04 INFO]: Pumpkin Growth Modifier: 100%
    [21:37:04 INFO]: Sapling Growth Modifier: 100%
    [21:37:04 INFO]: Wheat Growth Modifier: 100%
    [21:37:04 INFO]: Nerfing mobs spawned from spawners: false
    [21:37:04 INFO]: Mob Spawn Range: 4
    [21:37:04 INFO]: Anti X-Ray: true
    [21:37:04 INFO]:        Engine Mode: 1
    [21:37:04 INFO]:        Hidden Blocks: [14, 15, 16, 21, 48, 49, 54, 56, 73, 74,
    82, 129, 130]
    [21:37:04 INFO]:        Replace Blocks: [1, 5]
    [21:37:04 INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
    [21:37:04 INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    
    [21:37:04 INFO]: Hopper Transfer: 8 Hopper Check: 8 Hopper Amount: 1
    [21:37:04 INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [21:37:04 INFO]: Max TNT Explosions: 100
    [21:37:04 INFO]: Sending up to 10 chunks per packet
    [21:37:04 INFO]: Zombie Aggressive Towards Villager: true
    [21:37:04 INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617
    [21:37:04 INFO]: Max Entity Collisions: 8
    [21:37:04 INFO]: [Essentials] Disabling Essentials v2.0.1-b${BUILD_NUMBER}
    [21:37:04 INFO]: [Vault][Economy] Essentials Economy unhooked.
    [21:37:04 INFO]: [Citizens] Disabling Citizens v2.0.16-SNAPSHOT (build 1267)
    [21:37:04 INFO]: [FeatherBoard] Disabling FeatherBoard v3.11.1
    [21:37:04 INFO]: [FeatherBoard] Cancelling all tasks ...
    [21:37:04 INFO]: [WorldGuard] Disabling WorldGuard v6.1.3-SNAPSHOT;c904242
    [21:37:04 INFO]: [WorldGuard] Shutting down executor and waiting for any pending
    tasks...
    [21:37:04 INFO]: [MultiCurrency] Disabling MultiCurrency v2.1
    [21:37:04 INFO]: [Vault][Economy] MultiCurrency unhooked.
    [21:37:04 INFO]: [MultiCurrency] disabling
    [21:37:04 INFO]: [KitPVP] Disabling KitPVP v0.1
    [21:37:04 INFO]: [Vault] Disabling Vault v1.5.6-b49
    [21:37:04 INFO]: [MVdWPlaceholderAPI] Disabling MVdWPlaceholderAPI v1.0.0
    [21:37:04 INFO]: [WorldEdit] Disabling WorldEdit v6.1;no_git_id
    [21:37:04 INFO]: [WorldEdit] Loading WorldEdit v6.1;no_git_id
    [21:37:04 INFO]: [MVdWPlaceholderAPI] Loading MVdWPlaceholderAPI v1.0.0
    [21:37:04 INFO]: [Vault] Loading Vault v1.5.6-b49
    [21:37:04 INFO]: [KitPVP] Loading KitPVP v0.1
    [21:37:04 INFO]: [MultiCurrency] Loading MultiCurrency v2.1
    [21:37:04 INFO]: [WorldGuard] Loading WorldGuard v6.1.3-SNAPSHOT;c904242
    [21:37:04 INFO]: [FeatherBoard] Loading FeatherBoard v3.11.1
    [21:37:04 INFO]: [Citizens] Loading Citizens v2.0.16-SNAPSHOT (build 1267)
    [21:37:04 INFO]: [Essentials] Loading Essentials v2.0.1-b${BUILD_NUMBER}
    [21:37:04 INFO]: [EssentialsChat] Loading EssentialsChat vTeamCity
    [21:37:04 INFO]: [Vault] Enabling Vault v1.5.6-b49
    [21:37:04 INFO]: [Vault] [Economy] MultiCurrency found: Waiting
    [21:37:04 INFO]: [Vault] [Economy] Essentials Economy found: Waiting
    [21:37:04 INFO]: [Vault] [Permission] SuperPermissions loaded as backup permissi
    on system.
    [21:37:04 INFO]: [Vault] Enabled Version 1.5.6-b49
    [21:37:04 INFO]: [WorldEdit] Enabling WorldEdit v6.1;no_git_id
    [21:37:05 INFO]: WEPIF: Using the Bukkit Permissions API.
    [21:37:05 INFO]: [WorldEdit] Using com.sk89q.worldedit.bukkit.adapter.impl.Spigo
    t_v1_8_R2 as the Bukkit adapter
    [21:37:05 INFO]: [MVdWPlaceholderAPI] Enabling MVdWPlaceholderAPI v1.0.0
    [21:37:05 INFO]: [MVdWPlaceholderAPI] Initializing ...
    [21:37:05 INFO]: [KitPVP] Enabling KitPVP v0.1
    [21:37:05 INFO]: [MVdWPlaceholderAPI] KitPVP added custom placeholder {online}
    [21:37:05 INFO]: [MVdWPlaceholderAPI] KitPVP added custom placeholder {coins}
    [21:37:05 INFO]: [MVdWPlaceholderAPI] KitPVP added custom placeholder {kills}
    [21:37:05 INFO]: [MVdWPlaceholderAPI] KitPVP added custom placeholder {deaths}
    [21:37:05 INFO]: [MVdWPlaceholderAPI] KitPVP added custom placeholder {ratio}
    [21:37:05 INFO]: [MVdWPlaceholderAPI] KitPVP added custom placeholder {elo}
    [21:37:05 INFO]: [MVdWPlaceholderAPI] KitPVP added custom placeholder {elorank}
    [21:37:05 INFO]: [MVdWPlaceholderAPI] KitPVP added custom placeholder {activekit
    }
    [21:37:05 INFO]: [MultiCurrency] Enabling MultiCurrency v2.1
    [21:37:05 INFO]: [MultiCurrency] enabling
    [21:37:05 WARN]: Failed to load currencyList.yml
    [21:37:05 WARN]: [MultiCurrency] A null pointer occurred.
    [21:37:05 INFO]: [MultiCurrency] loading configuration
    [21:37:05 INFO]: [MultiCurrency] registering events..
    [21:37:05 ERROR]: Error occurred while enabling MultiCurrency v2.1 (Is it up to
    date?)
    java.lang.NullPointerException
            at me.ashtheking.currency.PropertyManager.listProperties(PropertyManager
    .java:98) ~[?:?]
            at me.ashtheking.currency.CurrencyList.loadAll(CurrencyList.java:13) ~[?
    :?]
            at me.ashtheking.currency.Currency.onEnable(Currency.java:59) ~[?:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[c
    raftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:335) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:405) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.loadPlugin(CraftServer.jav
    a:356) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.enablePlugins(CraftServer.
    java:316) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.reload(CraftServer.java:74
    6) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.Bukkit.reload(Bukkit.java:534) [craftbukkit.jar:git-Bukkit
    -dbe012b-61ef214]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    25) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14
    1) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.dispatchCommand(CraftServe
    r.java:646) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.dispatchServerCommand(Craf
    tServer.java:632) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.DedicatedServer.aN(DedicatedServer.java:
    405) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:3
    69) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:6
    51) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java
    :554) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    [21:37:05 INFO]: [Vault][Economy] MultiCurrency hooked.
    [21:37:05 INFO]: [WorldGuard] Enabling WorldGuard v6.1.3-SNAPSHOT;c904242
    [21:37:05 INFO]: [WorldGuard] (world) TNT ignition is PERMITTED.
    [21:37:05 INFO]: [WorldGuard] (world) Lighters are PERMITTED.
    [21:37:05 INFO]: [WorldGuard] (world) Lava fire is blocked.
    [21:37:05 INFO]: [WorldGuard] (world) Fire spread is UNRESTRICTED.
    [21:37:05 INFO]: [WorldGuard] Loaded configuration for world 'world'
    [21:37:05 INFO]: [WorldGuard] (world_nether) TNT ignition is PERMITTED.
    [21:37:05 INFO]: [WorldGuard] (world_nether) Lighters are PERMITTED.
    [21:37:05 INFO]: [WorldGuard] (world_nether) Lava fire is blocked.
    [21:37:05 INFO]: [WorldGuard] (world_nether) Fire spread is UNRESTRICTED.
    [21:37:05 INFO]: [WorldGuard] Loaded configuration for world 'world_nether'
    [21:37:05 INFO]: [WorldGuard] (world_the_end) TNT ignition is PERMITTED.
    [21:37:05 INFO]: [WorldGuard] (world_the_end) Lighters are PERMITTED.
    [21:37:05 INFO]: [WorldGuard] (world_the_end) Lava fire is blocked.
    [21:37:05 INFO]: [WorldGuard] (world_the_end) Fire spread is UNRESTRICTED.
    [21:37:05 INFO]: [WorldGuard] Loaded configuration for world 'world_the_end'
    [21:37:05 INFO]: [WorldGuard] Loading region data...
    [21:37:05 INFO]: [FeatherBoard] Enabling FeatherBoard v3.11.1
    [21:37:05 INFO]: [FeatherBoard] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    [21:37:05 INFO]: [FeatherBoard] Plugin: FeatherBoard v3.11.1
    [21:37:05 INFO]: [FeatherBoard] Framework version: 2016-04
    [21:37:05 INFO]: [FeatherBoard] Author: Maximvdw (Maxim Van de Wynckel)
    [21:37:05 INFO]: [FeatherBoard] Site: http://www.mvdw-software.com/
    [21:37:05 INFO]: [FeatherBoard] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    [21:37:05 INFO]: [FeatherBoard] Loading configuration ...
    [21:37:05 INFO]: [FeatherBoard] Loading placeholders ...
    [21:37:06 INFO]: [MVdWPlaceholderAPI] Using FeatherBoard to get placeholders!
    [21:37:06 INFO]: [FeatherBoard] Loaded 1897 of the 4746 placholders
    [21:37:06 INFO]: [FeatherBoard] Loading Event hooks ...
    [21:37:06 INFO]: [FeatherBoard] Loading event hook: Vanilla Death hook ...
    [21:37:06 INFO]: [FeatherBoard] Loading event hook: Vanilla Block break hook ...
    
    [21:37:06 INFO]: [FeatherBoard] Loading event hook: Vanilla Block place hook ...
    
    [21:37:06 INFO]: [FeatherBoard] Loading event hook: Vanilla Create portal hook .
    ..
    [21:37:06 INFO]: [FeatherBoard] Loading event hook: Vanilla player join ...
    [21:37:06 INFO]: [FeatherBoard] Loading event hook: Vanilla player rejoin ...
    [21:37:06 INFO]: [FeatherBoard] Loading event hook: Vanilla player first join ..
    .
    [21:37:06 INFO]: [FeatherBoard] Loading event hook: Vanilla Combat hook ...
    [21:37:06 INFO]: [FeatherBoard] Creating new custom effect: warning
    [21:37:06 INFO]: [FeatherBoard]         Lines: 2
    [21:37:06 INFO]: [FeatherBoard]         Arguments: 1
    [21:37:06 INFO]: [FeatherBoard] Adding scoreboard group 'default' ...
    [21:37:06 INFO]: [FeatherBoard] Adding scoreboard group 'combat-scoreboard-examp
    le' ...
    [21:37:06 INFO]: [FeatherBoard] Adding scoreboard group 'mcmmo-levelup' ...
    [21:37:06 INFO]: [FeatherBoard] Adding scoreboard group 'towny-town-example' ...
    
    [21:37:07 INFO]: [FeatherBoard] Loading messages ...
    [21:37:07 INFO]: [FeatherBoard] Loading language file: lang_en
    [21:37:07 INFO]: [FeatherBoard] A new update for FeatherBoard is available for d
    ownload on Bukkit!
    [21:37:07 INFO]: [FeatherBoard] Toggle persistence is disabled!
    [21:37:07 INFO]: [FeatherBoard] Adding command 'featherboard'
    [21:37:07 INFO]: [Citizens] Enabling Citizens v2.0.16-SNAPSHOT (build 1267)
    [21:37:07 ERROR]: Error occurred while enabling Citizens v2.0.16-SNAPSHOT (build
    1267) (Is it up to date?)
    java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_8_R3/CraftServer
            at net.citizensnpcs.util.Util.getMinecraftRevision(Util.java:78) ~[?:?]
            at net.citizensnpcs.Citizens.onEnable(Citizens.java:262) ~[?:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[c
    raftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:335) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:405) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.loadPlugin(CraftServer.jav
    a:356) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.enablePlugins(CraftServer.
    java:316) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.reload(CraftServer.java:74
    6) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.Bukkit.reload(Bukkit.java:534) [craftbukkit.jar:git-Bukkit
    -dbe012b-61ef214]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    25) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14
    1) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.dispatchCommand(CraftServe
    r.java:646) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.dispatchServerCommand(Craf
    tServer.java:632) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.DedicatedServer.aN(DedicatedServer.java:
    405) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:3
    69) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:6
    51) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java
    :554) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    Caused by: java.lang.ClassNotFoundException: org.bukkit.craftbukkit.v1_8_R3.Craf
    tServer
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:91) ~[craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:86) ~[craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_101]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_101]
            ... 18 more
    [21:37:07 INFO]: [Essentials] Enabling Essentials v2.0.1-b${BUILD_NUMBER}
    [21:37:07 WARN]: [Essentials] §4Version mismatch! Please update EssentialsChat t
    o the same version.
    [21:37:07 INFO]: Using locale nl_NL
    [21:37:07 INFO]: [Essentials] Using 1.8.3+ BlockStateMeta provider as spawner pr
    ovider.
    [21:37:07 INFO]: Using locale nl_NL
    [21:37:07 INFO]: [Essentials] Starting Metrics. Opt-out using the global PluginM
    etrics config.
    [21:37:07 INFO]: [Vault][Economy] Essentials Economy hooked.
    [21:37:07 INFO]: [Essentials] Using config file enhanced permissions.
    [21:37:07 INFO]: [Essentials] Permissions listed in as player-commands will be g
    iven to all users.
    [21:37:07 INFO]: [Essentials] Payment method found (Vault - Economy: MultiCurren
    cy version: 1.5.6-b49)
    [21:37:07 INFO]: [EssentialsChat] Enabling EssentialsChat vTeamCity
    [21:37:07 WARN]: Verkeerde versie! Update alle Essentials jars naar dezelfde ver
    sie.
    [21:37:07 INFO]: [Essentials] Using config file enhanced permissions.
    [21:37:07 INFO]: [Essentials] Permissions listed in as player-commands will be g
    iven to all users.
    [21:37:07 INFO]: Server permissions file permissions.yml is empty, ignoring it
    [21:37:07 INFO]: CONSOLE: Reload complete.
    [21:37:07 INFO]: [Vault] Checking for Updates ...
    [21:37:08 INFO]: [Vault] No new version available
    [21:37:09 ERROR]: Could not pass event AsyncPlayerChatEvent to KitPVP v0.1
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:305) ~[craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:502) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:484) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.PlayerConnection.chat(PlayerConnection.j
    ava:1055) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.PlayerConnection.a(PlayerConnection.java
    :993) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at net.minecraft.server.v1_8_R2.PacketPlayInChat$1.run(PacketPlayInChat.
    java:39) [craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
    ?:1.8.0_101]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_101]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:
    1.8.0_101]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?
    :1.8.0_101]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    Caused by: java.lang.NullPointerException
            at org.m.KitPVP.Listener.ChatListener.onChat(ChatListener.java:22) ~[?:?
    ]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
    _101]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
    _101]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .8.0_101]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:301) ~[craftbukkit.jar:git-Bukkit-dbe012b-61ef214]
            ... 11 more
    [21:37:09 INFO]: <Inconsolable> asd
     
  12. @MordorKing78
    Show us the way you "setup" plugin.chat.

    Also, just to make sure, are you depending/softdepending on Vault in your plugin.yml?
     
  13. Offline

    MordorKing78

    @AlvinB Oh wait, I was only softdepending MVdWPlaceholderAPI, hope it works now.

    EDIT:
    Is this correct?

    Code:
    softdepends: [MVdWPlaceholderAPI, Vault]
     
  14. @MordorKing78
    Well, it is actually softdepend, not softdepends.
     
  15. Offline

    MordorKing78

    @AlvinB
    Honestly, would it change anything?
     
  16. @MordorKing78
    Yes, it's actually very important. If you put "softdepends", Bukkit will not recognize the statement and simply ignore it. It could very well be the cause of your error.
     
  17. Offline

    MordorKing78

    @AlvinB It's still having issues sadly.. NullPointException.
    This is how I "setup" my Vault API,
    PHP:
    package org.m.KitPVP.Main;

    import java.io.File;
    import java.io.IOException;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.HashSet;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.configuration.file.FileConfiguration;
    import org.bukkit.configuration.file.YamlConfiguration;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.RegisteredServiceProvider;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.m.KitPVP.Commands.funds;
    import org.m.KitPVP.Commands.kitpvp;
    import org.m.KitPVP.Commands.shop;
    import org.m.KitPVP.Listener.ChatListener;
    import org.m.KitPVP.Listener.HungerListener;
    import org.m.KitPVP.Listener.InteractListener;
    import org.m.KitPVP.Listener.InventoryClickListener;
    import org.m.KitPVP.Listener.InventoryCloseListener;
    import org.m.KitPVP.Listener.ItemDropListener;
    import org.m.KitPVP.Listener.JoinListener;
    import org.m.KitPVP.Listener.KillListener;
    import org.m.KitPVP.Listener.RespawnListener;

    import be.maximvdw.placeholderapi.PlaceholderAPI;
    import be.maximvdw.placeholderapi.PlaceholderReplaceEvent;
    import be.maximvdw.placeholderapi.PlaceholderReplacer;
    import net.milkbowl.vault.chat.Chat;


    public class 
    Main extends JavaPlugin implements Listener{   
        public 
    Chat chat null;
       
        @
    Override
        
    public void onEnable(){            
            
    PluginManager pm getServer().getPluginManager();
            
    pm.registerEvents(new JoinListener(this), this);
            
    pm.registerEvents(new InteractListener(this), this);
            
    pm.registerEvents(new InventoryClickListener(this), this);
            
    pm.registerEvents(new RespawnListener(this), this);
            
    pm.registerEvents(new InventoryCloseListener(this), this);
            
    pm.registerEvents(new KillListener(this), this);
            
    pm.registerEvents(new ChatListener(this), this);
            
    pm.registerEvents(new ItemDropListener(this), this);
            
    pm.registerEvents(new HungerListener(this), this);

            
    RegisteredServiceProvider<ChatchatProvider getServer().getServicesManager().getRegistration(net.milkbowl.vault.chat.Chat.class);
            if (
    chatProvider != null) {
                
    chat chatProvider.getProvider();
            }
           
            
    getCommand("kitpvp").setExecutor(new kitpvp(this));
            
    getCommand("shop").setExecutor(new shop(this));
            
    getCommand("funds").setExecutor(new funds(this));
           
            if (
    Bukkit.getPluginManager().isPluginEnabled("MVdWPlaceholderAPI")) {
                
    this.registerPlaceholders();
            }
        }
       
        public 
    void registerPlaceholders(){
            
    /*
             * SNIP!
             */
        
    }
       
        public 
    void saveConfiguration(FileConfiguration ymlConfigFile ymlFile) {
            try {
                
    ymlConfig.save(ymlFile);
            } catch (
    IOException e) {
                
    e.printStackTrace();
            }
        }
    }
     
  18. Offline

    MordorKing78

    @AlvinB yml
    Code:
    name: KitPVP
    version: 0.1
    description: KitPVP
    author: Inconsolable
    main: org.m.KitPVP.Main.Main
    softdepend: [MVdWPlaceholderAPI, Vault]
    commands:
      kitpvp:
        description: KitPVP
        aliases: [k, kpvp, pvp]
      shop:
        description: KitPVP Shop
        aliases: [store]
      funds:
        description: Funds
        aliases: [bal, balance, getfunds]
     
  19. Offline

    timtower Administrator Administrator Moderator

    @MordorKing78 Move the chat setup up.
    Stop the plugin if it isn't found, or at least don't use the chat variable.
     
  20. Offline

    MordorKing78

    @timtower Okay, for some reason it's disabling the plugin, so it's not finding the Vault API for some odd reason..

    Code:
            if(!this.setupChat()){
                Bukkit.getLogger().severe(String.format("ERROR [%s] - Disabled due no Vault dependency!", this.getDescription().getName()));
                Bukkit.getServer().getPluginManager().disablePlugin(this);
                return;
            }
    Any idea why?
     
  21. Offline

    timtower Administrator Administrator Moderator

    @MordorKing78 Might be finding Vault, but not a chat provider.
    But I believe that you can get the prefix with the permission provider.
     
  22. Offline

    MordorKing78

    @timtower I'm using EssentialsChat which should work..
     
  23. Offline

    MordorKing78

Thread Status:
Not open for further replies.

Share This Page