MC Dungeons Armors

MC Dungeons Armors

10M Downloads

Performance Suggestion

Globox1997 opened this issue ยท 3 comments

commented

I just checked a little bit of your code cause I have a bug with one of my mods (LevelZ) and saw you call quite a lot of checks every serverplayertick which isn't really performance friendly here: https://github.com/chronosacaria/MCDungeonsArmors/blob/1.17/src/main/java/chronosacaria/mcda/mixin/ServerPlayerEntityMixin.java
I suggest to init a ticker to check every 20 ticks or even more for all these armor item checks

commented

I didn't even know that was possible. That is pretty awesome! I'll have to look into that

commented

That commit looks better than before :)
I still have a recommendation: instead of mixin into the player tick method, there is a method called inventorytick of an item which can get overriden by your armor items.
To maximize performance, you could use one item of each armor group which gives an effect and check inside the inventory tick if all other required armor pieces are in the armor slot while the ticking item is in the armor slot ;)