Skip to content
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

[1.21.3] Fix for data map serialization #1648

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

dhyces
Copy link
Contributor

@dhyces dhyces commented Oct 31, 2024

Closes #1644

Reason for this change is that RegistryOps.create wraps HolderLookup.Providers in a HolderLookupAdapter, which creates a new RegistryInfoLookup and sets the owner field to the registry itself (same object instance as the getter field), rather than whatever it was during datagen, thereby creating a disconnect between holders (which are bound to the real owner) and the registry lookup (which is now the wrong owner). However, RegistrySetBuilder uses its own anonymous HolderLookup.Provider which overrides createSerializationContext to return a RegistryOps with a RegistryInfoLookup which would obtain the correct owner for the given registry based on how it was built during RegistrySetBuilder#buildProviderWithContext.

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Oct 31, 2024

  • Publish PR to GitHub Packages

Last commit published: 5351fcd7616eae4b36f2bce36c04a05459d31746.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #1648' // https://github.com/neoforged/NeoForge/pull/1648
        url 'https://prmaven.neoforged.net/NeoForge/pr1648'
        content {
            includeModule('net.neoforged', 'neoforge')
            includeModule('net.neoforged', 'testframework')
        }
    }
}

MDK installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr1648.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1648
cd NeoForge-pr1648
curl -L https://prmaven.neoforged.net/NeoForge/pr1648/net/neoforged/neoforge/21.3.8-beta-pr-1648-fix-datamap-serialization/mdk-pr1648.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip

To test a production environment, you can download the installer from here.

@dhyces dhyces changed the title [1.21.3] New possible fix for data map serialization [1.21.3] Fix for data map serialization Oct 31, 2024
@dhyces dhyces marked this pull request as ready for review October 31, 2024 00:53
@XFactHD XFactHD added bug A bug or error data driven This request involves a data driven system 1.21.3 Targeted at Minecraft 1.21.3 labels Oct 31, 2024
@ZestyBlaze
Copy link
Contributor

Closes #1644

@XFactHD XFactHD linked an issue Oct 31, 2024 that may be closed by this pull request
@XFactHD XFactHD merged commit 62eb61a into neoforged:1.21.x Oct 31, 2024
9 checks passed
@neoforged-releases
Copy link

🚀 This PR has been released as NeoForge version 21.3.6-beta.

@dhyces dhyces deleted the fix/datamap-serialization branch October 31, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.3 Targeted at Minecraft 1.21.3 bug A bug or error data driven This request involves a data driven system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HolderOwners being wrapped messing up RegistryFixedCodec
3 participants