[FEATURE] Increased compat so other mods can view DefinedWeaponTypes.TYPES
pitbox46 opened this issue ยท 6 comments
I would have made a pull request, but it seems like the code hasn't been pushed for 1.17 yet.
I am the dev of Epic Fight NBT Integration, so I am asking for slightly more compat for the 1.17 version. Currently DefinedWeaponTypes.TYPES is private. I would appreciate if either the constant were public or perhaps if there was a method that returned an immutable copy of TYPES.
If you add weapons in the future, currently I have to manually add each one so my mod can use it. If I could access TYPES however, this process would be automatic for me.
Something like this would be best since I would also need access to the keys.
public static ImmutableMap<String, Function<Item, CapabilityItem>> getTypes() {
return ImmutableMap.copyOf(TYPES);
}
I see. Can this kind of method solve your problem?
public static Collection<Function<Item, CapabilityItem>> getAllTypes() {
return TYPES.values();
}