Sk1erLLC / Levelhead

Displays the Hypixel Network Level & other statistics of a player above their head, in chat and in tab.
GNU General Public License v3.0
35 stars 15 forks source link

Incompatibility with SBA entity outlines #19

Closed Phoube closed 3 years ago

Phoube commented 3 years ago

Hi all,

I'm hoping to fix an incompatibility between SBA's entity outlines and this mod. The problem occurs because SBA calls Minecraft.getMinecraft().getRenderManager().renderEntityStatic() for players inside Hypixel Skyblock Dungeons. This then eventually fires the RenderPlayerEvent.Pre event that Level head subscribes to here. The result is that the level head display (above player heads) is outlined along with the rest of the entity.

Looking at the level head code, I don't see a way to prevent rendering outlines around the level head display from SBA's end. But I think there might be a simple way to do it on Level head's end.

There are two potential fixes. The first is #18 , which changes the event subscription to one that only fires when nametags are rendered (nametag rendering is disabled when rendering entity outlines). The second is adding an extra check for RendererLivingEntity.renderOutlines. Unfortunately the second option likely involves access transformers or mixins, as the field is protected and there are no getters that I could find.

Thanks for your help!

Edit: I got some help from @DJTheRedstoner, who reviewed my PR #18 and gave me some patches to apply. According to DJ, the PR works in 1.8.9, but they were unable to test it in 1.12 because of "other issues."

ghost commented 3 years ago

Fixed in https://github.com/Sk1erLLC/Levelhead/commit/401ad1aaf4d83a852ef53bbceb51c2b788772bc2