Package net.minecraft.client
Class Screenshot
java.lang.Object
net.minecraft.client.Screenshot
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
private File
private final int
private static final org.slf4j.Logger
private final DataOutputStream
private int
static final String
private final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
_grab
(File pGameDirectory, String pScreenshotName, RenderTarget pBuffer, Consumer<Component> pMessageConsumer) void
addRegion
(ByteBuffer pBuffer, int pWidth, int pHeight, int pRowWidth, int pRowHeight) close()
private static File
Creates a unique PNG file in the given directory named by a timestamp.static void
grab
(File pGameDirectory, RenderTarget pBuffer, Consumer<Component> pMessageConsumer) Saves a screenshot in the game directory with a time-stamped filename.static void
grab
(File pGameDirectory, String pScreenshotName, RenderTarget pBuffer, Consumer<Component> pMessageConsumer) Saves a screenshot in the game directory with the given file name (or null to generate a time-stamped name).void
saveRow()
static NativeImage
takeScreenshot
(RenderTarget pFramebuffer)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SCREENSHOT_DIR
- See Also:
-
rowHeight
private int rowHeight -
outputStream
-
bytes
private final byte[] bytes -
width
private final int width -
height
private final int height -
file
-
-
Constructor Details
-
Screenshot
- Throws:
IOException
-
-
Method Details
-
grab
public static void grab(File pGameDirectory, RenderTarget pBuffer, Consumer<Component> pMessageConsumer) Saves a screenshot in the game directory with a time-stamped filename. -
grab
public static void grab(File pGameDirectory, @Nullable String pScreenshotName, RenderTarget pBuffer, Consumer<Component> pMessageConsumer) Saves a screenshot in the game directory with the given file name (or null to generate a time-stamped name). -
_grab
private static void _grab(File pGameDirectory, @Nullable String pScreenshotName, RenderTarget pBuffer, Consumer<Component> pMessageConsumer) -
takeScreenshot
-
getFile
Creates a unique PNG file in the given directory named by a timestamp. Handles cases where the timestamp alone is not enough to create a uniquely named file, though it still might suffer from an unlikely race condition where the filename was unique when this method was called, but another process or thread created a file at the same path immediately after this method returned. -
addRegion
-
saveRow
- Throws:
IOException
-
close
- Throws:
IOException
-