Class GLImportProcessor

java.lang.Object
net.minecraft.client.gl.GLImportProcessor

@Environment(CLIENT) public abstract class GLImportProcessor extends Object
Handles the flattening of "moj_" import strings in the loaded GLSL shader file. Instances of an import are replaced by the contents of the referenced file prefixed by a comment describing the line position and original file location of the import.
Mappings:
Namespace Name
official dza
intermediary net/minecraft/class_5913
named net/minecraft/client/gl/GLImportProcessor
  • Field Details

    • MULTI_LINE_COMMENT_PATTERN

      private static final String MULTI_LINE_COMMENT_PATTERN
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldza;a:Ljava/lang/String;
      intermediary field_32036 Lnet/minecraft/class_5913;field_32036:Ljava/lang/String;
      named MULTI_LINE_COMMENT_PATTERN Lnet/minecraft/client/gl/GLImportProcessor;MULTI_LINE_COMMENT_PATTERN:Ljava/lang/String;
    • SINGLE_LINE_COMMENT_PATTERN

      private static final String SINGLE_LINE_COMMENT_PATTERN
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Ldza;b:Ljava/lang/String;
      intermediary field_33620 Lnet/minecraft/class_5913;field_33620:Ljava/lang/String;
      named SINGLE_LINE_COMMENT_PATTERN Lnet/minecraft/client/gl/GLImportProcessor;SINGLE_LINE_COMMENT_PATTERN:Ljava/lang/String;
    • MOJ_IMPORT_PATTERN

      private static final Pattern MOJ_IMPORT_PATTERN
      Mappings:
      Namespace Name Mixin selector
      official c Ldza;c:Ljava/util/regex/Pattern;
      intermediary field_29200 Lnet/minecraft/class_5913;field_29200:Ljava/util/regex/Pattern;
      named MOJ_IMPORT_PATTERN Lnet/minecraft/client/gl/GLImportProcessor;MOJ_IMPORT_PATTERN:Ljava/util/regex/Pattern;
    • IMPORT_VERSION_PATTERN

      private static final Pattern IMPORT_VERSION_PATTERN
      Mappings:
      Namespace Name Mixin selector
      official d Ldza;d:Ljava/util/regex/Pattern;
      intermediary field_29201 Lnet/minecraft/class_5913;field_29201:Ljava/util/regex/Pattern;
      named IMPORT_VERSION_PATTERN Lnet/minecraft/client/gl/GLImportProcessor;IMPORT_VERSION_PATTERN:Ljava/util/regex/Pattern;
    • TRAILING_WHITESPACE_PATTERN

      private static final Pattern TRAILING_WHITESPACE_PATTERN
      Mappings:
      Namespace Name Mixin selector
      official e Ldza;e:Ljava/util/regex/Pattern;
      intermediary field_33621 Lnet/minecraft/class_5913;field_33621:Ljava/util/regex/Pattern;
      named TRAILING_WHITESPACE_PATTERN Lnet/minecraft/client/gl/GLImportProcessor;TRAILING_WHITESPACE_PATTERN:Ljava/util/regex/Pattern;
  • Constructor Details

    • GLImportProcessor

      public GLImportProcessor()
  • Method Details

    • readSource

      public List<String> readSource(String source)
      Reads the source code supplied into a list of lines suitable for uploading to the GL Shader cache.

      Imports are processed as per the description of this class.

      Mappings:
      Namespace Name Mixin selector
      official a Ldza;a(Ljava/lang/String;)Ljava/util/List;
      intermediary method_34229 Lnet/minecraft/class_5913;method_34229(Ljava/lang/String;)Ljava/util/List;
      named readSource Lnet/minecraft/client/gl/GLImportProcessor;readSource(Ljava/lang/String;)Ljava/util/List;
    • parseImports

      private List<String> parseImports(String source, GLImportProcessor.Context context, String path)
      Mappings:
      Namespace Name Mixin selector
      official a Ldza;a(Ljava/lang/String;Ldza$a;Ljava/lang/String;)Ljava/util/List;
      intermediary method_34232 Lnet/minecraft/class_5913;method_34232(Ljava/lang/String;Lnet/minecraft/class_5913$class_5914;Ljava/lang/String;)Ljava/util/List;
      named parseImports Lnet/minecraft/client/gl/GLImportProcessor;parseImports(Ljava/lang/String;Lnet/minecraft/client/gl/GLImportProcessor$Context;Ljava/lang/String;)Ljava/util/List;
    • extractVersion

      private String extractVersion(String line, GLImportProcessor.Context context)
      Converts a line known to contain an import into a fully-qualified version of itself for insertion as a comment.
      Mappings:
      Namespace Name Mixin selector
      official a Ldza;a(Ljava/lang/String;Ldza$a;)Ljava/lang/String;
      intermediary method_34231 Lnet/minecraft/class_5913;method_34231(Ljava/lang/String;Lnet/minecraft/class_5913$class_5914;)Ljava/lang/String;
      named extractVersion Lnet/minecraft/client/gl/GLImportProcessor;extractVersion(Ljava/lang/String;Lnet/minecraft/client/gl/GLImportProcessor$Context;)Ljava/lang/String;
    • readImport

      private String readImport(String line, int start)
      Mappings:
      Namespace Name Mixin selector
      official a Ldza;a(Ljava/lang/String;I)Ljava/lang/String;
      intermediary method_34230 Lnet/minecraft/class_5913;method_34230(Ljava/lang/String;I)Ljava/lang/String;
      named readImport Lnet/minecraft/client/gl/GLImportProcessor;readImport(Ljava/lang/String;I)Ljava/lang/String;
    • isLineValid

      private static boolean isLineValid(String line, Matcher matcher)
      Mappings:
      Namespace Name Mixin selector
      official a Ldza;a(Ljava/lang/String;Ljava/util/regex/Matcher;)Z
      intermediary method_36423 Lnet/minecraft/class_5913;method_36423(Ljava/lang/String;Ljava/util/regex/Matcher;)Z
      named isLineValid Lnet/minecraft/client/gl/GLImportProcessor;isLineValid(Ljava/lang/String;Ljava/util/regex/Matcher;)Z
    • hasBogusString

      private static boolean hasBogusString(String string, Matcher matcher, int matchEnd)
      Mappings:
      Namespace Name Mixin selector
      official a Ldza;a(Ljava/lang/String;Ljava/util/regex/Matcher;I)Z
      intermediary method_36424 Lnet/minecraft/class_5913;method_36424(Ljava/lang/String;Ljava/util/regex/Matcher;I)Z
      named hasBogusString Lnet/minecraft/client/gl/GLImportProcessor;hasBogusString(Ljava/lang/String;Ljava/util/regex/Matcher;I)Z
    • loadImport

      @Nullable public abstract @Nullable String loadImport(boolean inline, String name)
      Called to load an import reference's source code.
      Mappings:
      Namespace Name Mixin selector
      official a Ldza;a(ZLjava/lang/String;)Ljava/lang/String;
      intermediary method_34233 Lnet/minecraft/class_5913;method_34233(ZLjava/lang/String;)Ljava/lang/String;
      named loadImport Lnet/minecraft/client/gl/GLImportProcessor;loadImport(ZLjava/lang/String;)Ljava/lang/String;