Skip to content

Conversation

@Juuxel
Copy link
Member

@Juuxel Juuxel commented Jun 26, 2025

Fixes a bug introduced in #4703.

The advancement's path is already modified by the getRecipeIdentifier call in each recipe JSON builder mixin, so this applied getRecipeIdentifier twice to a single ID (and to different parts).

For example, this getRecipeIdentifier implementation:

@Override
protected Identifier getRecipeIdentifier(Identifier identifier) {
    return super.getRecipeIdentifier(identifier).withPrefixedPath("foo/");
}

would have resulted in an advancement being placed at data/mod_id/advancement/foo/recipes/.../foo/the_item.json, which is clearly wrong. With this fix, only the last "foo/" will appear.


Can be backported cleanly to any version with #4703 also applied. The 1.21.1 backport is already contained in #4724.

Fixes a bug introduced in FabricMC#4703.

The advancement's path is already modified by the getRecipeIdentifier call
in each recipe JSON builder mixin, so this applied getRecipeIdentifier twice
to a single ID (and to different parts).

For example, this getRecipeIdentifier implementation:
    return super.getRecipeIdentifier(identifier).withPrefixedPath("foo/");
would have resulted in an advancement being placed at
    data/mod_id/advancements/foo/recipes/.../foo/the_item.json,
which is clearly wrong. With this fix, only the last "foo/" will appear.
@modmuss50 modmuss50 added the status: merge me please Pull requests that are ready to merge label Jun 27, 2025
@modmuss50
Copy link
Member

Note to self: needs cherry picking into .5, .6 and .7

@modmuss50 modmuss50 merged commit 55e55d2 into FabricMC:1.21.7 Jun 27, 2025
4 checks passed
modmuss50 pushed a commit that referenced this pull request Jun 27, 2025
Fixes a bug introduced in #4703.

The advancement's path is already modified by the getRecipeIdentifier call
in each recipe JSON builder mixin, so this applied getRecipeIdentifier twice
to a single ID (and to different parts).

For example, this getRecipeIdentifier implementation:
    return super.getRecipeIdentifier(identifier).withPrefixedPath("foo/");
would have resulted in an advancement being placed at
    data/mod_id/advancements/foo/recipes/.../foo/the_item.json,
which is clearly wrong. With this fix, only the last "foo/" will appear.

(cherry picked from commit 55e55d2)
modmuss50 pushed a commit that referenced this pull request Jun 27, 2025
Fixes a bug introduced in #4703.

The advancement's path is already modified by the getRecipeIdentifier call
in each recipe JSON builder mixin, so this applied getRecipeIdentifier twice
to a single ID (and to different parts).

For example, this getRecipeIdentifier implementation:
    return super.getRecipeIdentifier(identifier).withPrefixedPath("foo/");
would have resulted in an advancement being placed at
    data/mod_id/advancements/foo/recipes/.../foo/the_item.json,
which is clearly wrong. With this fix, only the last "foo/" will appear.

(cherry picked from commit 55e55d2)
(cherry picked from commit a0fab30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working small change status: merge me please Pull requests that are ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants