Conditional traits are different on parts than when those parts are applied to a tool
LlubNek opened this issue ยท 1 comments
Versions
- Silent Gear: SilentGear-1.15.2-1.10.2+136.jar
- Silent's Gems: SilentGems-1.15.2-3.6.1+95.jar
- Silent Lib: SilentLib-1.15.2-4.6.6+59.jar
- Forge: 31.2.31
- Modpack: N/A
- Optifine Installed: Yes
Expected Behavior
The traits listed for a part should match the traits it contributes to a tool.
Actual Behavior
If you craft a compound tip with diamond and lapis, the tip shows only the non-conditional traits from the diamond, but when this tip is applied to a tool, it shows the traits from the lapis on the tool.
silentgear:or conditions evaluate to true when any of the contained conditions evaluates to true.
For example, this code in lapis_lazuli.json results in Lucky IV being applied whenever lapis is used on a tool, or on a weapon, or whenever there is at least 75% lapis in a part:
{
"name": "silentgear:lucky",
"level": 4,
"conditions": [
{
"type": "silentgear:or",
"values": [
{
"type": "silentgear:gear_type",
"gear_type": "tool"
},
{
"type": "silentgear:gear_type",
"gear_type": "weapon"
},
{
"type": "silentgear:material_ratio",
"ratio": 0.75
}
]
}
]
}
This condition then evaluates to false for the compound tip, but true for the tool, so the trait doesn't appear on the part, but does on the tool.
Links/Images
Steps to Reproduce the Problem
- craft a compound tip with lapis and diamond
- observe traits on the resulting tip
- add tip to a tool or weapon
- observe traits on the resulting tool or weapon
Got a partial fix which will be in the next update, but discovered another issues related to trait conditions.
Mostly just for my reference because I will forget: Trait conditions are discarded by the time compound parts calculate their traits. So it's currently not possible to show if a trait on a part has conditions which may affect whether or not it ends up on a tool. Not sure at the moment how best to fix this, will need to sleep on it.