GeckoLib

GeckoLib

243M Downloads

Cannot get ItemDisplayContext

ilia-ip opened this issue · 6 comments

commented

Trying to get ItemDisplayContext using AnimationTest.getData always results java.lang.IllegalArgumentException: Attempted to retrieve data from GeoRenderState that does not exist. Check your code!

commented

Show your code?

commented
private PlayState idleController(AnimationTest<GeoItem> animationTest) {
        ItemDisplayContext displayContext = animationTest.getData(DataTickets.ITEM_RENDER_PERSPECTIVE);

        if (displayContext != null && displayContext.firstPerson()) {
                return animationTest.setAndContinue(IDLE_ANIM);
        }

        return PlayState.STOP;
}

@Override
public void registerControllers(AnimatableManager.ControllerRegistrar controllers) {
        controllers.add(new AnimationController<>("idle_controller", this::idleController));
}

@Override
public boolean isPerspectiveAware() {
        return true;
}

everything else is the same as in geckolib wiki

commented

What version of geckolib

commented

5.1.0

commented

🤔 I don't see how this is possible lol

I'll have to toy around with it I guess

commented

Fixed in 5.2.0