Class Instruction
java.lang.Object
xyz.gmitch215.socketmc.instruction.Instruction
- All Implemented Interfaces:
Serializable
,Paramaterized
Represents a SocketMC Instruction to be sent to the client.
All instructions are serialized and sent over the network as byte arrays. They contain an id and a list of parameters that are serialized and sent through the player's channel.
All instructions are serialized and sent over the network as byte arrays. They contain an id and a list of parameters that are serialized and sent through the player's channel.
Notes
- Instructions are immutable and cannot be modified after creation.
- Instructions are serializable and can be sent over the network as byte arrays.
- All X, Y, Height, Width, and other measurements used in drawing instructions are in pixels.
- Players render things on the screen based on their own FPS (Frames Per Second), hence the provision of timed renderings in milliseconds. In addition, you can specify
-1
for an infinite duration. - SocketMC v0.1.3 introduced a permission system that allows or disallows specific types of Instructions. If permission is not given, the Instruction will silently fail.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Instruction to close the current GUI screen on the client's screen.static final String
Instruction to display a toast message on the client's screen.static final String
Instruction to draw a beacon beam in the world.static final String
Instruction to set the draw buffer for the client.static final String
Instruction to draw a rawDrawingContext
.static final String
Instruction to draw an item on the client's screen.static final String
Instruction to draw a rectangle on the client's screen.static final String
Instruction to draw text on the client's screen.static final String
Instruction to draw a texture on the client's screen.static final String
Instruction to display a message box using the OS's native notification system.static final String
Instruction to display a notification popup using the OS's native notification system.static final String
Instruction to hide players from the social interactions menu.static final String
Instruction to log a message in the client's logs.static final String
Instruction to open an external address in the client's default email application.static final String
Instruction for the narrator to speak.static final String
Instruction to open an empty book and quill GUI on the client's screen, allowing for long text input.static final String
Instruction to open an external link in the client's browser.static final String
Instruction to open a GUI screen on the client's screen.static final String
Instruction to play the beeping noise specific to the client's operating system.static final String
Instruction to verify SocketMC is present.static final String
Instruction to play audio on the client's device.static final String
Instruction to modify the functionality of a specific client renderer.static final String
Instruction to change the overlay of the client.static final String
Instruction to change the native window icon of the client.static final String
Instruction to change the native window title of the client.static final String
Instruction to show players on the social interactions menu. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Instruction
Creates aCLOSE_SCREEN
instruction.static @NotNull Instruction
displayToast
(@NotNull Toast toast) Creates aDISPLAY_TOAST
instruction.static @NotNull Instruction
drawBeaconBeam
(int x, int y, int z, int height, long millis) Creates aDRAW_BEACON_BEAM
instruction.static @NotNull Instruction
drawBeaconBeam
(int x, int y, int z, int height, @NotNull Color color, int yOffset, float beamRadius, float glowRadius, long millis) Creates aDRAW_BEACON_BEAM
instruction.static @NotNull Instruction
drawBeaconBeam
(int x, int y, int z, int height, @NotNull Color color, int yOffset, float beamRadius, float glowRadius, @NotNull Duration duration) Creates aDRAW_BEACON_BEAM
instruction.static @NotNull Instruction
drawBeaconBeam
(int x, int y, int z, int height, @NotNull Color color, int yOffset, long millis) Creates aDRAW_BEACON_BEAM
instruction.static @NotNull Instruction
drawBeaconBeam
(int x, int y, int z, int height, @NotNull Color color, int yOffset, @NotNull Duration duration) Creates aDRAW_BEACON_BEAM
instruction.static @NotNull Instruction
drawBeaconBeam
(int x, int y, int z, int height, @NotNull Color color, long millis) Creates aDRAW_BEACON_BEAM
instruction.static @NotNull Instruction
drawBeaconBeam
(int x, int y, int z, int height, @NotNull Color color, @NotNull Duration duration) Creates aDRAW_BEACON_BEAM
instruction.static @NotNull Instruction
drawBeaconBeam
(int x, int y, int z, int height, @NotNull Duration duration) Creates aDRAW_BEACON_BEAM
instruction.static @NotNull Instruction
drawBuffer
(@NotNull RenderBuffer buffer, long millis) Creates aDRAW_BUFFER
instruction.static @NotNull Instruction
drawBuffer
(@NotNull RenderBuffer buffer, @NotNull Duration duration) Creates aDRAW_BUFFER
instruction.static @NotNull Instruction
drawContext
(@NotNull DrawingContext context, long millis) Creates aDRAW_CONTEXT
instruction.static @NotNull Instruction
drawContext
(@NotNull DrawingContext context, @NotNull Duration duration) Creates aDRAW_CONTEXT
instruction.static @NotNull Instruction
drawGradientRect
(int x, int y, int width, int height, @NotNull Color from, int fromAlpha, @NotNull Color to, int toAlpha, int z, long millis) Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).static @NotNull Instruction
drawGradientRect
(int x, int y, int width, int height, @NotNull Color from, int fromAlpha, @NotNull Color to, int toAlpha, int z, @NotNull Duration duration) Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).static @NotNull Instruction
drawGradientRect
(int x, int y, int width, int height, @NotNull Color from, int fromAlpha, @NotNull Color to, int toAlpha, long millis) Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).static @NotNull Instruction
drawGradientRect
(int x, int y, int width, int height, @NotNull Color from, int fromAlpha, @NotNull Color to, int toAlpha, @NotNull Duration duration) Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).static @NotNull Instruction
drawGradientRect
(int x, int y, int width, int height, @NotNull Color from, @NotNull Color to, long millis) Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).static @NotNull Instruction
drawGradientRect
(int x, int y, int width, int height, @NotNull Color from, @NotNull Color to, @NotNull Duration duration) Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).static @NotNull Instruction
drawHorizontalLine
(int x, int y, int width, long millis) Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
).static @NotNull Instruction
drawHorizontalLine
(int x, int y, int width, @NotNull Color color, int alpha, long millis) Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
).static @NotNull Instruction
drawHorizontalLine
(int x, int y, int width, @NotNull Color color, int alpha, @NotNull Duration duration) Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
).static @NotNull Instruction
drawHorizontalLine
(int x, int y, int width, @NotNull Color color, long millis) Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
).static @NotNull Instruction
drawHorizontalLine
(int x, int y, int width, @NotNull Color color, @NotNull Duration duration) Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
).static @NotNull Instruction
drawHorizontalLine
(int x, int y, int width, @NotNull Duration duration) Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
).static @NotNull Instruction
drawItemStack
(@NotNull NBTTag item, int x, int y, int guiOffset, int randomSeed, long millis) Creates aDRAW_ITEMSTACK
instruction.static @NotNull Instruction
drawItemStack
(@NotNull NBTTag item, int x, int y, int guiOffset, int randomSeed, @NotNull Duration duration) Creates aDRAW_ITEMSTACK
instruction.static @NotNull Instruction
drawItemStack
(@NotNull NBTTag item, int x, int y, int guiOffset, long millis) Creates aDRAW_ITEMSTACK
instruction.static @NotNull Instruction
drawItemStack
(@NotNull NBTTag item, int x, int y, int guiOffset, @NotNull Duration duration) Creates aDRAW_ITEMSTACK
instruction.static @NotNull Instruction
drawItemStack
(@NotNull NBTTag item, int x, int y, long millis) Creates aDRAW_ITEMSTACK
instruction.static @NotNull Instruction
drawItemStack
(@NotNull NBTTag item, int x, int y, @NotNull Duration duration) Creates aDRAW_ITEMSTACK
instruction.static @NotNull Instruction
drawRect
(int x, int y, int width, int height, long millis) Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).static @NotNull Instruction
Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).static @NotNull Instruction
drawRect
(int x, int y, int width, int height, @NotNull Color color, int alpha, @NotNull Duration duration) Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).static @NotNull Instruction
Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).static @NotNull Instruction
Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).static @NotNull Instruction
Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).static @NotNull Instruction
Creates aDRAW_TEXT
instruction.static @NotNull Instruction
Creates aDRAW_TEXT
instruction.static @NotNull Instruction
Creates aDRAW_TEXT
instruction.static @NotNull Instruction
Creates aDRAW_TEXT
instruction.static @NotNull Instruction
drawText
(int x, int y, String text, @NotNull Color color, int alpha, boolean dropShadow, long millis) Creates aDRAW_TEXT
instruction.static @NotNull Instruction
drawText
(int x, int y, String text, @NotNull Color color, int alpha, boolean dropShadow, @NotNull Duration duration) Creates aDRAW_TEXT
instruction.static @NotNull Instruction
Creates aDRAW_TEXT
instruction.static @NotNull Instruction
Creates aDRAW_TEXT
instruction.static @NotNull Instruction
Creates aDRAW_TEXT
instruction.static @NotNull Instruction
Creates aDRAW_TEXT
instruction.static @NotNull Instruction
Creates aDRAW_TEXT
instruction.static @NotNull Instruction
Creates aDRAW_TEXT
instruction.static @NotNull Instruction
drawTexture
(int x, int y, int width, int height, @NotNull Identifier texture, int startLeft, int startTop, int regionWidth, int regionHeight, long millis) Creates aDRAW_TEXTURE
instruction.static @NotNull Instruction
drawTexture
(int x, int y, int width, int height, @NotNull Identifier texture, int startLeft, int startTop, int regionWidth, int regionHeight, @NotNull Duration duration) Creates aDRAW_TEXTURE
instruction.static @NotNull Instruction
drawTexture
(int x, int y, int width, int height, @NotNull Identifier texture, int startLeft, int startTop, long millis) Creates aDRAW_TEXTURE
instruction.static @NotNull Instruction
drawTexture
(int x, int y, int width, int height, @NotNull Identifier texture, int startLeft, int startTop, @NotNull Duration duration) Creates aDRAW_TEXTURE
instruction.static @NotNull Instruction
drawTexture
(int x, int y, int width, int height, @NotNull Identifier texture, long millis) Creates aDRAW_TEXTURE
instruction.static @NotNull Instruction
drawTexture
(int x, int y, int width, int height, @NotNull Identifier texture, @NotNull Duration duration) Creates aDRAW_TEXTURE
instruction.static @NotNull Instruction
drawVerticalLine
(int x, int y, int height, long millis) Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
).static @NotNull Instruction
drawVerticalLine
(int x, int y, int height, @NotNull Color color, int alpha, long millis) Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
).static @NotNull Instruction
drawVerticalLine
(int x, int y, int height, @NotNull Color color, int alpha, @NotNull Duration duration) Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
).static @NotNull Instruction
drawVerticalLine
(int x, int y, int height, @NotNull Color color, long millis) Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
).static @NotNull Instruction
drawVerticalLine
(int x, int y, int height, @NotNull Color color, @NotNull Duration duration) Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
).static @NotNull Instruction
drawVerticalLine
(int x, int y, int height, @NotNull Duration duration) Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
).boolean
static @NotNull Instruction
externalWindowMessageBox
(@NotNull String title, @NotNull String message) Creates aEXTERNAL_WINDOW_MESSAGE_BOX
instruction withWindowDialogue.OK
.static @NotNull Instruction
externalWindowMessageBox
(@NotNull String title, @NotNull String message, @NotNull WindowDialogue dialogue) Creates aEXTERNAL_WINDOW_MESSAGE_BOX
instruction.static @NotNull Instruction
externalWindowMessageBox
(@NotNull String title, @NotNull String message, @NotNull WindowDialogue dialogue, @NotNull WindowIcon icon) Creates aEXTERNAL_WINDOW_MESSAGE_BOX
instruction.static @NotNull Instruction
externalWindowMessageBox
(@NotNull String title, @NotNull String message, @NotNull WindowDialogue dialogue, @NotNull WindowIcon icon, boolean cancelDefault) Creates aEXTERNAL_WINDOW_MESSAGE_BOX
instruction.static @NotNull Instruction
externalWindowPopup
(@NotNull String title, @NotNull String message) Creates aEXTERNAL_WINDOW_POPUP
instruction.static @NotNull Instruction
externalWindowPopup
(@NotNull String title, @NotNull String message, @NotNull WindowIcon icon) Creates aEXTERNAL_WINDOW_POPUP
instruction.static @Nullable Instruction
fromByteArray
(byte[] instruction) Deserializes an Instruction from a byte array received over the network.getId()
Gets the ID of this instruction.Gets an immutable copy of this instruction's parameters.Gets the permission required to execute this instruction.static @NotNull ModPermission
Gets the permission required to execute an instruction by its ID.int
hashCode()
static @NotNull Instruction
hidePlayers
(@NotNull Iterable<UUID> players) Creates aHIDE_PLAYERS
instruction.static @NotNull Instruction
hidePlayers
(@NotNull UUID... players) Creates aHIDE_PLAYERS
instruction.static String[]
ids()
Gets all the IDs of the instructions in this class.static @NotNull Instruction
logMessage
(@NotNull String message) Creates aLOG_MESSAGE
instruction.static @NotNull Instruction
Creates aMAILTO
instruction.static @NotNull Instruction
Creates aMAILTO
instruction.static @NotNull Instruction
Creates aNARRATE
instruction.static @NotNull Instruction
Creates aNARRATE
instruction.static @NotNull Instruction
Creates aOPEN_BOOK_AND_QUILL
instruction.static @NotNull Instruction
Creates aOPEN_LINK
instruction.static @NotNull Instruction
openScreen
(@NotNull AbstractScreen screen) Creates aOPEN_SCREEN
instruction.static @NotNull Instruction
osBeep()
Creates aOS_BEEP
instruction.static @NotNull Instruction
ping()
Creates aPING
instruction.static @NotNull Instruction
Creates aPLAY_AUDIO
instruction.static @NotNull Instruction
playAudio
(@NotNull InputStream file) Creates aPLAY_AUDIO
instruction.static @NotNull Instruction
renderer
(@NotNull RenderInstruction instruction) Creates aRENDERER
instruction.static @NotNull Instruction
setOverlay
(@Nullable Overlay overlay) Creates aSET_OVERLAY
instruction.static @NotNull Instruction
setWindowIcon
(byte[] icon) Creates aSET_WINDOW_ICON
instruction.static @NotNull Instruction
setWindowTitle
(@NotNull String title) Creates aSET_WINDOW_TITLE
instruction.static @NotNull Instruction
showPlayers
(@NotNull Iterable<UUID> players) Creates aSHOW_PLAYERS
instruction.static @NotNull Instruction
showPlayers
(@NotNull UUID... players) Creates aSHOW_PLAYERS
instruction.byte[]
Serializes this Instruction to a byte array to be passed over the network.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface xyz.gmitch215.socketmc.util.Paramaterized
booleanParameter, booleanParameter, doubleParameter, doubleParameter, firstBooleanParameter, firstDoubleParameter, firstFloatParameter, firstIntParameter, firstLongParameter, firstParameter, firstParameter, firstStringParameter, floatParameter, floatParameter, getParameters, intParameter, intParameter, lastBooleanParameter, lastDoubleParameter, lastFloatParameter, lastIntParameter, lastLongParameter, lastParameter, lastParameter, lastStringParameter, longParameter, longParameter, parameter, parameter, parameter, stringParameter, stringParameter
-
Field Details
-
PING
Instruction to verify SocketMC is present. This then enables events to be sent from the client to the server, if not already enabled.- See Also:
-
DRAW_TEXT
Instruction to draw text on the client's screen.- See Also:
-
DRAW_SHAPE
Instruction to draw a rectangle on the client's screen.- See Also:
-
PLAY_AUDIO
Instruction to play audio on the client's device. This supports all audio formats supported by the client, according to its JDK. Most commonly is.wav
and.au
.- See Also:
-
DRAW_BUFFER
Instruction to set the draw buffer for the client. This is used to draw complex shapes on the client's screen.- See Also:
-
LOG_MESSAGE
Instruction to log a message in the client's logs. This is not the same thing as theAuditLog
API.- See Also:
-
DRAW_TEXTURE
Instruction to draw a texture on the client's screen.- See Also:
-
OPEN_BOOK_AND_QUILL
Instruction to open an empty book and quill GUI on the client's screen, allowing for long text input.- See Also:
-
OPEN_SCREEN
Instruction to open a GUI screen on the client's screen.- See Also:
-
CLOSE_SCREEN
Instruction to close the current GUI screen on the client's screen.- See Also:
-
RENDERER
Instruction to modify the functionality of a specific client renderer.- See Also:
-
DRAW_BEACON_BEAM
Instruction to draw a beacon beam in the world.- See Also:
-
OPEN_LINK
Instruction to open an external link in the client's browser.- See Also:
-
MAILTO
Instruction to open an external address in the client's default email application.- See Also:
-
DRAW_CONTEXT
Instruction to draw a rawDrawingContext
.- See Also:
-
NARRATE
Instruction for the narrator to speak.- See Also:
-
DISPLAY_TOAST
Instruction to display a toast message on the client's screen.- See Also:
-
OS_BEEP
Instruction to play the beeping noise specific to the client's operating system.- See Also:
-
EXTERNAL_WINDOW_POPUP
Instruction to display a notification popup using the OS's native notification system.- See Also:
-
EXTERNAL_WINDOW_MESSAGE_BOX
Instruction to display a message box using the OS's native notification system.- See Also:
-
SET_WINDOW_TITLE
Instruction to change the native window title of the client.- See Also:
-
SET_OVERLAY
Instruction to change the overlay of the client.- See Also:
-
DRAW_ITEMSTACK
Instruction to draw an item on the client's screen.- See Also:
-
SET_WINDOW_ICON
Instruction to change the native window icon of the client.- See Also:
-
SHOW_PLAYERS
Instruction to show players on the social interactions menu.- See Also:
-
HIDE_PLAYERS
Instruction to hide players from the social interactions menu.- See Also:
-
-
Method Details
-
getId
Gets the ID of this instruction.- Returns:
- Instruction ID
-
getParameters
Gets an immutable copy of this instruction's parameters.- Specified by:
getParameters
in interfaceParamaterized
- Returns:
- Instruction Parameters
-
getPermission
Gets the permission required to execute this instruction.- Returns:
- Instruction Permission
-
equals
-
hashCode
public int hashCode() -
toString
-
ids
Gets all the IDs of the instructions in this class.- Returns:
- Instruction IDs
-
getPermission
Gets the permission required to execute an instruction by its ID.- Parameters:
id
- Instruction ID- Returns:
- Instruction Permission
-
ping
Creates aPING
instruction.- Returns:
- Ping Instruction
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, @NotNull @NotNull String text, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawduration
- Time Duration- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates or duration are negative, or the text is null
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, @NotNull @NotNull String text, long millis) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawmillis
- Duration to display, in milliseconds- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates or duration are negative, or the text is null
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, String text, @NotNull @NotNull Color color, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawcolor
- Text Colorduration
- Time Duration- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates or duration are negative, the text is null, or the color is null
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, String text, @NotNull @NotNull Color color, long millis) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawcolor
- Text Colormillis
- Duration to display, in milliseconds- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates are negative, the text is null, or the color is null
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, String text, @NotNull @NotNull Color color, int alpha, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawcolor
- Text Coloralpha
- Color Alpha (0-255
/0x00 - 0xFF
).duration
- Time Duration- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates or duration are negative, the text is null, the color is null, or alpha is not 0-255
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, String text, @NotNull @NotNull Color color, int alpha, long millis) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawcolor
- Text Coloralpha
- Color Alpha (0-255
/0x00 - 0xFF
).millis
- Duration to display, in milliseconds- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates or duration are negative, the text is null, the color is null, or alpha is not 0-255
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, String text, @NotNull @NotNull Color color, int alpha, boolean dropShadow, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawcolor
- Text Coloralpha
- Color Alpha (0-255
/0x00 - 0xFF
).dropShadow
- Whether to Draw a Drop Shadowduration
- Time Duration- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates are negative, the text is null, or the color is null
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, String text, @NotNull @NotNull Color color, int alpha, boolean dropShadow, long millis) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawcolor
- Text Coloralpha
- Color Alpha (0-255
/0x00 - 0xFF
).dropShadow
- Whether to Draw a Drop Shadowmillis
- Duration to display, in milliseconds- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates are negative, the text is null, or the color is null
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, String text, int argb, boolean dropShadow, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawargb
- Text Color (ARGB)dropShadow
- Whether to Draw a Drop Shadowduration
- Time Duration- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates are negative, the text is null, or the color is null
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, String text, int argb, boolean dropShadow, long millis) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawargb
- Text Color (ARGB)dropShadow
- Whether to Draw a Drop Shadowmillis
- Duration to display, in milliseconds- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates are negative, the text is null, or the color is null
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, @NotNull @NotNull Text text, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawduration
- Time Duration- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates or duration are negative, or the text is null
-
drawText
@NotNull public static @NotNull Instruction drawText(int x, int y, @NotNull @NotNull Text text, long millis) throws IllegalArgumentException Creates aDRAW_TEXT
instruction.- Parameters:
x
- X Coordinate for Texty
- Y Coordinate for Texttext
- Text to Drawmillis
- Duration to display, in milliseconds- Returns:
- Draw Text Instruction
- Throws:
IllegalArgumentException
- If the coordinates or duration are negative, or the text is null
-
drawRect
@NotNull public static @NotNull Instruction drawRect(int x, int y, int width, int height, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapeduration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative
-
drawRect
@NotNull public static @NotNull Instruction drawRect(int x, int y, int width, int height, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapemillis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative
-
drawRect
@NotNull public static @NotNull Instruction drawRect(int x, int y, int width, int height, @NotNull @NotNull Color color, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapecolor
- Shape Colorduration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the color is null
-
drawRect
@NotNull public static @NotNull Instruction drawRect(int x, int y, int width, int height, @NotNull @NotNull Color color, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapecolor
- Shape Colormillis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the color is null
-
drawRect
@NotNull public static @NotNull Instruction drawRect(int x, int y, int width, int height, @NotNull @NotNull Color color, int alpha, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapecolor
- Shape Coloralpha
- Color Alpha (0-255
/0x00 - 0xFF
).duration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the color is null, or the alpha is not 0-255
-
drawRect
@NotNull public static @NotNull Instruction drawRect(int x, int y, int width, int height, @NotNull @NotNull Color color, int alpha, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a rectangle ("fill"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapecolor
- Shape Coloralpha
- Color Alpha (0-255
/0x00 - 0xFF
).millis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the color is null, or the alpha is not 0-255
-
drawGradientRect
@NotNull public static @NotNull Instruction drawGradientRect(int x, int y, int width, int height, @NotNull @NotNull Color from, @NotNull @NotNull Color to, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapefrom
- Gradient Start Colorto
- Gradient End Colorduration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the colors are null
-
drawGradientRect
@NotNull public static @NotNull Instruction drawGradientRect(int x, int y, int width, int height, @NotNull @NotNull Color from, @NotNull @NotNull Color to, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapefrom
- Gradient Start Colorto
- Gradient End Colormillis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the colors are null
-
drawGradientRect
@NotNull public static @NotNull Instruction drawGradientRect(int x, int y, int width, int height, @NotNull @NotNull Color from, int fromAlpha, @NotNull @NotNull Color to, int toAlpha, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapefrom
- Gradient Start ColorfromAlpha
- Gradient Start Alpha (0-255
/0x00 - 0xFF
).to
- Gradient End ColortoAlpha
- Gradient End Alpha (0-255
/0x00 - 0xFF
).duration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the colors are null, or the alphas are not 0-255
-
drawGradientRect
@NotNull public static @NotNull Instruction drawGradientRect(int x, int y, int width, int height, @NotNull @NotNull Color from, int fromAlpha, @NotNull @NotNull Color to, int toAlpha, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapefrom
- Gradient Start ColorfromAlpha
- Gradient Start Alpha (0-255
/0x00 - 0xFF
).to
- Gradient End ColortoAlpha
- Gradient End Alpha (0-255
/0x00 - 0xFF
).millis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the colors are null, or the alphas are not 0-255
-
drawGradientRect
@NotNull public static @NotNull Instruction drawGradientRect(int x, int y, int width, int height, @NotNull @NotNull Color from, int fromAlpha, @NotNull @NotNull Color to, int toAlpha, int z, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapefrom
- Gradient Start ColorfromAlpha
- Gradient Start Alpha (0-255
/0x00 - 0xFF
).to
- Gradient End ColortoAlpha
- Gradient End Alpha (0-255
/0x00 - 0xFF
).z
- Shape Z-Indexduration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the colors are null, or the alphas are not 0-255
-
drawGradientRect
@NotNull public static @NotNull Instruction drawGradientRect(int x, int y, int width, int height, @NotNull @NotNull Color from, int fromAlpha, @NotNull @NotNull Color to, int toAlpha, int z, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a gradient rectangle ("gradient"
).- Parameters:
x
- X Coordinate for Shapey
- Y Coordinate for Shapewidth
- Width of Shapeheight
- Height of Shapefrom
- Gradient Start ColorfromAlpha
- Gradient Start Alpha (0-255
/0x00 - 0xFF
).to
- Gradient End ColortoAlpha
- Gradient End Alpha (0-255
/0x00 - 0xFF
).z
- Shape Z-Indexmillis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the colors are null, or the alphas are not 0-255
-
drawVerticalLine
@NotNull public static @NotNull Instruction drawVerticalLine(int x, int y, int height, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
). The line is 1 pixel wide.- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Lineheight
- Height of Lineduration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates or dimensions are negative
-
drawVerticalLine
@NotNull public static @NotNull Instruction drawVerticalLine(int x, int y, int height, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
). The line is 1 pixel wide.- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Lineheight
- Height of Linemillis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative
-
drawVerticalLine
@NotNull public static @NotNull Instruction drawVerticalLine(int x, int y, int height, @NotNull @NotNull Color color, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
). The line is 1 pixel wide.- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Lineheight
- Height of Linecolor
- Line Colorduration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the color is null
-
drawVerticalLine
@NotNull public static @NotNull Instruction drawVerticalLine(int x, int y, int height, @NotNull @NotNull Color color, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
). The line is 1 pixel wide.- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Lineheight
- Height of Linecolor
- Line Colormillis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the color is null
-
drawVerticalLine
@NotNull public static @NotNull Instruction drawVerticalLine(int x, int y, int height, @NotNull @NotNull Color color, int alpha, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
). The line is 1 pixel wide.- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Lineheight
- Height of Linecolor
- Line Coloralpha
- Color Alpha (0-255
/0x00 - 0xFF
).duration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the color is null, or the alpha is not 0-255
-
drawVerticalLine
@NotNull public static @NotNull Instruction drawVerticalLine(int x, int y, int height, @NotNull @NotNull Color color, int alpha, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a vertical line ("line_v"
). The line is 1 pixel wide.- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Lineheight
- Height of Linecolor
- Line Coloralpha
- Color Alpha (0-255
/0x00 - 0xFF
).millis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the color is null, or the alpha is not 0-255
-
drawHorizontalLine
@NotNull public static @NotNull Instruction drawHorizontalLine(int x, int y, int width, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
). The line is 1 pixel long.- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Linewidth
- Width of Lineduration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates or dimensions are negative
-
drawHorizontalLine
@NotNull public static @NotNull Instruction drawHorizontalLine(int x, int y, int width, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
). The line is 1 pixel long.- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Linewidth
- Width of Linemillis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates or dimensions are negative
-
drawHorizontalLine
@NotNull public static @NotNull Instruction drawHorizontalLine(int x, int y, int width, @NotNull @NotNull Color color, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
). The line is 1 pixel long.- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Linewidth
- Width of Linecolor
- Line Colorduration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the color is null
-
drawHorizontalLine
@NotNull public static @NotNull Instruction drawHorizontalLine(int x, int y, int width, @NotNull @NotNull Color color, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
). The line is 1 pixel long.- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Linewidth
- Width of Linecolor
- Line Colormillis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the color is null
-
drawHorizontalLine
@NotNull public static @NotNull Instruction drawHorizontalLine(int x, int y, int width, @NotNull @NotNull Color color, int alpha, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
).- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Linewidth
- Width of Linecolor
- Line Coloralpha
- Color Alpha (0-255
/0x00 - 0xFF
).duration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the color is null, or the alpha is not 0-255
-
drawHorizontalLine
@NotNull public static @NotNull Instruction drawHorizontalLine(int x, int y, int width, @NotNull @NotNull Color color, int alpha, long millis) throws IllegalArgumentException Creates aDRAW_SHAPE
instruction for a horizontal line ("line_h"
).- Parameters:
x
- X Coordinate for Liney
- Y Coordinate for Linewidth
- Width of Linecolor
- Line Coloralpha
- Color Alpha (0-255
/0x00 - 0xFF
).millis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the color is null, or the alpha is not 0-255
-
drawBuffer
@NotNull public static @NotNull Instruction drawBuffer(@NotNull @NotNull RenderBuffer buffer, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_BUFFER
instruction.- Parameters:
buffer
- Render Bufferduration
- Time Duration- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the buffer is null, or the duration is negative
-
drawBuffer
@NotNull public static @NotNull Instruction drawBuffer(@NotNull @NotNull RenderBuffer buffer, long millis) throws IllegalArgumentException Creates aDRAW_BUFFER
instruction.- Parameters:
buffer
- Render Buffermillis
- Duration to display, in milliseconds- Returns:
- Draw Shape Instruction
- Throws:
IllegalArgumentException
- If the buffer is null, or the duration is negative
-
playAudio
Creates aPLAY_AUDIO
instruction.- Parameters:
file
- Path to Audio File- Returns:
- Play Audio Instruction
-
playAudio
@NotNull public static @NotNull Instruction playAudio(@NotNull @NotNull InputStream file) throws IllegalArgumentException, IllegalStateException Creates aPLAY_AUDIO
instruction.- Parameters:
file
- Input Stream to Audio File- Returns:
- Play Audio Instruction
- Throws:
IllegalArgumentException
- If the file is nullIllegalStateException
- If the file cannot be read
-
logMessage
@NotNull public static @NotNull Instruction logMessage(@NotNull @NotNull String message) throws IllegalArgumentException Creates aLOG_MESSAGE
instruction.- Parameters:
message
- Message to Log- Returns:
- Log Message Instruction
- Throws:
IllegalArgumentException
- If the message is null or empty
-
drawTexture
@NotNull public static @NotNull Instruction drawTexture(int x, int y, int width, int height, @NotNull @NotNull Identifier texture, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_TEXTURE
instruction.- Parameters:
x
- X Coordinate for Texturey
- Y Coordinate for Texturewidth
- Width of Textureheight
- Height of Texturetexture
- Texture Identifierduration
- Time Duration- Returns:
- Draw Texture Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the texture is null
-
drawTexture
@NotNull public static @NotNull Instruction drawTexture(int x, int y, int width, int height, @NotNull @NotNull Identifier texture, long millis) throws IllegalArgumentException Creates aDRAW_TEXTURE
instruction.- Parameters:
x
- X Coordinate for Texturey
- Y Coordinate for Texturewidth
- Width of Textureheight
- Height of Texturetexture
- Texture Identifiermillis
- Duration to display, in milliseconds- Returns:
- Draw Texture Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the texture is null
-
drawTexture
@NotNull public static @NotNull Instruction drawTexture(int x, int y, int width, int height, @NotNull @NotNull Identifier texture, int startLeft, int startTop, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_TEXTURE
instruction.- Parameters:
x
- X Coordinate for Texturey
- Y Coordinate for Texturewidth
- Width of Textureheight
- Height of Texturetexture
- Texture IdentifierstartLeft
- The horizontal offset to start drawing from the left of the texturestartTop
- The vertical offset to start drawing from the top of the textureduration
- Time Duration- Returns:
- Draw Texture Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the texture is null
-
drawTexture
@NotNull public static @NotNull Instruction drawTexture(int x, int y, int width, int height, @NotNull @NotNull Identifier texture, int startLeft, int startTop, long millis) throws IllegalArgumentException Creates aDRAW_TEXTURE
instruction.- Parameters:
x
- X Coordinate for Texturey
- Y Coordinate for Texturewidth
- Width of Textureheight
- Height of Texturetexture
- Texture IdentifierstartLeft
- The horizontal offset to start drawing from the left of the texturestartTop
- The vertical offset to start drawing from the top of the texturemillis
- Duration to display, in milliseconds- Returns:
- Draw Texture Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the texture is null
-
drawTexture
@NotNull public static @NotNull Instruction drawTexture(int x, int y, int width, int height, @NotNull @NotNull Identifier texture, int startLeft, int startTop, int regionWidth, int regionHeight, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_TEXTURE
instruction.- Parameters:
x
- X Coordinate for Texturey
- Y Coordinate for Texturewidth
- Width of Textureheight
- Height of Texturetexture
- Texture IdentifierstartLeft
- The horizontal offset to start drawing from the left of the texturestartTop
- The vertical offset to start drawing from the top of the textureregionWidth
- Width of Region to DrawregionHeight
- Height of Region to Drawduration
- Time Duration- Returns:
- Draw Texture Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the texture is null
-
drawTexture
@NotNull public static @NotNull Instruction drawTexture(int x, int y, int width, int height, @NotNull @NotNull Identifier texture, int startLeft, int startTop, int regionWidth, int regionHeight, long millis) throws IllegalArgumentException Creates aDRAW_TEXTURE
instruction.- Parameters:
x
- X Coordinate for Texturey
- Y Coordinate for Texturewidth
- Width of Textureheight
- Height of Texturetexture
- Texture IdentifierstartLeft
- The horizontal offset to start drawing from the left of the texturestartTop
- The vertical offset to start drawing from the top of the textureregionWidth
- Width of Region to DrawregionHeight
- Height of Region to Drawmillis
- Duration to display, in milliseconds- Returns:
- Draw Texture Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the texture is null
-
openBookAndQuill
Creates aOPEN_BOOK_AND_QUILL
instruction.- Returns:
- Open Book and Quill Instruction
-
openScreen
Creates aOPEN_SCREEN
instruction.- Parameters:
screen
- Screen to Open- Returns:
- Open Screen Instruction
-
closeScreen
Creates aCLOSE_SCREEN
instruction.- Returns:
- Close Screen Instruction
-
renderer
@NotNull public static @NotNull Instruction renderer(@NotNull @NotNull RenderInstruction instruction) throws IllegalArgumentException Creates aRENDERER
instruction.- Parameters:
instruction
- Render Instruction to use- Returns:
- Renderer Instruction
- Throws:
IllegalArgumentException
- If the render instruction is null, or sub-ordinal is-1
-
drawBeaconBeam
@NotNull public static @NotNull Instruction drawBeaconBeam(int x, int y, int z, int height, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_BEACON_BEAM
instruction.- Parameters:
x
- X Coordinate for Beamy
- Y Coordinate for Beamz
- Z Coordinate for Beamheight
- Height of Beamduration
- Time Duration- Returns:
- Draw Beacon Beam Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative
-
drawBeaconBeam
@NotNull public static @NotNull Instruction drawBeaconBeam(int x, int y, int z, int height, long millis) throws IllegalArgumentException Creates aDRAW_BEACON_BEAM
instruction.- Parameters:
x
- X Coordinate for Beamy
- Y Coordinate for Beamz
- Z Coordinate for Beamheight
- Height of Beammillis
- Duration to display, in milliseconds- Returns:
- Draw Beacon Beam Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative
-
drawBeaconBeam
@NotNull public static @NotNull Instruction drawBeaconBeam(int x, int y, int z, int height, @NotNull @NotNull Color color, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_BEACON_BEAM
instruction.- Parameters:
x
- X Coordinate for Beamy
- Y Coordinate for Beamz
- Z Coordinate for Beamheight
- Height of Beamcolor
- Beam Color (default:0xF9FFFE
)duration
- Time Duration- Returns:
- Draw Beacon Beam Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative
-
drawBeaconBeam
@NotNull public static @NotNull Instruction drawBeaconBeam(int x, int y, int z, int height, @NotNull @NotNull Color color, long millis) throws IllegalArgumentException Creates aDRAW_BEACON_BEAM
instruction.- Parameters:
x
- X Coordinate for Beamy
- Y Coordinate for Beamz
- Z Coordinate for Beamheight
- Height of Beamcolor
- Beam Color (default:0xF9FFFE
)millis
- Duration to display, in milliseconds- Returns:
- Draw Beacon Beam Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the color is null
-
drawBeaconBeam
@NotNull public static @NotNull Instruction drawBeaconBeam(int x, int y, int z, int height, @NotNull @NotNull Color color, int yOffset, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_BEACON_BEAM
instruction.- Parameters:
x
- X Coordinate for Beamy
- Y Coordinate for Beamz
- Z Coordinate for Beamheight
- Height of Beamcolor
- Beam Color (default:0xF9FFFE
)yOffset
- Y Offset for Beamduration
- Time Duration- Returns:
- Draw Beacon Beam Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the color is null
-
drawBeaconBeam
@NotNull public static @NotNull Instruction drawBeaconBeam(int x, int y, int z, int height, @NotNull @NotNull Color color, int yOffset, long millis) throws IllegalArgumentException Creates aDRAW_BEACON_BEAM
instruction.- Parameters:
x
- X Coordinate for Beamy
- Y Coordinate for Beamz
- Z Coordinate for Beamheight
- Height of Beamcolor
- Beam Color (default:0xF9FFFE
)yOffset
- Y Offset for Beammillis
- Duration to display, in milliseconds- Returns:
- Draw Beacon Beam Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, or the color is null
-
drawBeaconBeam
@NotNull public static @NotNull Instruction drawBeaconBeam(int x, int y, int z, int height, @NotNull @NotNull Color color, int yOffset, float beamRadius, float glowRadius, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_BEACON_BEAM
instruction.- Parameters:
x
- X Coordinate for Beamy
- Y Coordinate for Beamz
- Z Coordinate for Beamheight
- Height of Beamcolor
- Beam Color (default:0xF9FFFE
)yOffset
- Y Offset for BeambeamRadius
- Beam Radius (default:0.2F
)glowRadius
- Glow Radius (default:0.25F
)duration
- Time Duration- Returns:
- Draw Beacon Beam Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the color is null, or the radii are negative
-
drawBeaconBeam
@NotNull public static @NotNull Instruction drawBeaconBeam(int x, int y, int z, int height, @NotNull @NotNull Color color, int yOffset, float beamRadius, float glowRadius, long millis) throws IllegalArgumentException Creates aDRAW_BEACON_BEAM
instruction.- Parameters:
x
- X Coordinate for Beamy
- Y Coordinate for Beamz
- Z Coordinate for Beamheight
- Height of Beamcolor
- Beam ColoryOffset
- Y Offset for BeambeamRadius
- Beam RadiusglowRadius
- Glow Radiusmillis
- Duration to display, in milliseconds- Returns:
- Draw Beacon Beam Instruction
- Throws:
IllegalArgumentException
- If the coordinates, dimensions, or duration are negative, the color is null, or the radii are negative
-
openLink
@NotNull public static @NotNull Instruction openLink(@NotNull @NotNull URI uri) throws IllegalArgumentException Creates aOPEN_LINK
instruction.- Parameters:
uri
- URI to Open- Returns:
- Open Link Instruction
- Throws:
IllegalArgumentException
- If the URL is null
-
mailto
@NotNull public static @NotNull Instruction mailto(@NotNull @NotNull String email) throws IllegalArgumentException Creates aMAILTO
instruction.- Parameters:
email
- Email Address- Returns:
- Mailto Instruction
- Throws:
IllegalArgumentException
- If the email is null, or not a valid email address- See Also:
-
mailto
@NotNull public static @NotNull Instruction mailto(@NotNull @NotNull URI mailto) throws IllegalArgumentException Creates aMAILTO
instruction.- Parameters:
mailto
- Mailto URI- Returns:
- Mailto Instruction
- Throws:
IllegalArgumentException
- If the URI is null or not amailto:
URI
-
drawContext
@NotNull public static @NotNull Instruction drawContext(@NotNull @NotNull DrawingContext context, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_CONTEXT
instruction.- Parameters:
context
- Drawing Context to Displayduration
- Time Duration- Returns:
- Draw Context Instruction
- Throws:
IllegalArgumentException
- If the context is null, or the duration is negative
-
drawContext
@NotNull public static @NotNull Instruction drawContext(@NotNull @NotNull DrawingContext context, long millis) throws IllegalArgumentException Creates aDRAW_CONTEXT
instruction.- Parameters:
context
- Drawing Context to Displaymillis
- Duration to display, in milliseconds- Returns:
- Draw Context Instruction
- Throws:
IllegalArgumentException
- If the context is null, or the duration is negative
-
narrate
@NotNull public static @NotNull Instruction narrate(@NotNull @NotNull String text) throws IllegalArgumentException Creates aNARRATE
instruction.- Parameters:
text
- Text to Narrate- Returns:
- Narrate Instruction
- Throws:
IllegalArgumentException
- If the text is null
-
narrate
@NotNull public static @NotNull Instruction narrate(@NotNull @NotNull String text, boolean interrupt) throws IllegalArgumentException Creates aNARRATE
instruction.- Parameters:
text
- Text to Narrateinterrupt
- Whether to interrupt any current speaking requests- Returns:
- Narrate Instruction
- Throws:
IllegalArgumentException
- If the text is null
-
displayToast
@NotNull public static @NotNull Instruction displayToast(@NotNull @NotNull Toast toast) throws IllegalArgumentException Creates aDISPLAY_TOAST
instruction.- Parameters:
toast
- Toast to Display- Returns:
- Display Toast Instruction
- Throws:
IllegalArgumentException
- If the toast is null
-
osBeep
Creates aOS_BEEP
instruction.- Returns:
- OS Beep Instruction
-
externalWindowPopup
@NotNull public static @NotNull Instruction externalWindowPopup(@NotNull @NotNull String title, @NotNull @NotNull String message) throws IllegalArgumentException Creates aEXTERNAL_WINDOW_POPUP
instruction.- Parameters:
title
- Window Titlemessage
- Window Message- Returns:
- External Window Popup Instruction
- Throws:
IllegalArgumentException
- If the title or message is null or empty
-
externalWindowPopup
@NotNull public static @NotNull Instruction externalWindowPopup(@NotNull @NotNull String title, @NotNull @NotNull String message, @NotNull @NotNull WindowIcon icon) throws IllegalArgumentException, UnsupportedOperationException Creates aEXTERNAL_WINDOW_POPUP
instruction.- Parameters:
title
- Window Titlemessage
- Window Messageicon
- Window Icon- Returns:
- External Window Popup Instruction
- Throws:
IllegalArgumentException
- If the title or message is null or empty, or the icon is nullUnsupportedOperationException
- If the icon isWindowIcon.QUESTION
-
externalWindowMessageBox
@NotNull public static @NotNull Instruction externalWindowMessageBox(@NotNull @NotNull String title, @NotNull @NotNull String message) throws IllegalArgumentException Creates aEXTERNAL_WINDOW_MESSAGE_BOX
instruction withWindowDialogue.OK
.- Parameters:
title
- Window Titlemessage
- Window Message- Returns:
- External Window Message Box Instruction
- Throws:
IllegalArgumentException
- If the title or message is null or empty
-
externalWindowMessageBox
@NotNull public static @NotNull Instruction externalWindowMessageBox(@NotNull @NotNull String title, @NotNull @NotNull String message, @NotNull @NotNull WindowDialogue dialogue) throws IllegalArgumentException Creates aEXTERNAL_WINDOW_MESSAGE_BOX
instruction.- Parameters:
title
- Window Titlemessage
- Window Messagedialogue
- Window Dialogue- Returns:
- External Window Message Box Instruction
- Throws:
IllegalArgumentException
- If the title or message is null or empty, or the dialogue is null
-
externalWindowMessageBox
@NotNull public static @NotNull Instruction externalWindowMessageBox(@NotNull @NotNull String title, @NotNull @NotNull String message, @NotNull @NotNull WindowDialogue dialogue, @NotNull @NotNull WindowIcon icon) throws IllegalArgumentException Creates aEXTERNAL_WINDOW_MESSAGE_BOX
instruction.- Parameters:
title
- Window Titlemessage
- Window Messagedialogue
- Window Dialogueicon
- Window Icon- Returns:
- External Window Message Box Instruction
- Throws:
IllegalArgumentException
- If the title or message is null or empty, the dialogue is null, or the icon is null
-
externalWindowMessageBox
@NotNull public static @NotNull Instruction externalWindowMessageBox(@NotNull @NotNull String title, @NotNull @NotNull String message, @NotNull @NotNull WindowDialogue dialogue, @NotNull @NotNull WindowIcon icon, boolean cancelDefault) throws IllegalArgumentException Creates aEXTERNAL_WINDOW_MESSAGE_BOX
instruction.- Parameters:
title
- Window Titlemessage
- Window Messagedialogue
- Window Dialogueicon
- Window IconcancelDefault
- Whether the cancel button is the default- Returns:
- External Window Message Box Instruction
- Throws:
IllegalArgumentException
- If the title or message is null or empty, the dialogue is null, or the icon is null
-
setWindowTitle
@NotNull public static @NotNull Instruction setWindowTitle(@NotNull @NotNull String title) throws IllegalArgumentException Creates aSET_WINDOW_TITLE
instruction.- Parameters:
title
- Window Title- Returns:
- Set Window Title Instruction
- Throws:
IllegalArgumentException
- If the title is null or empty
-
setOverlay
Creates aSET_OVERLAY
instruction.- Parameters:
overlay
- Overlay to Set, ornull
to clear the overlay- Returns:
- Set Overlay Instruction
-
drawItemStack
@NotNull public static @NotNull Instruction drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_ITEMSTACK
instruction.- Parameters:
item
- Item to Drawx
- X Coordinate for Itemy
- Y Coordinate for Itemduration
- Time Duration- Returns:
- Draw ItemStack Instruction
- Throws:
IllegalArgumentException
- If the item is null, or the coordinates are negative
-
drawItemStack
@NotNull public static @NotNull Instruction drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, long millis) throws IllegalArgumentException Creates aDRAW_ITEMSTACK
instruction.- Parameters:
item
- Item to Drawx
- X Coordinate for Itemy
- Y Coordinate for Itemmillis
- Duration to display, in milliseconds- Returns:
- Draw ItemStack Instruction
- Throws:
IllegalArgumentException
- If the item is null, or the coordinates are negative
-
drawItemStack
@NotNull public static @NotNull Instruction drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, int guiOffset, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_ITEMSTACK
instruction.- Parameters:
item
- Item to Drawx
- X Coordinate for Itemy
- Y Coordinate for ItemguiOffset
- GUI Offset on the z-axis for its 3D modelduration
- Time Duration- Returns:
- Draw ItemStack Instruction
- Throws:
IllegalArgumentException
- If the item is null, or the coordinates are negative
-
drawItemStack
@NotNull public static @NotNull Instruction drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, int guiOffset, long millis) throws IllegalArgumentException Creates aDRAW_ITEMSTACK
instruction.- Parameters:
item
- Item to Drawx
- X Coordinate for Itemy
- Y Coordinate for ItemguiOffset
- GUI Offset on the z-axis for its 3D modelmillis
- Duration to display, in milliseconds- Returns:
- Draw ItemStack Instruction
- Throws:
IllegalArgumentException
- If the item is null, or the coordinates are negative
-
drawItemStack
@NotNull public static @NotNull Instruction drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, int guiOffset, int randomSeed, @NotNull @NotNull Duration duration) throws IllegalArgumentException Creates aDRAW_ITEMSTACK
instruction.- Parameters:
item
- Item to Drawx
- X Coordinate for Itemy
- Y Coordinate for ItemguiOffset
- GUI Offset on the z-axis for its 3D modelrandomSeed
- Seed for Randomness in Renderingduration
- Time Duration- Returns:
- Draw ItemStack Instruction
- Throws:
IllegalArgumentException
- If the item is null, or the coordinates are negative
-
drawItemStack
@NotNull public static @NotNull Instruction drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, int guiOffset, int randomSeed, long millis) throws IllegalArgumentException Creates aDRAW_ITEMSTACK
instruction.- Parameters:
item
- Item to Drawx
- X Coordinate for Itemy
- Y Coordinate for ItemguiOffset
- GUI Offset on the z-axis for its 3D modelrandomSeed
- Seed for Randomness in Renderingmillis
- Duration to display, in milliseconds- Returns:
- Draw ItemStack Instruction
- Throws:
IllegalArgumentException
- If the item is null, or the coordinates are negative
-
setWindowIcon
Creates a
SET_WINDOW_ICON
instruction.- On Windows/Linux, a
.png
file must be loaded. The recommended size is16x16
. - On macOS, a
.icns
file must be loaded.
The library will not make an effort to validate the byte array.
- Parameters:
icon
- Icon to Set- Returns:
- Set Window Icon Instruction
- On Windows/Linux, a
-
showPlayers
Creates aSHOW_PLAYERS
instruction.- Parameters:
players
- Players to Show- Returns:
- Show Players Instruction
-
showPlayers
Creates aSHOW_PLAYERS
instruction.- Parameters:
players
- Players to Show- Returns:
- Show Players Instruction
-
hidePlayers
Creates aHIDE_PLAYERS
instruction.- Parameters:
players
- Players to Hide- Returns:
- Hide Players Instruction
-
hidePlayers
Creates aHIDE_PLAYERS
instruction.- Parameters:
players
- Players to Hide- Returns:
- Hide Players Instruction
-
toByteArray
public byte[] toByteArray()Serializes this Instruction to a byte array to be passed over the network.- Returns:
- Byte Array Representation
-
fromByteArray
Deserializes an Instruction from a byte array received over the network.- Parameters:
instruction
- Byte Array Representation- Returns:
- Deserialized Instruction
-