[Feature Request] Make the removal of requirements a thing
thanasishadow opened this issue ยท 6 comments
Something like this
mods.compatskills.Requirement.removeRequirement(IItemStack item, String... locked)
It could be useful for locking large-scale mods while keeping a few items unlocked instead of locking every item/block the mod separately except those few.
Yea @pupnewfster brought up the use-case while we discussed this.
Shouldn't be too hard to add, gonna assign Pup to this since I'm currently working on a seperate project for the moment.
Actually @Lanse505 it is rather hard to add, that is why it has not been done yet and why I was saying it isn't too high on my priorities.
For the meantime you can use none
as the requirement on an item to remove ALL other requirements on that item. Which partially gets the job done, but then you can't just have lower tier items on it.
Another option because this is in CompatSkills, and you could loop over all items in a mod, and add the requirements for them if they aren't in your list. I will make you a zenscript function a bit later that should be able to do that.
Oh sorry, must have misunderstood then @pupnewfster ๐
I still need to test it a bit more, but for the most part, the lockItems function in this script is capable of locking all the items of a given mod to a set of requirements. It takes a blacklist of items to not lock, and a map of itemstacks to their specific requirements. (This is needed given otherwise it would just overwrite the baseline locks). If an item is found in the addedRequirements map, it combines the base locks for the mod and for the item in the lock it makes. Blacklist does not support NBT, but addedRequirements supports NBT properly. NOTE: while you can use this script to pseudo have "removal of mod wide requirements" I would be careful using it with a mod that heavily relies on NBT such as mekanism for determining its base blocks, as I am not sure it will handle it properly. I have been testing it with Ender IO and it seems to work for the most part. You are welcome to experiment with it and if you have any questions feel free to come by the discord and ask.