[Suggestion] Absolute WhiteList
Closed this issue · 6 comments
Hello!
Would it be possible to add a configuration option to make the whitelist absolute? Because I'm currently doing a little adventure modpack in 1.20.1 and I'd find it more convenient to have total control over authorized items rather than blacklisting all non-stackable items ^^
In idea, something like this:
public static boolean isItemStackAllowed(final ItemStack stack)
{
if (stack.getCount() <= 0)
return true;
if (whiteList.stream().anyMatch((s) -> ItemStack.isSameItem(s, stack)))
return true;
if ( absoluteWhiteList && whiteList.size() > 0) <----------------------------
return false;
if (blackList.stream().anyMatch((s) -> ItemStack.isSameItem(s, stack)))
return false;
if (stack.getItem() instanceof BundleItem)
return false;
if (stack.getItem() instanceof ToolBeltItem)
return false;
if (stack.getMaxStackSize() != 1)
return false;
return true;
}
Thanks for the mod and good luck!
Oh, you mean block everything by default? I could add a setting for that. I don't think I'd use your suggested name though.
I'd probably have the opposite -- an allowAllNonStackableItems
option that defaults to true.
I'll think about it after work.
You're the boss, boss ^^
I suggested a configuration like this because I had no idea what this part of the code was about (well, especially the ToolBeltItem):
if (stack.getItem() instanceof BundleItem)
return false;
if (stack.getItem() instanceof ToolBeltItem)
return false;
Will there be a backport for 1.20.1 or will it just be for the current version ?
because I had no idea what this part of the code was about
Those two checks prevent placing bundles and belts inside a belt, since they cause bad things.
Will there be a backport for 1.20.1 or will it just be for the current version ?
I'm winding down 1.20.1 development, and mostly just handling bugfixing, but this is a very very simple change so I am ok with backporting it.
Now that I had time, I did implement this feature, for 1.20.1, 1.21.1, and 1.21.3.