[SPIGOT-588] Extra Method to HideFlags "hasItemFlags" Created: 18/Feb/15 Updated: 18/Feb/15 Resolved: 18/Feb/15 |
|
| Status: | Closed |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor |
| Reporter: | Chris Lutte | Assignee: | Thinkofname |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | hideflags | ||
| Environment: |
NB |
||
| Description |
|
Hi While use the HideFlags API I feel their needs to be a method which Enchants and Lore have. Currently there is no single method to check if there are "any" ItemFlags, the only why to check is to use getItemFlags which will return an empty set if there is no ItemFlags. Sure you will agree this is not they efficient but currently its the only way to check without specifying a exact flag to check for. Something similar to the snippet below would be ideal. Thanks for your consideration. hasItemFlags /* * Checks for the existence of any ItemFlags. * * @return true if an ItemFlag exists on this meta */ boolean hasItemFlags() |
| Comments |
| Comment by Chris Lutte [ 18/Feb/15 ] |
|
Thanks for the reply, that makes complete sense. I did wonder why it was named ItemFlags, now I know |
| Comment by Thinkofname [ 18/Feb/15 ] |
|
We are abstracting the api in a way that doesn't follow the internal design completely. Other things may be added to ItemFlags not just hideFlags, for example unbreakable could be added there as a flag. So the concept of no flags would be different to what you expect. Each flag should be treated as its own thing and not a group of flags |