[Legacy] GeckoLib Fabric

[Legacy] GeckoLib Fabric

3M Downloads

[Geckolib 3] Use `LOGGER` in `AnimationController`

solonovamax opened this issue ยท 0 comments

commented

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.