Skip to content

Commit

Permalink
Notify client when velocity is changed (#3718)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeregorix committed Aug 16, 2022
1 parent 826f7a8 commit 073e15b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,16 @@ public static void register(final DataProviderRegistrator registrator) {
.set((h, v) -> h.startRiding((Entity) v, true))
.create(Keys.VELOCITY)
.get(h -> VecHelper.toVector3d(h.getDeltaMovement()))
.set((h, v) -> h.setDeltaMovement(VecHelper.toVanillaVector3d(v)))
.set((h, v) -> {
h.setDeltaMovement(VecHelper.toVanillaVector3d(v));
h.hurtMarked = true;
})
.create(Keys.SWIFTNESS)
.get(m -> m.getDeltaMovement().length())
.set((m, v) -> m.setDeltaMovement(m.getDeltaMovement().normalize().scale(v)))
.set((m, v) -> {
m.setDeltaMovement(m.getDeltaMovement().normalize().scale(v));
m.hurtMarked = true;
})
.supports(m -> m.getDeltaMovement().lengthSqr() > 0)
.asMutable(EntityMaxAirBridge.class)
.create(Keys.MAX_AIR)
Expand Down

0 comments on commit 073e15b

Please sign in to comment.