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.20) Issue: Trim Materials cannot use modded armor materials when defining different palettes #9540

Open
GizmoTheMoonPig opened this issue Jun 9, 2023 · 1 comment
Labels
1.20 Triage This request requires the active attention of the Triage Team. Requires labelling or reviews.

Comments

@GizmoTheMoonPig
Copy link
Contributor

Minecraft Version: 1.20

Forge Version: 46.0.2

When registering a TrimMaterial, one of the parameters you can fill out is a Map<ArmorMaterials, String> which defines a different trim palette for an armor trim to use if applied to a certain armor type. The issue with this is it uses Minecraft's armor enum, which is currently not extensible. This means custom trim materials cannot use modded Armor Materials when defining different palettes for the trim.

There are 2 ways to fix this that I came up with, however if anyone thinks of a better solution, please use that instead:

  • Make ArmorMaterials implement IExtensibleEnum. This is the easiest solution, but mods would have to rewrite their armor materials
  • Change the map to use something else as the key, such as the ArmorMaterial interface. Mods should already be using this interface for their materials anyway so this would be less work for them. You would also have to patch ArmorTrim.getColorPaletteSuffix as it checks that the material provided is an instanceof ArmorMaterials. Since the method already takes ArmorMaterial as a parameter you would just have to remove this check.

I would do this myself, however I don't currently have the time to make a forge PR nor the motivation to learn how to create patches, so I was told to open a ticket for this.

@GizmoTheMoonPig GizmoTheMoonPig added the Triage This request requires the active attention of the Triage Team. Requires labelling or reviews. label Jun 9, 2023
@Asbestosstar
Copy link

Asbestosstar commented Jul 17, 2023

Cant signature change also break mods since constructors in bytecode often expect the class name. Mods using ArmorTrim would need to recompile. The TrimMaterial Class also referenes codecs in ArmorMaterials

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.20 Triage This request requires the active attention of the Triage Team. Requires labelling or reviews.
Projects
None yet
Development

No branches or pull requests

3 participants