Merge branch 'elemental-damage-stacking-error-fix' into 'master'

Fixes Stacking of Elements' Double Values - Noticed during fix of Elements tag testing!

See merge request phoenix-dvpmt/mmoitems!30
This commit is contained in:
Jules 2022-11-03 16:53:07 +00:00
commit d1ed762288

View File

@ -33,7 +33,8 @@ public class ElementListData implements Mergeable {
public void merge(StatData data) {
Validate.isTrue(data instanceof ElementListData, "Cannot merge two different stat data types");
ElementListData extra = (ElementListData) data;
extra.stats.forEach((key, value) -> stats.put(key, value));
//Includes old values if any, fixes stacking of element double values I believe - Kilo
extra.stats.forEach((key, value) -> stats.put(key, value + stats.getOrDefault(key,0.0)));
}
@NotNull