Skip to content

Commit

Permalink
Rewrite horse.jumpStrength -> modern equivalent
Browse files Browse the repository at this point in the history
  • Loading branch information
SamB440 committed Jul 30, 2024
1 parent 797e963 commit 0bda7bc
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,14 @@ public void updateAttributes(int entityID, List<WrapperPlayServerUpdateAttribute
if (entity == null) return;

for (WrapperPlayServerUpdateAttributes.Property snapshotWrapper : objects) {
final Attribute attribute = snapshotWrapper.getAttribute();
Attribute attribute = snapshotWrapper.getAttribute();
if (attribute == null) continue; // TODO: Warn if this happens? Either modded server or bug in packetevents.

// Rewrite horse.jumpStrength -> modern equivalent
if (attribute == Attributes.HORSE_JUMP_STRENGTH) {
attribute = Attributes.GENERIC_JUMP_STRENGTH;
}

final Optional<ValuedAttribute> valuedAttribute = entity.getAttribute(attribute);
if (!valuedAttribute.isPresent()) {
// Not an attribute we want to track
Expand Down

0 comments on commit 0bda7bc

Please sign in to comment.