neoforged / NeoForge

Neo Modding API for Minecraft, based on Forge
https://neoforged.net
Other
1.24k stars 179 forks source link

[1.21.x] Fix certain percentage attributes being displayed wrong #1689

Closed Shadows-of-Fire closed 4 days ago

Shadows-of-Fire commented 1 week ago

This PR fixes the implementation of PercentageAttribute#toValueComponent when the scaleFactor is not equal to 100. The current implementation will cause non-addition modifiers to be displayed incorrectly unless the scale factor is exactly 100.

For example, the modifier below is a +10% ADD_MULTIPLIED_TOTAL modifier, but is incorrectly shown as +100% due to the faulty logic. This is a display-only issue, and is not impacting attribute calculations in any form. This will need to be backported to 1.21.1 as well.

neoforged-pr-publishing[bot] commented 1 week ago

Last commit published: 8b935a1fb0970690c815764517b5944102469850.

PR Publishing ### The artifacts published by this PR: - :package: [`net.neoforged:neoforge:21.3.35-beta-pr-1689-attr-fmt-fix`](https://github.com/neoforged/NeoForge/packages/2314210) - :package: [`net.neoforged:testframework:21.3.35-beta-pr-1689-attr-fmt-fix`](https://github.com/neoforged/NeoForge/packages/2314213) ### Repository Declaration In order to use the artifacts published by the PR, add the following repository to your buildscript: ```gradle repositories { maven { name 'Maven for PR #1689' // https://github.com/neoforged/NeoForge/pull/1689 url 'https://prmaven.neoforged.net/NeoForge/pr1689' 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-pr1689`. On Powershell you will need to remove the `-L` flag from the `curl` invocation. ```sh mkdir NeoForge-pr1689 cd NeoForge-pr1689 curl -L https://prmaven.neoforged.net/NeoForge/pr1689/net/neoforged/neoforge/21.3.35-beta-pr-1689-attr-fmt-fix/mdk-pr1689.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](https://prmaven.neoforged.net/NeoForge/pr1689/net.neoforged/neoforge/21.3.35-beta-pr-1689-attr-fmt-fix/neoforge-21.3.35-beta-pr-1689-attr-fmt-fix-installer.jar).
Shadows-of-Fire commented 6 days ago

Item from 1.21.3 with the fixed modifier text

sciwhiz12 commented 4 days ago

Hold off on merge; currently investigating some libraries being missing in the generated userdev and installer JARs in the newer NeoGradle version that this PR updates to.

neoforged-releases[bot] commented 4 days ago

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