Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Events need to extend AbstractEvent #18

Closed
RobertHerhold opened this issue Sep 25, 2016 · 3 comments
Closed

Events need to extend AbstractEvent #18

RobertHerhold opened this issue Sep 25, 2016 · 3 comments

Comments

@RobertHerhold
Copy link

With this event listener:

@Listener
public void event(Event event) {

}

I get this exception:

[22:08:30 ERROR] [Sponge]: Could not pass LiteEconomyTransactionEvent to Plugin{id=t, name=Test, version=1.0.0, source=mods/test-1.0.0.jar}
java.lang.ClassCastException: io.github.flibio.economylite.impl.economy.event.LiteEconomyTransactionEvent cannot be cast to org.spongepowered.api.event.impl.AbstractEvent
    at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:304) ~[SpongeEventManager.class:1.10.2-5.0.0-BETA-129]
    at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:320) ~[SpongeEventManager.class:1.10.2-5.0.0-BETA-129]
    at io.github.flibio.economylite.impl.economy.account.LiteUniqueAccount.resultAndEvent(LiteUniqueAccount.java:214) ~[LiteUniqueAccount.class:?]
    at io.github.flibio.economylite.impl.economy.account.LiteUniqueAccount.deposit(LiteUniqueAccount.java:159) ~[LiteUniqueAccount.class:?]
    at org.spongepowered.api.service.economy.account.Account.deposit(Account.java:294) ~[Account.class:1.10.2-5.0.0-BETA-129]
    at io.github.flibio.economylite.commands.admin.AddCommand.run(AddCommand.java:72) ~[AddCommand.class:?]
    at io.github.flibio.economylite.utils.commands.BaseCommandExecutor.lambda$execute$2(BaseCommandExecutor.java:69) ~[BaseCommandExecutor.class:?]
    at org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$642(SchedulerBase.java:177) ~[SchedulerBase.class:1.10.2-5.0.0-BETA-129]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_102-ea]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_102-ea]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_102-ea]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_102-ea]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_102-ea]
@Flibio
Copy link
Owner

Flibio commented Sep 25, 2016

@RobertHerhold: I believe this would happen with most economy plugins, as they implement the EconomyTransactionEvent. Do you think the EconomyTransactionEvent should extend AbstractEvent in the SpongeAPI? This would allow the issue to be fixed for all economy plugins. Anyways, I'll fix it soon.

@Flibio Flibio added the bug label Sep 25, 2016
@Flibio Flibio closed this as completed in 5de10d1 Sep 25, 2016
@RobertHerhold
Copy link
Author

@Flibio Thanks for the quick response! I think it might be wise for EconomyTransactionEvent to extend AbstractEvent, although I have to admit that I'm not incredibly familiar with the implementation details of events, so I don't know if that would have any unintended consequences.

@Flibio
Copy link
Owner

Flibio commented Sep 25, 2016

@RobertHerhold: Unfortunately, I'm not familiar with the implementation either, perhaps you could mention it to the appropriate dev?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants