Closed Krutoy242 closed 7 months ago
To be honest, I'm not entirely sure what is happening from your description. To avoid ambiguity, it needs to be made clear that the implementation of the setMaterialPriority
method will only handle with the material that's set, while the rest will retain the default ordering.
I though, setMaterialPriority('paper', -1000)
will place paper here:
try setMaterialPriority('paper', 1000)
Not working too.
There, i printed messages about values to be sure:
This is my ZS code:
for matName, power in scripts.equipment.equipData.defaultWeaponMats {
print('randomtweaker: setting '~matName~' priority: '~(-power));
mods.randomtweaker.tconstruct.IBook.setMaterialPriority(matName, -power);
}
This is cafttweaker.log output:
[INITIALIZATION][CLIENT][INFO] randomtweaker: setting prismarine priority: -80
[INITIALIZATION][CLIENT][INFO] Setting material prismarine priority to -80
...
[INITIALIZATION][CLIENT][INFO] randomtweaker: setting paper priority: -21
[INITIALIZATION][CLIENT][INFO] Setting material paper priority to -21
...
[INITIALIZATION][CLIENT][INFO] randomtweaker: setting endstone priority: -77
[INITIALIZATION][CLIENT][INFO] Setting material endstone priority to -77
But we still seeing them near each other:
In fact, this is an expected result. Simply setting the priority of some of the materials will only result in them being placed last or first in the loop in order of priority. I think your requirements need to be sorted for all materials to control the specific insertion order.
Ok, seems like I just come up with wrong example. I will make another example to show that order actually not changing.
There is another example showing that sorting does not work.
Crafttweaker.log output:
Setting material paper priority to 21
Setting material stone priority to 31
Setting material construction_alloy priority to 41
Setting material flint priority to 49
What i see:
It seems to be not compatible with a other expansion mods of tc again, If you can find the specific mod may I can try to fix it.
Fixed, #1397ec6
Im using this methof to rearrange materials in book:
Comes out that only detailed pages arranged (were we can see stats and applicable tool parts), but main "grid" view is stay the same:
debug.log