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

[BUG] Randomly get MundaneWireException while doing injection #650

Open
cypai opened this issue Dec 24, 2021 · 0 comments
Open

[BUG] Randomly get MundaneWireException while doing injection #650

cypai opened this issue Dec 24, 2021 · 0 comments
Assignees
Labels

Comments

@cypai
Copy link

cypai commented Dec 24, 2021

I seem to be getting MundaneWireException randomly while injecting a custom class. The stack trace:

Caused by: com.artemis.MundaneWireException: Error while wiring com.pipai.dragontiles.artemis.systems.animation.AdjustHandAnimation
        at com.artemis.injection.CachedInjector.inject(CachedInjector.java:80)
        at com.artemis.World.inject(World.java:136)
        at com.artemis.World.inject(World.java:109)
        at com.pipai.dragontiles.artemis.systems.animation.Animation.init(Animation.kt:15)
        at com.pipai.dragontiles.artemis.systems.animation.CombatAnimationSystem.queueAnimation(CombatAnimationSystem.kt:38)
        at com.pipai.dragontiles.artemis.systems.animation.CombatAnimationSystem.adjustHand(CombatAnimationSystem.kt:84)
        at com.pipai.dragontiles.artemis.systems.animation.CombatAnimationSystem.handleHandAdjustedEvent(CombatAnimationSystem.kt:80)
        ... 19 more
Caused by: com.artemis.MundaneWireException: Failed to inject com.artemis.ComponentMapper into com.pipai.dragontiles.artemis.systems.animation.AdjustHandAnimation: ComponentMapper not registered with world.
        at com.artemis.injection.CachedInjector.onFailedInjection(CachedInjector.java:179)
        at com.artemis.injection.CachedInjector.injectField(CachedInjector.java:165)
        at com.artemis.injection.CachedInjector.injectValidFields(CachedInjector.java:90)
        at com.artemis.injection.CachedInjector.inject(CachedInjector.java:75)
        ... 25 more

The offending code (truncated a bit):

abstract class Animation {
    protected lateinit var world: World

    fun init(world: World) {
        this.world = world
        world.inject(this)
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants