You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
GizmoTheMoonPig
added
the
Triage
This request requires the active attention of the Triage Team. Requires labelling or reviews.
label
Jun 9, 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
Minecraft Version: 1.20
Forge Version: 46.0.2
When registering a
TrimMaterial
, one of the parameters you can fill out is aMap<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:
ArmorMaterials
implementIExtensibleEnum
. This is the easiest solution, but mods would have to rewrite their armor materialsArmorMaterial
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 patchArmorTrim.getColorPaletteSuffix
as it checks that the material provided is an instanceofArmorMaterials
. Since the method already takesArmorMaterial
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.
The text was updated successfully, but these errors were encountered: