BendingItems v1.7.0
Changelog
- Fixed issue with bending items in the offhand not removing properly when uses are depleted
- Fixed possible issue with multiple similar bending items being removed when one's uses are depleted
- Fixed usage display of the
/bending itemcommand to include theequiparg for "equipping" bending items withHOLDINGusage so that they remain in the player's main hand while scrolling slots - Updated Uses functionality to be more discerning in what causes uses to be consumed
- Changed how mods on bending items are parsed internally, so now any operation of addition, multiplication, subtraction, and division is possible, along with having multiple of these operations in one statement. This is explained below.
- Default bending items have been updated to reflect this change. Since they are config files, they will not update unless regenerated manually.
Note about the Uses property of bending items: it is possible for multiple abilities to be "activated" at the same time, especially for earth and water, so when using the Uses property I would advise not using
basemods so that uses are only consumed when appropriate abilities are activated.
New Mods Parsing
The change described above will not affect any existing mods, but allows for more explicit control over mods in general. This is useful in the case of something like cooldowns, durations, charge times, and other time-based attributes. In general, when dealing with attributes datatypes may not match nicely. This can cause certain cases where it appears mods are not working. Here is an example:
Mods:
EarthArmor:
Cooldown: "x0.7"In this case, the intended effect is for EarthArmor's cooldown to be reduced by 30%. The issue that arises is that time-based fields are typically stored as the datatype long, which is not a decimal format, but our mod is. So when PK tries to modify the attribute, it converts the 0.7 into the long type. This conversion simply truncates digits after the decimal point, so the resulting effect would be multiplying the cooldown by zero. Obviously we don't want this, but there's no good way to fix this internally. So, the solution is multiple operations. Here is what that looks like:
Mods:
EarthArmor:
Cooldown: "x7,/10"Here we've listed two operations to happen: first we multiply by seven, and then we divide by ten. This achieves the same effect as multiplying by 0.7, but it will work for any datatype. The drawback is more verbose mods, but I think it is worth it. In general, it would be better to write decimals out in this fashion instead, but decimals will still work for many mods.