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

[Geckolib 3] Use LOGGER in AnimationController #654

Open
solonovamax opened this issue Nov 23, 2024 · 0 comments
Open

[Geckolib 3] Use LOGGER in AnimationController #654

solonovamax opened this issue Nov 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@solonovamax
Copy link

Currently, in Geckolib 3.x, System.out.printf is used to emit a warning/error:

if (animation == null) {
System.out.printf("Could not load animation: %s. Is it missing?", rawAnimation.animationName);
encounteredError.set(true);
}

System.out.printf will not emit a newline after printing, so you can end up with scenarios where you see something like the following in your logs:

Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?Could not load animation: death. Is it missing?[18:20:19] [Render thread/WARN] [minecraft/ClientPacketListener]: Received passengers for unknown entity

Instead, a Logger should be use so that

  1. it identifies the source of the log message
  2. it properly indicates that it is a warning/error
  3. it prints a newline at the end of the message, avoiding these very long lines

If, for whatever reason, it is not possible to use a logger, then consider at the very least doing one of the following:

  1. System.out.printf("Could not load animation: %s. Is it missing?%n", rawAnimation.animationName);
    (note: the %n at the end of the message)
  2. System.out.println("Could not load animation: " + rawAnimation.animationName + ". Is it missing?");

Even if 3.x versions are no longer maintained, this is a rather small release so it does not require a lot of effort to do.

@Tslat Tslat added the enhancement New feature or request label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants