
Cannot get ItemDisplayContext
ilia-ip opened this issue · 6 comments
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!
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