Fix adding empty multipliers tag to tools
@@ -383,9 +383,14 @@ public class ToolStack implements IToolStackView {
* @param multipliers Stats instance
*/
protected void setMultipliers(MultiplierNBT multipliers) {
+ if (multipliers.getContainedStats().isEmpty()) {
+ this.multipliers = MultiplierNBT.EMPTY;
+ nbt.remove(TAG_MULTIPLIERS);
+ } else {
this.multipliers = multipliers;
nbt.put(TAG_MULTIPLIERS, multipliers.serializeToNBT());
}
+ }
@Override
public float getMultiplier(INumericToolStat<?> stat) {
