zlainsama / CosmeticArmorReworked

This mod allows you to wear two sets of armor, one for display, one for function.
https://minecraft.curseforge.com/projects/cosmetic-armor-reworked
Other
17 stars 18 forks source link

API improvement #92

Closed snakehugo closed 10 months ago

snakehugo commented 10 months ago

Hello!

Sorry to bother you but I'm trying to use your API to hide the helmet of a player. So I tried: CosArmorAPI.getCAStacks(context.getSource().asPlayer().getUniqueID()).setHidden("minecraft","iron_helmet", true);

But it seems to not hide the iron_helmet.

Also is it possible for you to improve your API to be able to just write: CosArmorAPI.getPlayer(UUID).getEffectiveSlot(0).setHidden(true);

In order to hide the player's helmet without having to set any specific modid or identifier or is that more complex that I think of?

zlainsama commented 10 months ago

Sorry about not making it clear, you should use setSkinArmor(3, true) to hide target player's helmet slot. setHidden() is not used currently, it was introduced for supporting curios slots, and was left in there for compatibility. I should remove these unused stuff in the future.

snakehugo commented 10 months ago

Ohhhhhh!

I should have ask the question way earlier ): I spent like 3 days on implementing a solution by myself and failed! I found no way to hide the armor on the OnRenderPlayer.Pre event. I successfully hidden the whole head though. And I finally found how to use your API by "trying and error" like 30minutes ago!! I didn't see your message earlier

Thanks a lot, I managed to do it with the setSkinArmor!

snakehugo commented 10 months ago

Okay maybe I'm not done x)

I hide the player's helmet when he clicks on a homemade button and it works. But after a disconnection, it's not remaining hidden. Is that made in purpose?

snakehugo commented 10 months ago

Okay there was a weird behaviour, I think it is fixed.

armorSkin buttons are working perfectly!