Description
Imports (#moj_import
) inside a shader file of a resource pack are always loaded regardless if there are preprocessor instructions in place which should prevent loading them. In the attached example resource pack I loaded another shader file (using #moj_import <color_filter.glsl>)
, but the instruction is inside an #ifdef
and should not be executed as long as the expected define is not defined. The resource pack fails to load, because the import (which should not be loaded) tries to load and fails.
#ifdef COLOR_BLINDNESS_TOGGLE
#moj_import <color_filter.glsl>
#endif
Steps to Reproduce
Load the example resource pack in release 1.21.1 (loads without issue)
Load the example resource pack in 1.21.2-pre2 (can't load)
Expected Behaviour
Any instruction inside a #ifdef
or #ifndef
block or any other conditional block should not be executed if the condition is false. This should also apply for loading imports (#moj_import
).
Thank you for your report!
After consideration, the issue is being closed as Won't Fix.
Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki