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.x] Preserve original iteration order in Attribute Formatting API #1831

Open
wants to merge 2 commits into
base: 1.21.x
Choose a base branch
from

Conversation

Shadows-of-Fire
Copy link
Contributor

@Shadows-of-Fire Shadows-of-Fire commented Jan 9, 2025

This PR updates the attribute formatting API to maintain the original (component-provided) attribute iteration order, instead of relying on a predefined sort order. The old sort order was developed in 1.20, before vanilla stored the attribute modifiers as a List (it was previously a Multimap).

It also updates the debug text for base modifiers to be less verbose. The current form of the text [Entity: %s | Base: %s] is simply too long and not necessary when the user already understands what the debug information being presented means (which is to be assumed for debug data like this).

Screenshots of the change to the base modifier debug text:

Before:

After:

@Shadows-of-Fire Shadows-of-Fire self-assigned this Jan 9, 2025
@neoforged-automation neoforged-automation bot added the 1.21.4 Targeted at Minecraft 1.21.4 label Jan 9, 2025
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Jan 9, 2025

  • Publish PR to GitHub Packages

Last commit published: 5d938bc12850b6e1d301698138559e595d657599.

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

mkdir NeoForge-pr1831
cd NeoForge-pr1831
curl -L https://prmaven.neoforged.net/NeoForge/pr1831/net/neoforged/neoforge/21.4.79-beta-pr-1831-attr-tooltip-order/mdk-pr1831.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.

@Shadows-of-Fire Shadows-of-Fire added the cleanup Change that isn't an enhancement or a bug fix label Jan 27, 2025
@Shadows-of-Fire Shadows-of-Fire changed the title [1.21.x] Test preserving iteration order in AttributeUtil [1.21.x] Preserve original iteration order in Attribute Formatting API Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.4 Targeted at Minecraft 1.21.4 cleanup Change that isn't an enhancement or a bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant