Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manager fails to initialize when no Plugin annotation is present #327

Open
Artuto opened this issue May 23, 2021 · 0 comments
Open

Manager fails to initialize when no Plugin annotation is present #327

Artuto opened this issue May 23, 2021 · 0 comments
Labels
bug velocity Related to the ACF Velocity Implementation

Comments

@Artuto
Copy link

Artuto commented May 23, 2021

VelocityCommandManager fails to initialize when the plugin doesn't have a Plugin annotation and instead uses the json file to register it's properties.

[16:44:04 ERROR]: Some errors occurred whilst posting event ProxyInitializeEvent.
[16:44:04 ERROR]: #1: java.lang.NullPointerException: null
        at net.craftium.iptracker.libs.acf.VelocityCommandManager.<init>(VelocityCommandManager.java:58) ~[?:?]
        at net.craftium.iptracker.IPT.onProxyInitialization(IPT.java:58) ~[?:?]
        at net.kyori.event.asm.generated.d75874e35f.IPT-onProxyInitialization-ProxyInitializeEvent-17.invoke(Unknown Source) ~[?:?]
        at net.kyori.event.method.SimpleMethodSubscriptionAdapter$MethodEventSubscriber.invoke(SimpleMethodSubscriptionAdapter.java:148) ~[velocity.jar:1.1.5]
        at net.kyori.event.SimpleEventBus.post(SimpleEventBus.java:107) ~[velocity.jar:1.1.5]
        at com.velocitypowered.proxy.plugin.VelocityEventManager.fireEvent(VelocityEventManager.java:154) ~[velocity.jar:1.1.5]
        at com.velocitypowered.proxy.plugin.VelocityEventManager.lambda$fire$1(VelocityEventManager.java:136) ~[velocity.jar:1.1.5]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]

For some reason ACF is directly getting the annotation (which in this case is not present) to get the plugin's ID instead of accessing it from the API.

public VelocityCommandManager(ProxyServer proxy, Object plugin) {
this.proxy = proxy;
this.plugin = proxy.getPluginManager().getPlugin(plugin.getClass().getAnnotation(Plugin.class).id()).get();

@chickeneer chickeneer added bug velocity Related to the ACF Velocity Implementation labels Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug velocity Related to the ACF Velocity Implementation
Projects
None yet
Development

No branches or pull requests

2 participants