server
server copied to clipboard
setMobFlags -> setEntityFlags and related info
- [x] I have paid attention to this example and will edit again if need be to not break the formatting, or I will be ignored
- [x] I have searched existing issues to see if the issue has already been opened
- [x] I have checked the commit log to see if the issue has been resolved since my server was last updated
- [x] I have read the Contributing Guide
- [x] I have specified what branch this happens on branch: base
Additional Information (Steps to reproduce/Expected behavior) : I always intended to remove setMobFlags and make a setEntityFlags that worked on ALL entity types (npc's have these also) but never got around to refactoring it. Zach has volunteered.
just about everything has enitity flags. Mobs NPCs pets the works - even players nameflags are really just entity flags (most have nothing to do with your name or the name area on screen).
Between entity types the precise bytes of the mask don't align -mobs can get a bazaar icon, but its shifted over by one byte in the mask because this mask is in reality several bytes in different places in the core not even in the same packets that way back when and someone decided to glob together into one value in the database and call nameflags
for players and just flags
for mobs and npcs (and I came a long and renamed the latter to entityFlags
when I added the function to tell it apart from its neighbor named flag
). This is why you will see that a mob has and identical numbers for something a player has with a difference of two zeros on the end of the value.
It makes sense to use separate enums as long as this is all together, but 1 function should be able to set bits on/off for all entity types as is essentially the same operation. If we want to break this into multiple masks we'd have the challenge of naming them all properly. I'd Still argue for one function in that case, with a second input saying which one we're editing. But I think the masks could be left alone for now and just unify the function calls here.
That is awesome. I always got confused which was which. Good luck Zach =D
I was also just reminded that for players, there is a 2nd database column named nnameflags
(2 n
's in the name). Entities have so many flags its absurd. Most of them have nothing to do with the name-plate-thingy or icons.
see also: https://github.com/LandSandBoat/server/issues/330#issuecomment-1252775293