类 ScreenshotEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.ScreenshotEvent
public class ScreenshotEvent
extends net.minecraftforge.eventbus.api.Event
Fired when a screenshot is taken, but before it is written to disk.
This event is cancellable, and does not have a result. If this event is cancelled, then the screenshot is not written to disk, and the message in the event will be posted to the player's chat.
This event is fired on the main Forge event bus, only on the logical client.
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Returns the cancellation message to be used in informing the player.getImage()
返回 the in-memory image of the screenshot。返回 the custom cancellation message, ornull
if no custom message is set。void
setResultMessage
(Component resultMessage) Sets the new custom cancellation message used to inform the player.void
setScreenshotFile
(File screenshotFile) Sets the new file where the screenshot will be saved to.从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
DEFAULT_CANCEL_REASON
-
image
-
screenshotFile
-
resultMessage
-
-
构造器详细资料
-
ScreenshotEvent
-
-
方法详细资料
-
getImage
返回 the in-memory image of the screenshot。- 返回:
- the in-memory image of the screenshot
-
getScreenshotFile
- 返回:
- the file where the screenshot will be saved to
-
setScreenshotFile
Sets the new file where the screenshot will be saved to.- 参数:
screenshotFile
- the new filepath
-
getResultMessage
返回 the custom cancellation message, ornull
if no custom message is set。- 返回:
- the custom cancellation message, or
null
if no custom message is set
-
setResultMessage
Sets the new custom cancellation message used to inform the player. It may benull
, in which case the default cancel reason will be used.- 参数:
resultMessage
- the new result message
-
getCancelMessage
Returns the cancellation message to be used in informing the player.If there is no custom message given (
getResultMessage()
returnsnull
), then the message will be the default cancel reason message.- 返回:
- the cancel message for the player
-