BaseItem::listen_event and Items::get_items() --> ItemRegistryItem

Hey Seb (@Spaceman_Spiff),

I’ve been away for sometimes since the last 1.2 beta. I am glad to see the new releases. I did miss some interaction in the older 1.1 that isn’t quite the same in the newer version. I have a lot of code that uses this flow:

anItem = Items.get_item(...)
anItem.listen_event(..., ItemCommandEventFilter())

That worked before as get_item returns a BaseItem. But that is no longer the case. It now returns a ItemRegistryItem which doesn’t have the listen_event function. I am getting many warnings in Pycharm, but it otherwise works fine.
Is there any chance to rectify this behaviour? Could we unify BaseItem and ItemRegistryItem?


You have to use the class factory:

an_item = BaseItem.get_item(...)

That works. Thanks Seb.