Item Stages

Item Stages

20M Downloads

[Request] Would it be possible to get a removeItemStage command?

SeriousCreeper opened this issue ยท 3 comments

commented

Heya,

i'm currently trying to lock a bunch of items of several mods behind stages. It's easy to do with something like this:

for item in loadedMods["betterwithmods"].items {
	mods.ItemStages.addItemStage("betterwithmods", item);
}

However, if you want to to whitelist certain items within that mod to to require a stage (lets say better with mods seeds), instead i'd have to make an array of all items i want to block and go over that instead.

Instead it would be awesome to have a removeItemStage command that can be called after the loop i posted on top, to remove certain items again. Something like:

for item in loadedMods["betterwithmods"].items {
	mods.ItemStages.addItemStage("betterwithmods", item);
}

mods.ItemStages.removeItemStage("betterwithmods", <betterwithmods:seeds>);

Would this be posssible?

Cheers,
SC

commented

Hello,

Thanks for the suggestion. It is possible to add and I will add it in the next update. That said, I think it may be a better solution for you do add some conditions inside your loop to filter it. I am not sure what the syntax would look like, but you could do something like.

for item in loadedMods["betterwithmods"].items {
    if (some condition here) {
            mods.ItemStages.addItemStage("betterwithmods", item);
    }
}
commented

Hey,

thanks a lot, glad to hear!

Yeah a condition to see if the item equals to some i don't want to add to the stage would work as well. If it's multiple items i'd have to create a "blacklist" array and check if the item is on that list before calling addItemStage.
Wasn't able to figure out how to check if an item exists in an array without having to iterate over it however. I might have to look around more and see if i can find an example.

But the removeItemStage would help with that as well, so that should be awesome.

Thanks!
SC

commented

Have you tried something like if(blacklistArray in <mod:id>) {? I dont recall if it works or not, but it may.