Skip to content

Feat: server-side dolphins grace to match speed increase#6172

Open
onebeastchris wants to merge 1 commit intoGeyserMC:masterfrom
onebeastchris:fix/dolphin-grace
Open

Feat: server-side dolphins grace to match speed increase#6172
onebeastchris wants to merge 1 commit intoGeyserMC:masterfrom
onebeastchris:fix/dolphin-grace

Conversation

@onebeastchris
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings February 8, 2026 23:36
@onebeastchris onebeastchris changed the title Initial work on somewhat supporting server-side dolphins grace Feat: server-side dolphins grace to match speed increase Feb 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial support for server-sent Dolphin’s Grace by synchronizing a Bedrock movement-related attribute when the Java effect is applied/removed, including during dimension switches.

Changes:

  • Update Bedrock player attributes when Java Dolphin’s Grace is applied (update effect translator).
  • Revert the attribute when Dolphin’s Grace is removed (remove effect translator) and when clearing effects during dimension switches.
  • Introduce new attribute types to support underwater/lava movement attribute updates.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java Sends an attribute update when Dolphin’s Grace is cleared during dimension switching.
core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaUpdateMobEffectTranslator.java Triggers an underwater movement attribute update when Dolphin’s Grace is applied.
core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaRemoveMobEffectTranslator.java Reverts the underwater movement attribute when Dolphin’s Grace is removed.
core/src/main/java/org/geysermc/geyser/entity/type/player/SessionPlayerEntity.java Adds a helper to toggle the Bedrock underwater movement attribute for Dolphin’s Grace.
core/src/main/java/org/geysermc/geyser/entity/attribute/GeyserAttributeType.java Adds attribute enum entries needed to represent underwater/lava movement attributes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +67 to +68
LAVA_MOVEMENT(null, "minecraft:lava_movement", 0f, 3.4028235E38f, 0.02f),
UNDERWATER_MOVEMENT(null, "minecraft:underwater_movement", 0f, 3.4028235E38f, 0.02f);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LAVA_MOVEMENT and UNDERWATER_MOVEMENT use a hard-coded float literal (3.4028235E38f) for the maximum value. Elsewhere in this enum (e.g., ATTACK_KNOCKBACK) Float.MAX_VALUE is used; using the constant here would improve readability and reduce the chance of typos or inconsistencies.

Suggested change
LAVA_MOVEMENT(null, "minecraft:lava_movement", 0f, 3.4028235E38f, 0.02f),
UNDERWATER_MOVEMENT(null, "minecraft:underwater_movement", 0f, 3.4028235E38f, 0.02f);
LAVA_MOVEMENT(null, "minecraft:lava_movement", 0f, Float.MAX_VALUE, 0.02f),
UNDERWATER_MOVEMENT(null, "minecraft:underwater_movement", 0f, Float.MAX_VALUE, 0.02f);

Copilot uses AI. Check for mistakes.
Comment on lines +576 to +577
public AttributeData updateDolphinsGrace(boolean value) {
AttributeData data = GeyserAttributeType.UNDERWATER_MOVEMENT.getAttribute(value ? 0.024f : 0.02f);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateDolphinsGrace hard-codes both the “off” value (0.02f) and the “on” value (0.024f). Consider deriving the “off” value from GeyserAttributeType.UNDERWATER_MOVEMENT.getDefaultValue() (to avoid drift if the default changes) and extracting the “on” multiplier/value into a named constant with a short rationale (magic numbers are hard to validate/maintain).

Suggested change
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);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants