Class ScreenshotRecorder

java.lang.Object
net.minecraft.client.util.ScreenshotRecorder

@Environment(CLIENT) public class ScreenshotRecorder extends Object
A screenshot recorder takes screenshots and saves them into tga file format. It also holds a few utility methods for other types of screenshots.
Mappings:
Namespace Name
named net/minecraft/client/util/ScreenshotRecorder
intermediary net/minecraft/class_318
official fmn
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      named LOGGER Lnet/minecraft/client/util/ScreenshotRecorder;LOGGER:Lorg/slf4j/Logger;
      intermediary field_1974 Lnet/minecraft/class_318;field_1974:Lorg/slf4j/Logger;
      official b Lfmn;b:Lorg/slf4j/Logger;
    • SCREENSHOTS_DIRECTORY

      public static final String SCREENSHOTS_DIRECTORY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named SCREENSHOTS_DIRECTORY Lnet/minecraft/client/util/ScreenshotRecorder;SCREENSHOTS_DIRECTORY:Ljava/lang/String;
      intermediary field_41337 Lnet/minecraft/class_318;field_41337:Ljava/lang/String;
      official a Lfmn;a:Ljava/lang/String;
    • unitHeight

      private int unitHeight
      Mappings:
      Namespace Name Mixin selector
      named unitHeight Lnet/minecraft/client/util/ScreenshotRecorder;unitHeight:I
      intermediary field_32157 Lnet/minecraft/class_318;field_32157:I
      official c Lfmn;c:I
    • stream

      private final DataOutputStream stream
      Mappings:
      Namespace Name Mixin selector
      named stream Lnet/minecraft/client/util/ScreenshotRecorder;stream:Ljava/io/DataOutputStream;
      intermediary field_32158 Lnet/minecraft/class_318;field_32158:Ljava/io/DataOutputStream;
      official d Lfmn;d:Ljava/io/DataOutputStream;
    • buffer

      private final byte[] buffer
      Mappings:
      Namespace Name Mixin selector
      named buffer Lnet/minecraft/client/util/ScreenshotRecorder;buffer:[B
      intermediary field_32159 Lnet/minecraft/class_318;field_32159:[B
      official e Lfmn;e:[B
    • width

      private final int width
      Mappings:
      Namespace Name Mixin selector
      named width Lnet/minecraft/client/util/ScreenshotRecorder;width:I
      intermediary field_32160 Lnet/minecraft/class_318;field_32160:I
      official f Lfmn;f:I
    • height

      private final int height
      Mappings:
      Namespace Name Mixin selector
      named height Lnet/minecraft/client/util/ScreenshotRecorder;height:I
      intermediary field_32161 Lnet/minecraft/class_318;field_32161:I
      official g Lfmn;g:I
    • file

      private File file
      Mappings:
      Namespace Name Mixin selector
      named file Lnet/minecraft/client/util/ScreenshotRecorder;file:Ljava/io/File;
      intermediary field_32162 Lnet/minecraft/class_318;field_32162:Ljava/io/File;
      official h Lfmn;h:Ljava/io/File;
  • Constructor Details

    • ScreenshotRecorder

      public ScreenshotRecorder(File gameDirectory, int width, int height, int unitHeight) throws IOException
      Creates a screenshot recorder for huge screenshots.
      Throws:
      IOException
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/client/util/ScreenshotRecorder;<init>(Ljava/io/File;III)V
      intermediary <init> Lnet/minecraft/class_318;<init>(Ljava/io/File;III)V
      official <init> Lfmn;<init>(Ljava/io/File;III)V
  • Method Details

    • saveScreenshot

      public static void saveScreenshot(File gameDirectory, Framebuffer framebuffer, Consumer<Text> messageReceiver)
      Mappings:
      Namespace Name Mixin selector
      named saveScreenshot Lnet/minecraft/client/util/ScreenshotRecorder;saveScreenshot(Ljava/io/File;Lnet/minecraft/client/gl/Framebuffer;Ljava/util/function/Consumer;)V
      intermediary method_1659 Lnet/minecraft/class_318;method_1659(Ljava/io/File;Lnet/minecraft/class_276;Ljava/util/function/Consumer;)V
      official a Lfmn;a(Ljava/io/File;Lffb;Ljava/util/function/Consumer;)V
    • saveScreenshot

      public static void saveScreenshot(File gameDirectory, @Nullable @Nullable String fileName, Framebuffer framebuffer, Consumer<Text> messageReceiver)
      Mappings:
      Namespace Name Mixin selector
      named saveScreenshot Lnet/minecraft/client/util/ScreenshotRecorder;saveScreenshot(Ljava/io/File;Ljava/lang/String;Lnet/minecraft/client/gl/Framebuffer;Ljava/util/function/Consumer;)V
      intermediary method_22690 Lnet/minecraft/class_318;method_22690(Ljava/io/File;Ljava/lang/String;Lnet/minecraft/class_276;Ljava/util/function/Consumer;)V
      official a Lfmn;a(Ljava/io/File;Ljava/lang/String;Lffb;Ljava/util/function/Consumer;)V
    • saveScreenshotInner

      private static void saveScreenshotInner(File gameDirectory, @Nullable @Nullable String fileName, Framebuffer framebuffer, Consumer<Text> messageReceiver)
      Mappings:
      Namespace Name Mixin selector
      named saveScreenshotInner Lnet/minecraft/client/util/ScreenshotRecorder;saveScreenshotInner(Ljava/io/File;Ljava/lang/String;Lnet/minecraft/client/gl/Framebuffer;Ljava/util/function/Consumer;)V
      intermediary method_1662 Lnet/minecraft/class_318;method_1662(Ljava/io/File;Ljava/lang/String;Lnet/minecraft/class_276;Ljava/util/function/Consumer;)V
      official b Lfmn;b(Ljava/io/File;Ljava/lang/String;Lffb;Ljava/util/function/Consumer;)V
    • takeScreenshot

      public static NativeImage takeScreenshot(Framebuffer framebuffer)
      Mappings:
      Namespace Name Mixin selector
      named takeScreenshot Lnet/minecraft/client/util/ScreenshotRecorder;takeScreenshot(Lnet/minecraft/client/gl/Framebuffer;)Lnet/minecraft/client/texture/NativeImage;
      intermediary method_1663 Lnet/minecraft/class_318;method_1663(Lnet/minecraft/class_276;)Lnet/minecraft/class_1011;
      official a Lfmn;a(Lffb;)Lffr;
    • getScreenshotFilename

      private static File getScreenshotFilename(File directory)
      Mappings:
      Namespace Name Mixin selector
      named getScreenshotFilename Lnet/minecraft/client/util/ScreenshotRecorder;getScreenshotFilename(Ljava/io/File;)Ljava/io/File;
      intermediary method_1660 Lnet/minecraft/class_318;method_1660(Ljava/io/File;)Ljava/io/File;
      official a Lfmn;a(Ljava/io/File;)Ljava/io/File;
    • getIntoBuffer

      public void getIntoBuffer(ByteBuffer data, int startWidth, int startHeight, int unitWidth, int unitHeight)
      Transports image data from data into buffer.
      Mappings:
      Namespace Name Mixin selector
      named getIntoBuffer Lnet/minecraft/client/util/ScreenshotRecorder;getIntoBuffer(Ljava/nio/ByteBuffer;IIII)V
      intermediary method_35711 Lnet/minecraft/class_318;method_35711(Ljava/nio/ByteBuffer;IIII)V
      official a Lfmn;a(Ljava/nio/ByteBuffer;IIII)V
    • writeToStream

      public void writeToStream() throws IOException
      Writes the contents in the buffer into the stream.
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named writeToStream Lnet/minecraft/client/util/ScreenshotRecorder;writeToStream()V
      intermediary method_35710 Lnet/minecraft/class_318;method_35710()V
      official a Lfmn;a()V
    • finish

      public File finish() throws IOException
      Finish taking the screenshot and return the complete tga file.
      Returns:
      the tga file
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named finish Lnet/minecraft/client/util/ScreenshotRecorder;finish()Ljava/io/File;
      intermediary method_35712 Lnet/minecraft/class_318;method_35712()Ljava/io/File;
      official b Lfmn;b()Ljava/io/File;