Better Statistics Screen

Better Statistics Screen

25M Downloads

Minor interoperability issue between Better Statistics Screen and Inventory Profiles Next.

blackd opened this issue · 5 comments

commented

Hi,

I got this report blackd/Inventory-Profiles#456 about IPN overlay painting in the wrong place.

My investigation have shown that the reason for IPN overlay miss placement is that the first time the inventory screen is opened the attached ScreenHandler is instance of net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen.CreativeScreenHandler instead of net.minecraft.screen.PlayerScreenHandler

In my opinion the above is caused by this line of code.

new CreativeInventoryScreen(client.player, world.getEnabledFeatures(), useOp);

Judging by the comments the CreativeInventory instance is created for the side effect of loading the creative inventory groups.
I have a similar code that just populates the Item registry display context data.

https://github.com/blackd/Inventory-Profiles/blob/1b68dd71772ed93aca327c10e26bec400008f46a/platforms/fabric-1.21.4/src/main/java/org/anti_ad/mc/ipnext/item/ItemTypeExtensions.kt#L238

private fun initGroupIndex(): Boolean {
    val features = Vanilla.mc().player?.networkHandler?.enabledFeatures
    val lookup = Vanilla.mc().player?.world?.getRegistryManager()
    val opTabEnabled = Vanilla.mc().options.getOperatorItemsTab().getValue() && Vanilla.playerNullable()?.isCreativeLevelTwoOp ?: false
    return if (features != null && lookup != null) {
        ItemGroups.updateDisplayContext(features, opTabEnabled, lookup);
        true
    } else {
        false
    }
}

Will it be possible to replace the creation of instance of the creative inventory with the Java equivalent of my code so we avoid the incompatibility.

commented

Hello!
Thanks a lot for pointing this out to me, and for describing the issue in detail.
Yes, we may definitely make changes to my code so as to resolve this incompatibility.

commented

Hello again.

I just released v3.13.5, which should hopefully resolve this issue, as this new patch now uses ItemGroups.updateDisplayContext instead of creating a CreativeInventoryScreen instance like before.

I will now proceed with further publishing of this release. In the meantime, if you don't mind, please double-check and make sure this new patch really did resolve this issue.

Here is the updated code;

commented

Hey there, I think this fix has broken the search field in the creative inventory. Still works in 3.13.4, but in 3.13.5 typing into the search field doesn't show any results (the typed text is still shown in the search input box as expected). Reproduced in a test instance where I only had Mod Menu enabled at the same time.

commented

Oh wow, that is a big issue. Thanks a lot for reporting that.
To prevent people from further getting impacted from it, I will remove the release until I find a way to handle both issues porperly.

commented

Aside from #144, I believe this issue should hopefully also be fixed in the next release.
Let me know if the issue persists after the next release (v3.13.6), so this issue can be reopened.