Plasmo Voice

Plasmo Voice

2M Downloads

[Bug] Can't use API Event "PlayerSpeakEvent"

DeadFinder opened this issue · 3 comments

commented
[22:50:25 ERROR]: Error occurred while enabling WalkieTalkie v1.0 (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event su.plo.voice.events.PlayerSpeakEvent. Static getHandlerList method required!
        at org.bukkit.plugin.SimplePluginManager.getRegistrationClass(SimplePluginManager.java:765) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.registerEvents(SimplePluginManager.java:702) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at me.deadfinder.wt.WalkieTalkie.onEnable(WalkieTalkie.java:29) ~[WalkieTalkie.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-387]
        at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-387]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:665) ~[paper-1.18.2.jar:git-Paper-387]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:432) ~[paper-1.18.2.jar:git-Paper-387]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-387]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1164) ~[paper-1.18.2.jar:git-Paper-387]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-387]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Created plugin for one server to have able sending messages with Walkie-Talkie, wanna use plasmovoice api for sending voice to players, but receive this error, googled and think problem not with my plugin, any suggestions?

How i used:
First initialized api

RegisteredServiceProvider<PlasmoVoiceAPI> provider = Bukkit.getServicesManager().getRegistration(PlasmoVoiceAPI.class);
if (provider != null) {
	PlasmoVoiceAPI api = provider.getProvider();
}

Then i used api in listener

this.listener = new Listener_(this, api);

Then i created event in my listener

@EventHandler(ignoreCancelled = true)
private void onPlayerVoice(final PlayerSpeakEvent e) {
    //bla bla not interesting code for you
    //i'm used from api "api#sendVoicePacketToPlayer()" to sending voice to some players with Walkie-Talkie in 
    hands
}

When plugin is enabling i getting always error when use this event.

commented

I have the same problem

commented

This issue happens with me too.
Probably because build in spigot is invalid, and doesn`t contain method getHandlersList
изображение

commented

2xx version has a proper API, docs coming soon