Fabric API

Fabric API

108M Downloads

Addition of a generic `isIn` for use with `TagKeys` that that do not have easy methods of querying

dexman545 opened this issue ยท 0 comments

commented

... such as Enchantments.

enchantment -> {
	    var maybeKey = Registry.ENCHANTMENT.getKey(enchantment);
	    return maybeKey.filter(enchantmentRegistryKey ->
	                                   Registry.ENCHANTMENT.entryOf(enchantmentRegistryKey).isIn(tagKey))
	                   .isPresent();
	}

This makes using ConventionalEnchantmentTags somewhat annoying to implement, and serves as a barrier for other registries to be used with tags.

One solution would be to inject a better way to get the registry key, as well as a method in TagKey to query if an object is in that specific tag.