-
-
Notifications
You must be signed in to change notification settings - Fork 821
Feat: server-side dolphins grace to match speed increase #6172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -572,4 +572,10 @@ public void forceFlagUpdate() { | |||||||||||||||||||||||||||||||
| public boolean isGliding() { | ||||||||||||||||||||||||||||||||
| return getFlag(EntityFlag.GLIDING); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| public AttributeData updateDolphinsGrace(boolean value) { | ||||||||||||||||||||||||||||||||
| AttributeData data = GeyserAttributeType.UNDERWATER_MOVEMENT.getAttribute(value ? 0.024f : 0.02f); | ||||||||||||||||||||||||||||||||
|
Comment on lines
+576
to
+577
|
||||||||||||||||||||||||||||||||
| public AttributeData updateDolphinsGrace(boolean value) { | |
| AttributeData data = GeyserAttributeType.UNDERWATER_MOVEMENT.getAttribute(value ? 0.024f : 0.02f); | |
| /** | |
| * Multiplier applied to the default underwater movement speed when Dolphin's Grace is active. | |
| * 1.2x corresponds to Java's Dolphin's Grace movement speed increase. | |
| */ | |
| private static final float DOLPHINS_GRACE_UNDERWATER_SPEED_MULTIPLIER = 1.2f; | |
| public AttributeData updateDolphinsGrace(boolean value) { | |
| float baseUnderwaterMovement = (float) GeyserAttributeType.UNDERWATER_MOVEMENT.getDefaultValue(); | |
| float underwaterMovement = value | |
| ? baseUnderwaterMovement * DOLPHINS_GRACE_UNDERWATER_SPEED_MULTIPLIER | |
| : baseUnderwaterMovement; | |
| AttributeData data = GeyserAttributeType.UNDERWATER_MOVEMENT.getAttribute(underwaterMovement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LAVA_MOVEMENTandUNDERWATER_MOVEMENTuse a hard-coded float literal (3.4028235E38f) for the maximum value. Elsewhere in this enum (e.g.,ATTACK_KNOCKBACK)Float.MAX_VALUEis used; using the constant here would improve readability and reduce the chance of typos or inconsistencies.