EventManager#unregisterListeners unregisters the plugin main instance
Open
@4drian3d is already working on this.
Since Jan 21, 2024.
type: feature
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 959
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 2
Description
@Plugin(
id = "testplugin"
)
public class TestPlugin {
@Inject
private ProxyServer server;
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
EventManager eventManager = this.server.getEventManager();
eventManager.unregisterListeners(this);
System.out.println("test123");
}
@Subscribe
public void onProxyReload(ProxyReloadEvent event) {
System.out.println("test321");
}
}
Excepted behaviour:
- It writes
test123on startup - It writes
test321after/velocity reload
Current behaviour:
- It writes
test123on startup - It doesn't write
test321after/velocity reload
We can't register the main instance again (eventManager.registerListeners(this, this)) as the "The plugin main instance is automatically registered." error appears
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.