-
-
Notifications
You must be signed in to change notification settings - Fork 179
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] Overhaul tps command to be more colorful and organized #1422
Conversation
Last commit published: c2f464d7f7659ebf131a2fc30ad813fccd74685b. PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #1422' // https://github.com/neoforged/NeoForge/pull/1422
url 'https://prmaven.neoforged.net/NeoForge/pr1422'
content {
includeModule('net.neoforged', 'neoforge')
includeModule('net.neoforged', 'testframework')
}
}
} MDK installationIn order to setup a MDK using the latest PR version, run the following commands in a terminal. mkdir NeoForge-pr1422
cd NeoForge-pr1422
curl -L https://prmaven.neoforged.net/NeoForge/pr1422/net/neoforged/neoforge/21.1.42-pr-1422-pr-tps-command/mdk-pr1422.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. |
Please don't drop the "ms" unit. Please revert those commas back to periods or use lowercase after them. ", Mean" is just mean ;) Also, I would suggest using The "Dimension:" prefix seems unnecessary to me. I would drop it to avoid line breaking. |
Added back the Dropped the dimension prefix and updated to auto-translate if a matching translation key exists (defaults to the raw registry name if missing): I have included translations for the vanilla dimensions, but modders will have to include their own. The raw dimension registry name has also been added as a hover tooltip when hovering over the dimension component. Below is an example of these changes. Note how the Nether is |
Locked behind #1428, Will need updating if that PR goes through |
@ApexModder, this pull request has conflicts, please resolve them for this PR to move forward. |
d5fe4c0
to
4cf3a06
Compare
src/main/java/net/neoforged/neoforge/server/command/TPSCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/server/command/TPSCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/server/command/TPSCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/net/neoforged/neoforge/server/command/TPSCommand.java
Outdated
Show resolved
Hide resolved
I think it's better if the colours are part of the translation and use vanilla's weird character instead of being hard-coded, as it would be more customizable, especially for people that have a hard time with the built in colours. |
While this would work for the coloring, how would I go about applying the hover tooltips that way? |
Just a side note: The json-array format probably can do hover, but it should not be used as it falls apart on Crowdin. The SGML-format could be extended to support hover and even parameterised hovers; I just never thought about this use case. |
That's correct, that much can stay code, but the colouring should still be part of the lang entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One detail I'm not sure about, otherwise the code looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small comments remaining on my end. Otherwise, it looks fine.
src/main/java/net/neoforged/neoforge/server/command/TPSCommand.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, clicked the wrong button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay to me, and it works. Waiting on @XFactHD to rereview.
Also replace magic number with TimeUtil constant
Rename 'dim' to 'dimension' for better readability
While keeping all of the same information and stylization
4c2cf5e
to
c2f464d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🚀 This PR has been released as NeoForge version |
The
/neoforge tps <dim>
command output has been overhauled to be much more colorful, making it easier to read and understand at a glance.Both the TPS and Tick Time components now have a “hover event” to better explain the values. Additionally, the mean TPS fades from green to red, making it quicker and easier to identify laggy dimensions.
Before
After