Fix OBJ Material Legacy Mapping#18
Conversation
There was a problem hiding this comment.
Pull request overview
Updates OBJ material “legacy” shader tag mapping across Fabric/Forge and multiple Minecraft versions to align with the NTE naming scheme.
Changes:
- Add support for
exteriortranslucent->TRANSLUCENT. - Replace legacy tag handling from underscored forms to non-underscored forms (
lighttranslucent,interiortranslucent). - Apply the same mapping updates across all supported Fabric/Forge mapping modules.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| forge/1.20.4-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| forge/1.20.1-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| forge/1.19.4-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| forge/1.19.2-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| forge/1.18.2-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| forge/1.17.1-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| fabric/1.20.4-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| fabric/1.20.1-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| fabric/1.19.4-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| fabric/1.19.2-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| fabric/1.18.2-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
| fabric/1.17.1-mapping/src/main/java/org/mtr/mapping/render/obj/ObjModelLoader.java | Updates legacy shader tag string-to-ShaderType mapping cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private static OptimizedModel.ShaderType legacyMapping(String type) { | ||
| switch (type.toLowerCase(Locale.ENGLISH)) { | ||
| case "exteriortranslucent": | ||
| return OptimizedModel.ShaderType.TRANSLUCENT; | ||
| case "light": |
There was a problem hiding this comment.
legacyMapping dropped support for legacy material tags like always_on_light and interior_translucent; those inputs will now fall back to CUTOUT and change rendering for existing OBJ/MTL content. If this method is meant to preserve backward compatibility, keep the old case labels as aliases (e.g., map always_on_light -> TRANSLUCENT_GLOWING and interior_translucent -> TRANSLUCENT_BRIGHT, and optionally accept both underscored and non-underscored variants).
| private static OptimizedModel.ShaderType legacyMapping(String type) { | ||
| switch (type.toLowerCase(Locale.ENGLISH)) { | ||
| case "exteriortranslucent": | ||
| return OptimizedModel.ShaderType.TRANSLUCENT; | ||
| case "light": |
There was a problem hiding this comment.
legacyMapping dropped support for legacy material tags like always_on_light and interior_translucent; those inputs will now fall back to CUTOUT and change rendering for existing OBJ/MTL content. If this method is meant to preserve backward compatibility, keep the old case labels as aliases (e.g., map always_on_light -> TRANSLUCENT_GLOWING and interior_translucent -> TRANSLUCENT_BRIGHT, and optionally accept both underscored and non-underscored variants).
| private static OptimizedModel.ShaderType legacyMapping(String type) { | ||
| switch (type.toLowerCase(Locale.ENGLISH)) { | ||
| case "exteriortranslucent": | ||
| return OptimizedModel.ShaderType.TRANSLUCENT; | ||
| case "light": |
There was a problem hiding this comment.
legacyMapping dropped support for legacy material tags like always_on_light and interior_translucent; those inputs will now fall back to CUTOUT and change rendering for existing OBJ/MTL content. If this method is meant to preserve backward compatibility, keep the old case labels as aliases (e.g., map always_on_light -> TRANSLUCENT_GLOWING and interior_translucent -> TRANSLUCENT_BRIGHT, and optionally accept both underscored and non-underscored variants).
| private static OptimizedModel.ShaderType legacyMapping(String type) { | ||
| switch (type.toLowerCase(Locale.ENGLISH)) { | ||
| case "exteriortranslucent": | ||
| return OptimizedModel.ShaderType.TRANSLUCENT; | ||
| case "light": |
There was a problem hiding this comment.
legacyMapping dropped support for legacy material tags like always_on_light and interior_translucent; those inputs will now fall back to CUTOUT and change rendering for existing OBJ/MTL content. If this method is meant to preserve backward compatibility, keep the old case labels as aliases (e.g., map always_on_light -> TRANSLUCENT_GLOWING and interior_translucent -> TRANSLUCENT_BRIGHT, and optionally accept both underscored and non-underscored variants).
| private static OptimizedModel.ShaderType legacyMapping(String type) { | ||
| switch (type.toLowerCase(Locale.ENGLISH)) { | ||
| case "exteriortranslucent": | ||
| return OptimizedModel.ShaderType.TRANSLUCENT; | ||
| case "light": |
There was a problem hiding this comment.
legacyMapping dropped support for legacy material tags like always_on_light and interior_translucent; those inputs will now fall back to CUTOUT and change rendering for existing OBJ/MTL content. If this method is meant to preserve backward compatibility, keep the old case labels as aliases (e.g., map always_on_light -> TRANSLUCENT_GLOWING and interior_translucent -> TRANSLUCENT_BRIGHT, and optionally accept both underscored and non-underscored variants).
| private static OptimizedModel.ShaderType legacyMapping(String type) { | ||
| switch (type.toLowerCase(Locale.ENGLISH)) { | ||
| case "exteriortranslucent": | ||
| return OptimizedModel.ShaderType.TRANSLUCENT; | ||
| case "light": |
There was a problem hiding this comment.
legacyMapping dropped support for legacy material tags like always_on_light and interior_translucent; those inputs will now fall back to CUTOUT and change rendering for existing OBJ/MTL content. If this method is meant to preserve backward compatibility, keep the old case labels as aliases (e.g., map always_on_light -> TRANSLUCENT_GLOWING and interior_translucent -> TRANSLUCENT_BRIGHT, and optionally accept both underscored and non-underscored variants).
| private static OptimizedModel.ShaderType legacyMapping(String type) { | ||
| switch (type.toLowerCase(Locale.ENGLISH)) { | ||
| case "exteriortranslucent": | ||
| return OptimizedModel.ShaderType.TRANSLUCENT; | ||
| case "light": |
There was a problem hiding this comment.
legacyMapping dropped support for legacy material tags like always_on_light and interior_translucent; those inputs will now fall back to CUTOUT and change rendering for existing OBJ/MTL content. If this method is meant to preserve backward compatibility, keep the old case labels as aliases (e.g., map always_on_light -> TRANSLUCENT_GLOWING and interior_translucent -> TRANSLUCENT_BRIGHT, and optionally accept both underscored and non-underscored variants).
| private static OptimizedModel.ShaderType legacyMapping(String type) { | ||
| switch (type.toLowerCase(Locale.ENGLISH)) { | ||
| case "exteriortranslucent": | ||
| return OptimizedModel.ShaderType.TRANSLUCENT; | ||
| case "light": |
There was a problem hiding this comment.
legacyMapping dropped support for legacy material tags like always_on_light and interior_translucent; those inputs will now fall back to CUTOUT and change rendering for existing OBJ/MTL content. If this method is meant to preserve backward compatibility, keep the old case labels as aliases (e.g., map always_on_light -> TRANSLUCENT_GLOWING and interior_translucent -> TRANSLUCENT_BRIGHT, and optionally accept both underscored and non-underscored variants).
| private static OptimizedModel.ShaderType legacyMapping(String type) { | ||
| switch (type.toLowerCase(Locale.ENGLISH)) { | ||
| case "exteriortranslucent": | ||
| return OptimizedModel.ShaderType.TRANSLUCENT; | ||
| case "light": |
There was a problem hiding this comment.
legacyMapping dropped support for legacy material tags like always_on_light and interior_translucent; those inputs will now fall back to CUTOUT and change rendering for existing OBJ/MTL content. If this method is meant to preserve backward compatibility, keep the old case labels as aliases (e.g., map always_on_light -> TRANSLUCENT_GLOWING and interior_translucent -> TRANSLUCENT_BRIGHT, and optionally accept both underscored and non-underscored variants).
| private static OptimizedModel.ShaderType legacyMapping(String type) { | ||
| switch (type.toLowerCase(Locale.ENGLISH)) { | ||
| case "exteriortranslucent": | ||
| return OptimizedModel.ShaderType.TRANSLUCENT; | ||
| case "light": |
There was a problem hiding this comment.
legacyMapping dropped support for legacy material tags like always_on_light and interior_translucent; those inputs will now fall back to CUTOUT and change rendering for existing OBJ/MTL content. If this method is meant to preserve backward compatibility, keep the old case labels as aliases (e.g., map always_on_light -> TRANSLUCENT_GLOWING and interior_translucent -> TRANSLUCENT_BRIGHT, and optionally accept both underscored and non-underscored variants).
For backward compatibility, we don't know how many of these models are out there already...
Change them to comply with NTE