Inventory Tweaks [1.12 only]

Inventory Tweaks [1.12 only]

127M Downloads

if ... then condition

adiac opened this issue ยท 3 comments

commented

by sorting my torches i had a problem:

i wanted the torches (2 stacks) to go in "D4 and C4" or in "D5 and C5".
I couldn't find a way to do that. At the moment I'm using this:

D4 torch
C5 torch
D5 torch

problem with this is that it sorts the torches if possible first in D4 and than in C5 and not in C4.

with the if condition you could make it like this:

D4 torch (it sorts it olny when there is no item before in this slot)
if D4 torch then C4 torch
D5 torch
C5 torch

if you find a way to do it without editing the mod, please let me know.

PS: I'm german, so my english is not the best. maybe i made some mistakes in my English.

commented

What you're trying to do is too complex for the sorting rules system to handle, especially since it doesn't really know the final contents of a slot at any point until the sorting is finished.

commented

Is it possible to integrate the "If ... then" condition in future updates of the mod or is it too complex?

commented

The way it sorts, there is no way to determine what the final contents of a slot will be until sorting is done, so saying 'if some item is in slot X, put another item in slot Y' cannot be determined correctly without adding a new pass for every if condition, as each new condition could alter what item ends up in which slot for the purposes of further conditions.

The sorting rules system is essentially intended for fairly simple organizations where an item or a specific class of items is always assigned to a given slot or range of slots.