Package net.minecraft.client
Class Screenshot
java.lang.Object
net.minecraft.client.Screenshot
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate 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).static void
takeScreenshot
(RenderTarget pRenderTarget, Consumer<NativeImage> pWriter)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SCREENSHOT_DIR
- See Also:
-
-
Constructor Details
-
Screenshot
public Screenshot()
-
-
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). -
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.
-