Bernasss12 / BetterEnchantedBooks

Makes it easier to identify different enchantment books.
MIT License
12 stars 9 forks source link

Port to 1.20 #59

Closed Fourmisain closed 1 year ago

Fourmisain commented 1 year ago

Based on the previous PR, so merge that first.

Vanilla moved almost all relevant render methods into RenderContext. The previous ScreenMixin.convertTooltipComponents was moved into the new RenderContextMixin.

The logic for detecting the hovered over item also changed. DrawContext has a drawItemTooltip method taking an ItemStack, but that one isn't actually used for mouse hover tooltips for some reason. The latter code is instead found in HandledScreen.drawMouseoverTooltip, which is now where the enchantedItemStack is set.

Looking at it a bit further, DrawContext.drawItemTooltip is apparently used in the MerchantScreen and StonecutterScreen - I'll see if I can add logic to that as well as it seems handy having the tooltip icons all features for merchants as well.

Fourmisain commented 1 year ago

Aight, that was super easy to add.

Bernasss12 commented 1 year ago

Thank you for all this work again!