Skip to content

Defining SynchedEntityData via BoatMixin causes issues with other mods' boats #532

@unilock

Description

@unilock

Description of the Bug Encountered
Wilder Wild defines a new type of SynchedEntityData for the vanilla Boat entity via mixin here:

@Unique
private static final EntityDataAccessor<Boolean> WILDER_WILD$BOOSTED = SynchedEntityData.defineId(Boat.class, EntityDataSerializers.BOOLEAN);

@Inject(method = "defineSynchedData", at = @At("TAIL"))
public void wilderWild$defineSynchedData(SynchedEntityData.Builder builder, CallbackInfo info) {
builder.define(WILDER_WILD$BOOSTED, false);
}

This causes issues with other mods that do the same thing, or even just extend the Boat class for their own boat types, due to reasons detailed in FabricMC/fabric-api#1049 and FabricMC/fabric-api#3482

Steps To Reproduce

  1. Install Wilder Wild and Nature's Spirit v2.2.5 (the last version that extends vanilla's Boat class for its own boats)
  2. Start the game, join a world, etc.
  3. Place a boat from Nature's Spirit
  4. The game crashes (if it doesn't, add some other mods; the crash is inconsistent)

Expected Behavior
No crash

Screenshots
N/A

Logs
Example with Nature's Spirit: https://gist.github.com/unilock/7c49bb6d9b8f82ca4adf7bae6479f3ca

Additional context
Same issue as #462 and #468, only with boat boosting instead of chest boat types this time

Perhaps Fabric's Data Attachment API could be used instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugReport is about a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions