AHilyard / MerchantMarkers

A mod for Minecraft 1.17.1+ to display markers above villagers based on their profession.
Other
4 stars 5 forks source link

Extending the range of supported entity types to IMerchant #14

Closed LTCatt closed 2 years ago

LTCatt commented 2 years ago

https://github.com/AHilyard/MerchantMarkers/blob/1.16.5/src/main/java/com/anthonyhilyard/merchantmarkers/render/Markers.java

At line 150: if (entity instanceof AbstractVillagerEntity)

If you detect IMerchant instead of AbstractVillagerEntity, this mod can support merchants from more mods. For example, the Goblin Merchant, whose goblin entity does not inherit AbstractVillagerEntity because it does not have Age, but goblin implements IMerchant.

In fact, after I modified this code with mixin, the whole mod worked quite well...

AHilyard commented 2 years ago

This is a good idea, I will add it in the next update.

LTCatt commented 2 years ago

Perhaps a check could be added by the way to not show the marker if the entity is invisible. Invisible wandering merchants has a marker on top of his head is quite funny...

if (entity.isInvisible()) return;

AHilyard commented 2 years ago

I have just released version 1.3 which allows any entity to have a marker. I've also added built-in markers for merchants added in the Goblin Traders mod and made it so invisible entities will not render their markers. Thanks for the suggestions.