Optional Tags
MaxNeedsSnacks opened this issue ยท 1 comments
Low-priority, but a nice QOL feature that's unfortunately lacking from vanilla.
Currently, you need to use something like ItemTags.bind(String)
to use tags statically, which:
- requires an AW because bind is private by default
- means the tag needs to exist (though it can be empty), otherwise you'll soft crash during server join
Forge fixes this problem by adding IOptionalNamedTag, which is great because it allows you to statically define tags that may or may not exist at runtime / when connecting to servers, and even gives you a way to supply default values if that tag doesn't exist when resolving it.
I think Architectury would benefit from a similar sort of approach, especially since using static tags might discourage people from using uncached calls like ItemTags.getAllTags().getTag(ResourceLocation)
(whose exact runtime complexity I still need to profile)