Skip to content

[1.21] AnyHolderSet and NotHolderSet have incorrect canSerializeIn for built-in objects #2073

Open
@Shadows-of-Fire

Description

@Shadows-of-Fire

Both of these types have the following implementations of canSerializeIn:

    @Override
    public boolean canSerializeIn(HolderOwner<T> holderOwner) {
        return this.registryLookup.canSerializeIn(holderOwner);
    }

This is fine for data objects, as the registryLookup will be the holderOwner. However, for built-in objects, the holderOwner is the built-in registry.

Since RegistryLookup has this implementation of canSerializeIn:

    default boolean canSerializeIn(HolderOwner<T> owner) {
        return owner == this;
    }

It fails, and the holder set codec refuses to supply the object. These types need to retain the value of RegistryOps#owner(ResourceKey) to properly implement canSerializeIn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.21Targeted at Minecraft 1.211.21.5Targeted at Minecraft 1.21.5bugA bug or error

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions