Skip to content

Commit

Permalink
Fix adding empty multipliers tag to tools
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Jan 19, 2023
1 parent 4cad219 commit abc51f3
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,13 @@ protected MultiplierNBT getMultipliers() {
* @param multipliers Stats instance
*/
protected void setMultipliers(MultiplierNBT multipliers) {
this.multipliers = multipliers;
nbt.put(TAG_MULTIPLIERS, multipliers.serializeToNBT());
if (multipliers.getContainedStats().isEmpty()) {
this.multipliers = MultiplierNBT.EMPTY;
nbt.remove(TAG_MULTIPLIERS);
} else {
this.multipliers = multipliers;
nbt.put(TAG_MULTIPLIERS, multipliers.serializeToNBT());
}
}

@Override
Expand Down

0 comments on commit abc51f3

Please sign in to comment.