GeckoLib

GeckoLib

243M Downloads

issues with ItemDisplayContext

ilia-ip opened this issue · 4 comments

commented

this is one of my controllers:

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

        if (displayContext == ItemDisplayContext.GUI) {
            return animationTest.setAndContinue(IDLE_ANIM);
        }

        return animationTest.setAndContinue(NO_HANDS_ANIM);
    }

in my test world i have an item frame with my geoitem in it.
the only "displays" of my item are FIXED (item frame) and GUI (item in my inventory)

controller should render IDLE_ANIM in gui,

but IDLE_ANIM renders in item frame instead.

when adding other displays (holding item in hand, looking at it in third person and etc), animation renders on one of them, bur never on the right one.

Changing ItemDisplayContext.GUI to other enum values results in similiar behavior

returning PlayState.STOP instead of playing NO_HANDS_ANIM does not help

gekolib version - 5.2.0

commented

@ilia-ip Do you have a compiled jar of your mod I can test against? Built against the current latest geckolib

commented

but i already have

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

in my item class and from logs i can see what idleController gets called for every perspective separately

commented

🤔
Idk what I was lookin at, but yeah you're right

Sighhh