Skip to content

Commit

Permalink
fix: sync default valued attributes
Browse files Browse the repository at this point in the history
(cherry picked from commit 29b3a60)
  • Loading branch information
WiIIiam278 committed Sep 28, 2024
1 parent b9b510f commit 487cb91
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,7 @@ public static BukkitData.Attributes adapt(@NotNull Player player, @NotNull HuskS
final AttributeSettings settings = plugin.getSettings().getSynchronization().getAttributes();
Registry.ATTRIBUTE.forEach(id -> {
final AttributeInstance instance = player.getAttribute(id);
if (settings.isIgnoredAttribute(id.getKey().toString()) || instance == null
|| Double.compare(instance.getValue(), instance.getDefaultValue()) == 0) {
if (settings.isIgnoredAttribute(id.getKey().toString()) || instance == null) {
return; // We don't sync attributes not marked as to be synced
}
attributes.add(adapt(instance, settings));
Expand Down

0 comments on commit 487cb91

Please sign in to comment.