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] Move extensible enums to data-driven enum extension #1016

Merged
merged 4 commits into from
Jun 15, 2024

Conversation

XFactHD
Copy link
Member

@XFactHD XFactHD commented May 26, 2024

This PR switches all enums which NeoForge makes extensible to the data-driven approach implemented in neoforged/FancyModLoader#148 and. See the linked FML PR for the motivation behind this change.

Together with the changes proposed in #970 this allows removing most of the patches on these enums as lazy initialization of the data structures, Codecs and StreamCodecs to capture values added later is no longer necessary and the ordering guarantee provided by the reworked enum extension combined with the match check implemented by #970 also means that sending these enums over the network as integers is safe.

@XFactHD XFactHD added enhancement New (or improvement to existing) feature or request breaking change Breaks binary compatibility 1.21 Targeted at Minecraft 1.21 labels May 26, 2024
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented May 26, 2024

  • Publish PR to GitHub Packages

Last commit published: c90de71609704333bb3ee03ebc0e6c218d58399c.

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 #1016' // https://github.com/neoforged/NeoForge/pull/1016
        url 'https://prmaven.neoforged.net/NeoForge/pr1016'
        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-pr1016.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1016
cd NeoForge-pr1016
curl -L https://prmaven.neoforged.net/NeoForge/pr1016/net/neoforged/neoforge/21.0.11-beta-pr-1016-datadriven_enum_extension/mdk-pr1016.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.

@XFactHD XFactHD force-pushed the datadriven_enum_extension branch 2 times, most recently from 432cb6a to 7417877 Compare June 8, 2024 17:54
@XFactHD XFactHD changed the base branch from 1.20.x to port/1.21 June 12, 2024 00:23
@XFactHD XFactHD force-pushed the datadriven_enum_extension branch 2 times, most recently from 0e84d40 to a8de3e1 Compare June 12, 2024 21:13
@XFactHD XFactHD requested a review from Matyrobbrt June 13, 2024 11:43
@XFactHD XFactHD changed the base branch from port/1.21 to 1.21.x June 13, 2024 16:37
@XFactHD XFactHD force-pushed the datadriven_enum_extension branch from 0b79e0d to c90de71 Compare June 14, 2024 17:41
@XFactHD XFactHD marked this pull request as ready for review June 14, 2024 18:02
@Technici4n Technici4n merged commit f923568 into neoforged:1.21.x Jun 15, 2024
6 checks passed
@XFactHD XFactHD deleted the datadriven_enum_extension branch June 15, 2024 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21 Targeted at Minecraft 1.21 breaking change Breaks binary compatibility enhancement New (or improvement to existing) feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants