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 pRenderTarget, Consumer<Component> pMessageConsumer) Saves a screenshot in the game directory with a time-stamped filename.static void
grab
(File pGameDirectory, String pFilename, RenderTarget pRenderTarget, int pDownscaleFactor, Consumer<Component> pMessageConsumer) static void
takeScreenshot
(RenderTarget pRenderTarget, int pDownscaleFactor, Consumer<NativeImage> pWriter) 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 pRenderTarget, Consumer<Component> pMessageConsumer) Saves a screenshot in the game directory with a time-stamped filename. -
grab
public static void grab(File pGameDirectory, @Nullable String pFilename, RenderTarget pRenderTarget, int pDownscaleFactor, Consumer<Component> pMessageConsumer) -
takeScreenshot
-
takeScreenshot
public static void takeScreenshot(RenderTarget pRenderTarget, int pDownscaleFactor, Consumer<NativeImage> pWriter) -
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.
-