Class DrawingContext.Command
java.lang.Object
xyz.gmitch215.socketmc.util.render.DrawingContext.Command
- All Implemented Interfaces:
Serializable
,Paramaterized
- Enclosing class:
DrawingContext
public static final class DrawingContext.Command
extends Object
implements Serializable, Paramaterized
Represents a command in a DrawingContext.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull DrawingContext.Command
blit
(@NotNull Identifier texture, int x, int y) Draws a texture at the specified coordinates, using the vanilla 16x16 texture parameters.static @NotNull DrawingContext.Command
blit
(@NotNull Identifier texture, int x, int y, float xOffset, float yOffset, int width, int height) Draws a texture at the specified coordinates.static @NotNull DrawingContext.Command
blit
(@NotNull Identifier texture, int x, int y, float xOffset, float yOffset, int width, int height, int textureWidth, int textureHeight) Draws a texture at the specified coordinates.static @NotNull DrawingContext.Command
blit
(@NotNull Identifier texture, int x, int y, float xOffset, float yOffset, int width, int height, int textureWidth, int textureHeight, @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a texture at the specified coordinates.static @NotNull DrawingContext.Command
blit
(@NotNull Identifier texture, int x, int y, int width, int height) Draws a texture at the specified coordinates.static @NotNull DrawingContext.Command
blitSprite
(@NotNull Identifier sprite, int x, int y, int width, int height) Draws a sprite at the specified coordinates.static @NotNull DrawingContext.Command
blitSprite
(@NotNull Identifier sprite, int x, int y, int width, int height, int z) Draws a sprite at the specified coordinates.static @NotNull DrawingContext.Command
blitSprite
(@NotNull Identifier sprite, int x, int y, int width, int height, int z, @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a sprite at the specified coordinates.static @NotNull DrawingContext.Command
Disables scissoring.static @NotNull DrawingContext.Command
drawCenteredString
(int x, int y, @NotNull Text text) Draws a centered string.static @NotNull DrawingContext.Command
drawCenteredString
(int x, int y, @NotNull Text text, @NotNull Color color) Draws a centered string.static @NotNull DrawingContext.Command
drawCenteredString
(int x, int y, @NotNull Text text, @NotNull Color color, @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a centered string.static @NotNull DrawingContext.Command
drawItemStack
(@NotNull NBTTag item, int x, int y) Draws an item stack at the specified coordinates.static @NotNull DrawingContext.Command
drawItemStack
(@NotNull NBTTag item, int x, int y, int guiOffset) Draws an item stack at the specified coordinates.static @NotNull DrawingContext.Command
drawItemStack
(@NotNull NBTTag item, int x, int y, int guiOffset, float scale) Draws an item stack at the specified coordinates.static @NotNull DrawingContext.Command
drawItemStack
(@NotNull NBTTag item, int x, int y, int guiOffset, float scale, @NotNull ItemDisplayType displayType) Draws an item stack at the specified coordinates.static @NotNull DrawingContext.Command
drawItemStack
(@NotNull NBTTag item, int x, int y, int guiOffset, float scale, @NotNull ItemDisplayType displayType, int combinedLight) Draws an item stack at the specified coordinates.static @NotNull DrawingContext.Command
drawItemStack
(@NotNull NBTTag item, int x, int y, int guiOffset, float scale, @NotNull ItemDisplayType displayType, int combinedLight, int combinedOverlay) Draws an item stack at the specified coordinates.static @NotNull DrawingContext.Command
drawString
(int x, int y, @NotNull Text text) Draws a string.static @NotNull DrawingContext.Command
drawString
(int x, int y, @NotNull Text text, @NotNull Color color) Draws a string.static DrawingContext.Command
drawString
(int x, int y, @NotNull Text text, @NotNull Color color, boolean dropShadow) Draws a string.static DrawingContext.Command
drawString
(int x, int y, @NotNull Text text, @NotNull Color color, boolean dropShadow, @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a string.static @NotNull DrawingContext.Command
drawTooltip
(int x, int y, @NotNull List<Text> text) Draws a tooltip at the specified coordinates.static @NotNull DrawingContext.Command
drawTooltip
(int x, int y, @NotNull List<Text> text, @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a tooltip at the specified coordinates.static @NotNull DrawingContext.Command
drawWordWrap
(int x, int y, int width, @NotNull Text text) Draws a word-wrapped string.static @NotNull DrawingContext.Command
drawWordWrap
(int x, int y, int width, @NotNull Text text, @NotNull Color color) Draws a word-wrapped string.static @NotNull DrawingContext.Command
drawWordWrap
(int x, int y, int width, @NotNull Text text, @NotNull Color color, @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a word-wrapped string.static @NotNull DrawingContext.Command
enableScissor
(int minX, int minY, int maxX, int maxY) Enables scissoring over the specified area.static @NotNull DrawingContext.Command
enableScissor
(int minX, int minY, int maxX, int maxY, @Nullable Collection<DrawingContext.Modifier> modifiers) Enables scissoring over the specified area.boolean
static @NotNull DrawingContext.Command
fill
(int minX, int minY, int maxX, int maxY) Fills a rectangle with the specified color.static @NotNull DrawingContext.Command
Fills a rectangle with the specified color.static @NotNull DrawingContext.Command
Fills a rectangle with the specified color.static @NotNull DrawingContext.Command
fill
(@NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY) Fills a rectangle with the specified color.static @NotNull DrawingContext.Command
fill
(@NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, int z, @NotNull Color color) Fills a rectangle with the specified color.static @NotNull DrawingContext.Command
fill
(@NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, int z, @NotNull Color color, @Nullable Collection<DrawingContext.Modifier> modifiers) Fills a rectangle with the specified color.static @NotNull DrawingContext.Command
fill
(@NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, @NotNull Color color) Fills a rectangle with the specified color.static @NotNull DrawingContext.Command
fillGradient
(int minX, int minY, int maxX, int maxY, int z, @NotNull Color from, @NotNull Color to) Fills a rectangle with a gradient.static @NotNull DrawingContext.Command
fillGradient
(int minX, int minY, int maxX, int maxY, @NotNull Color from, @NotNull Color to) Fills a rectangle with a gradient.static @NotNull DrawingContext.Command
fillGradient
(@NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, int z, @NotNull Color from, @NotNull Color to) Fills a rectangle with a gradient.static @NotNull DrawingContext.Command
fillGradient
(@NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, int z, @NotNull Color from, @NotNull Color to, @Nullable Collection<DrawingContext.Modifier> modifiers) Fills a rectangle with a gradient.static @NotNull DrawingContext.Command
fillGradient
(@NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, @NotNull Color from, @NotNull Color to) Fills a rectangle with a gradient.int
getId()
Gets the internal identifier for the command.Gets an immutable copy of the modifiers applied to the command.Gets an immutable copy of the parameters.getType()
Gets the type of drawing command to use.int
hashCode()
static @NotNull DrawingContext.Command
hLine
(int minX, int maxX, int y) Draws a horizontal line.static @NotNull DrawingContext.Command
Draws a horizontal line.static @NotNull DrawingContext.Command
hLine
(@NotNull DrawingContext.Type type, int minX, int maxX, int y, @NotNull Color color) Draws a horizontal line.static @NotNull DrawingContext.Command
hLine
(@NotNull DrawingContext.Type type, int minX, int maxX, int y, @NotNull Color color, @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a horizontal line.static @NotNull DrawingContext.Command
outline
(int minX, int minY, int maxX, int maxY) Draws a rectangular outline.static @NotNull DrawingContext.Command
Draws a rectangular outline.static @NotNull DrawingContext.Command
outline
(int minX, int minY, int maxX, int maxY, @NotNull Color color, @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a rectangular outline.toString()
static @NotNull DrawingContext.Command
vLine
(int x, int minY, int maxY) Draws a vertical line.static @NotNull DrawingContext.Command
Draws a vertical line.static @NotNull DrawingContext.Command
vLine
(@NotNull DrawingContext.Type type, int x, int minY, int maxY, @NotNull Color color) Draws a vertical line.static @NotNull DrawingContext.Command
vLine
(@NotNull DrawingContext.Type type, int x, int minY, int maxY, @NotNull Color color, @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a vertical line.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
-
Method Details
-
hLine
@NotNull public static @NotNull DrawingContext.Command hLine(int minX, int maxX, int y) throws IllegalArgumentException Draws a horizontal line.- Parameters:
minX
- the minimum x-coordinatemaxX
- the maximum x-coordinatey
- the y-coordinate- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
hLine
@NotNull public static @NotNull DrawingContext.Command hLine(int minX, int maxX, int y, @NotNull @NotNull Color color) throws IllegalArgumentException Draws a horizontal line.- Parameters:
minX
- the minimum x-coordinatemaxX
- the maximum x-coordinatey
- the y-coordinatecolor
- the color of the line- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
hLine
@NotNull public static @NotNull DrawingContext.Command hLine(@NotNull @NotNull DrawingContext.Type type, int minX, int maxX, int y, @NotNull @NotNull Color color) throws IllegalArgumentException Draws a horizontal line.- Parameters:
type
- the type of drawing command to useminX
- the minimum x-coordinatemaxX
- the maximum x-coordinatey
- the y-coordinatecolor
- the color of the line- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
hLine
@NotNull public static @NotNull DrawingContext.Command hLine(@NotNull @NotNull DrawingContext.Type type, int minX, int maxX, int y, @NotNull @NotNull Color color, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) throws IllegalArgumentException Draws a horizontal line.- Parameters:
type
- the type of drawing command to useminX
- the minimum x-coordinatemaxX
- the maximum x-coordinatey
- the y-coordinatecolor
- the color of the linemodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
vLine
@NotNull public static @NotNull DrawingContext.Command vLine(int x, int minY, int maxY) throws IllegalArgumentException Draws a vertical line.- Parameters:
x
- the x-coordinateminY
- the minimum y-coordinatemaxY
- the maximum y-coordinate- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
vLine
@NotNull public static @NotNull DrawingContext.Command vLine(int x, int minY, int maxY, @NotNull @NotNull Color color) throws IllegalArgumentException Draws a vertical line.- Parameters:
x
- the x-coordinateminY
- the minimum y-coordinatemaxY
- the maximum y-coordinatecolor
- the color of the line- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
vLine
@NotNull public static @NotNull DrawingContext.Command vLine(@NotNull @NotNull DrawingContext.Type type, int x, int minY, int maxY, @NotNull @NotNull Color color) throws IllegalArgumentException Draws a vertical line.- Parameters:
type
- the type of drawing command to usex
- the x-coordinateminY
- the minimum y-coordinatemaxY
- the maximum y-coordinatecolor
- the color of the line- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
vLine
@NotNull public static @NotNull DrawingContext.Command vLine(@NotNull @NotNull DrawingContext.Type type, int x, int minY, int maxY, @NotNull @NotNull Color color, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) throws IllegalArgumentException Draws a vertical line.- Parameters:
type
- the type of drawing command to usex
- the x-coordinateminY
- the minimum y-coordinatemaxY
- the maximum y-coordinatecolor
- the color of the linemodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
enableScissor
@NotNull public static @NotNull DrawingContext.Command enableScissor(int minX, int minY, int maxX, int maxY) throws IllegalArgumentException Enables scissoring over the specified area.- Parameters:
minX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinate- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if coordinates are invalid- See Also:
-
enableScissor
@NotNull public static @NotNull DrawingContext.Command enableScissor(int minX, int minY, int maxX, int maxY, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) throws IllegalArgumentException Enables scissoring over the specified area.- Parameters:
minX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatemodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if coordinates are invalid- See Also:
-
disableScissor
Disables scissoring.- Returns:
- A DrawingContext Command
-
fill
@NotNull public static @NotNull DrawingContext.Command fill(int minX, int minY, int maxX, int maxY) throws IllegalArgumentException Fills a rectangle with the specified color.- Parameters:
minX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinate- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the coordinates are invalid
-
fill
@NotNull public static @NotNull DrawingContext.Command fill(@NotNull @NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY) throws IllegalArgumentException Fills a rectangle with the specified color.- Parameters:
type
- the type of drawing command to useminX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinate- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null or coordinates are invalid
-
fill
@NotNull public static @NotNull DrawingContext.Command fill(int minX, int minY, int maxX, int maxY, @NotNull @NotNull Color color) throws IllegalArgumentException Fills a rectangle with the specified color.- Parameters:
minX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatecolor
- the color of the rectangle- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the coordinates are invalid or color is null
-
fill
@NotNull public static @NotNull DrawingContext.Command fill(@NotNull @NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, @NotNull @NotNull Color color) throws IllegalArgumentException Fills a rectangle with the specified color.- Parameters:
type
- the type of drawing command to useminX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatecolor
- the color of the rectangle- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
fill
@NotNull public static @NotNull DrawingContext.Command fill(int minX, int minY, int maxX, int maxY, int z, @NotNull @NotNull Color color) throws IllegalArgumentException Fills a rectangle with the specified color.- Parameters:
minX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatez
- the z-index of the rectanglecolor
- the color of the rectangle- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the coordinates are invalid or color is null
-
fill
@NotNull public static @NotNull DrawingContext.Command fill(@NotNull @NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, int z, @NotNull @NotNull Color color) throws IllegalArgumentException Fills a rectangle with the specified color.- Parameters:
type
- the type of drawing command to useminX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatez
- the z-index of the rectanglecolor
- the color of the rectangle- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
fill
@NotNull public static @NotNull DrawingContext.Command fill(@NotNull @NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, int z, @NotNull @NotNull Color color, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) throws IllegalArgumentException Fills a rectangle with the specified color.- Parameters:
type
- the type of drawing command to useminX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatez
- the z-index of the rectanglecolor
- the color of the rectanglemodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or color is null
-
fillGradient
@NotNull public static @NotNull DrawingContext.Command fillGradient(int minX, int minY, int maxX, int maxY, @NotNull @NotNull Color from, @NotNull @NotNull Color to) throws IllegalArgumentException Fills a rectangle with a gradient.- Parameters:
minX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatefrom
- the starting color of the gradientto
- the ending color of the gradient- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the coordinates are invalid or colors are null
-
fillGradient
@NotNull public static @NotNull DrawingContext.Command fillGradient(@NotNull @NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, @NotNull @NotNull Color from, @NotNull @NotNull Color to) throws IllegalArgumentException Fills a rectangle with a gradient.- Parameters:
type
- the type of drawing command to useminX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatefrom
- the starting color of the gradientto
- the ending color of the gradient- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or colors are null
-
fillGradient
@NotNull public static @NotNull DrawingContext.Command fillGradient(int minX, int minY, int maxX, int maxY, int z, @NotNull @NotNull Color from, @NotNull @NotNull Color to) throws IllegalArgumentException Fills a rectangle with a gradient.- Parameters:
minX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatez
- the z-index of the rectanglefrom
- the starting color of the gradientto
- the ending color of the gradient- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the coordinates are invalid or colors are null
-
fillGradient
@NotNull public static @NotNull DrawingContext.Command fillGradient(@NotNull @NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, int z, @NotNull @NotNull Color from, @NotNull @NotNull Color to) throws IllegalArgumentException Fills a rectangle with a gradient.- Parameters:
type
- the type of drawing command to useminX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatez
- the z-index of the rectanglefrom
- the starting color of the gradientto
- the ending color of the gradient- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or colors are null
-
fillGradient
@NotNull public static @NotNull DrawingContext.Command fillGradient(@NotNull @NotNull DrawingContext.Type type, int minX, int minY, int maxX, int maxY, int z, @NotNull @NotNull Color from, @NotNull @NotNull Color to, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) throws IllegalArgumentException Fills a rectangle with a gradient.- Parameters:
type
- the type of drawing command to useminX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatez
- the z-index of the rectanglefrom
- the starting color of the gradientto
- the ending color of the gradientmodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the type is null, coordinates are invalid, or colors are null
-
drawCenteredString
@NotNull public static @NotNull DrawingContext.Command drawCenteredString(int x, int y, @NotNull @NotNull Text text) throws IllegalArgumentException Draws a centered string.- Parameters:
x
- the x-coordinatey
- the y-coordinatetext
- the text to draw- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text is null, or coordinates are invalid
-
drawCenteredString
@NotNull public static @NotNull DrawingContext.Command drawCenteredString(int x, int y, @NotNull @NotNull Text text, @NotNull @NotNull Color color) throws IllegalArgumentException Draws a centered string.- Parameters:
x
- the x-coordinatey
- the y-coordinatetext
- the text to drawcolor
- the color of the text- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text or color are null, or coordinates are invalid
-
drawCenteredString
@NotNull public static @NotNull DrawingContext.Command drawCenteredString(int x, int y, @NotNull @NotNull Text text, @NotNull @NotNull Color color, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) throws IllegalArgumentException Draws a centered string.- Parameters:
x
- the x-coordinatey
- the y-coordinatetext
- the text to drawcolor
- the color of the textmodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text or color are null, or coordinates are invalid
-
drawString
@NotNull public static @NotNull DrawingContext.Command drawString(int x, int y, @NotNull @NotNull Text text) throws IllegalArgumentException Draws a string.- Parameters:
x
- the x-coordinatey
- the y-coordinatetext
- the text to draw- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text or color are null, or coordinates are invalid
-
drawString
@NotNull public static @NotNull DrawingContext.Command drawString(int x, int y, @NotNull @NotNull Text text, @NotNull @NotNull Color color) throws IllegalArgumentException Draws a string.- Parameters:
x
- the x-coordinatey
- the y-coordinatetext
- the text to drawcolor
- the color of the text- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text or color are null, or coordinates are invalid
-
drawString
public static DrawingContext.Command drawString(int x, int y, @NotNull @NotNull Text text, @NotNull @NotNull Color color, boolean dropShadow) throws IllegalArgumentException Draws a string.- Parameters:
x
- the x-coordinatey
- the y-coordinatetext
- the text to drawcolor
- the color of the textdropShadow
- whether to draw a drop shadow- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text or color are null, or coordinates are invalid
-
drawString
public static DrawingContext.Command drawString(int x, int y, @NotNull @NotNull Text text, @NotNull @NotNull Color color, boolean dropShadow, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) throws IllegalArgumentException Draws a string.- Parameters:
x
- the x-coordinatey
- the y-coordinatetext
- the text to drawcolor
- the color of the textdropShadow
- whether to draw a drop shadowmodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text or color are null, or coordinates are invalid
-
drawWordWrap
@NotNull public static @NotNull DrawingContext.Command drawWordWrap(int x, int y, int width, @NotNull @NotNull Text text) throws IllegalArgumentException Draws a word-wrapped string.- Parameters:
x
- the x-coordinatey
- the y-coordinatewidth
- the width of each linetext
- the text to draw- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text is null, or coordinates/width are invalid
-
drawWordWrap
@NotNull public static @NotNull DrawingContext.Command drawWordWrap(int x, int y, int width, @NotNull @NotNull Text text, @NotNull @NotNull Color color) throws IllegalArgumentException Draws a word-wrapped string.- Parameters:
x
- the x-coordinatey
- the y-coordinatewidth
- the width of each linetext
- the text to drawcolor
- the color of the text- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text or color are null, or coordinates/width are invalid
-
drawWordWrap
@NotNull public static @NotNull DrawingContext.Command drawWordWrap(int x, int y, int width, @NotNull @NotNull Text text, @NotNull @NotNull Color color, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) throws IllegalArgumentException Draws a word-wrapped string.- Parameters:
x
- the x-coordinatey
- the y-coordinatewidth
- the width of each linetext
- the text to drawcolor
- the color of the textmodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text or color are null, or coordinates/width are invalid
-
outline
@NotNull public static @NotNull DrawingContext.Command outline(int minX, int minY, int maxX, int maxY) throws IllegalArgumentException Draws a rectangular outline.- Parameters:
minX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinate- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the coordinates are invalid
-
outline
@NotNull public static @NotNull DrawingContext.Command outline(int minX, int minY, int maxX, int maxY, @NotNull @NotNull Color color) throws IllegalArgumentException Draws a rectangular outline.- Parameters:
minX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatecolor
- the color of the outline- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the coordinates are invalid or color is null
-
outline
@NotNull public static @NotNull DrawingContext.Command outline(int minX, int minY, int maxX, int maxY, @NotNull @NotNull Color color, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) throws IllegalArgumentException Draws a rectangular outline.- Parameters:
minX
- the minimum x-coordinateminY
- the minimum y-coordinatemaxX
- the maximum x-coordinatemaxY
- the maximum y-coordinatecolor
- the color of the outlinemodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the coordinates are invalid or color is null
-
blit
@NotNull public static @NotNull DrawingContext.Command blit(@NotNull @NotNull Identifier texture, int x, int y) Draws a texture at the specified coordinates, using the vanilla 16x16 texture parameters.- Parameters:
texture
- the identifier to the texture to drawx
- the x-coordinatey
- the y-coordinate- Returns:
- A DrawingContext Command
-
blit
@NotNull public static @NotNull DrawingContext.Command blit(@NotNull @NotNull Identifier texture, int x, int y, int width, int height) Draws a texture at the specified coordinates.- Parameters:
texture
- the identifier to the texture to drawx
- the x-coordinatey
- the y-coordinatewidth
- the width of the blitted areaheight
- the height of the blitted area- Returns:
- A DrawingContext Command
-
blit
@NotNull public static @NotNull DrawingContext.Command blit(@NotNull @NotNull Identifier texture, int x, int y, float xOffset, float yOffset, int width, int height) Draws a texture at the specified coordinates.- Parameters:
texture
- the identifier to the texture to drawx
- the x-coordinatey
- the y-coordinatexOffset
- the offset of the starting x-coordinate to blityOffset
- the offset of the starting y-coordinate to blitwidth
- the width of the blitted areaheight
- the height of the blitted area- Returns:
- A DrawingContext Command
-
blit
@NotNull public static @NotNull DrawingContext.Command blit(@NotNull @NotNull Identifier texture, int x, int y, float xOffset, float yOffset, int width, int height, int textureWidth, int textureHeight) Draws a texture at the specified coordinates.- Parameters:
texture
- the identifier to the texture to drawx
- the x-coordinatey
- the y-coordinatexOffset
- the offset of the starting x-coordinate to blityOffset
- the offset of the starting y-coordinate to blitwidth
- the width of the blitted areaheight
- the height of the blitted areatextureWidth
- the width of the texture file (usually 256)textureHeight
- the height of the texture file (usually 256)- Returns:
- A DrawingContext Command
- See Also:
-
blit
@NotNull public static @NotNull DrawingContext.Command blit(@NotNull @NotNull Identifier texture, int x, int y, float xOffset, float yOffset, int width, int height, int textureWidth, int textureHeight, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a texture at the specified coordinates.- Parameters:
texture
- the identifier to the texture to drawx
- the x-coordinatey
- the y-coordinatexOffset
- the offset of the starting x-coordinate to blityOffset
- the offset of the starting y-coordinate to blitwidth
- the width of the blitted areaheight
- the height of the blitted areatextureWidth
- the width of the texture file (usually 256)textureHeight
- the height of the texture file (usually 256)modifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- See Also:
-
blitSprite
@NotNull public static @NotNull DrawingContext.Command blitSprite(@NotNull @NotNull Identifier sprite, int x, int y, int width, int height) throws IllegalArgumentException Draws a sprite at the specified coordinates.- Parameters:
sprite
- the identifier to the sprite to drawx
- the x-coordinatey
- the y-coordinatewidth
- the width of the blitted areaheight
- the height of the blitted area- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the sprite is null, coordinates are invalid, or width/height are negative- See Also:
-
blitSprite
@NotNull public static @NotNull DrawingContext.Command blitSprite(@NotNull @NotNull Identifier sprite, int x, int y, int width, int height, int z) throws IllegalArgumentException Draws a sprite at the specified coordinates.- Parameters:
sprite
- the identifier to the sprite to drawx
- the x-coordinatey
- the y-coordinatewidth
- the width of the blitted areaheight
- the height of the blitted areaz
- the z-index of the sprite- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the sprite is null, coordinates are invalid, or width/height are negative- See Also:
-
blitSprite
@NotNull public static @NotNull DrawingContext.Command blitSprite(@NotNull @NotNull Identifier sprite, int x, int y, int width, int height, int z, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) throws IllegalArgumentException Draws a sprite at the specified coordinates.- Parameters:
sprite
- the identifier to the sprite to drawx
- the x-coordinatey
- the y-coordinatewidth
- the width of the blitted areaheight
- the height of the blitted areaz
- the z-index of the spritemodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the sprite is null, coordinates are invalid, or width/height are negative- See Also:
-
drawTooltip
@NotNull public static @NotNull DrawingContext.Command drawTooltip(int x, int y, @NotNull @NotNull List<Text> text) throws IllegalArgumentException Draws a tooltip at the specified coordinates.- Parameters:
x
- the x-coordinatey
- the y-coordinatetext
- the text to draw- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text is null or coordinates are invalid
-
drawTooltip
@NotNull public static @NotNull DrawingContext.Command drawTooltip(int x, int y, @NotNull @NotNull List<Text> text, @Nullable @Nullable Collection<DrawingContext.Modifier> modifiers) Draws a tooltip at the specified coordinates.- Parameters:
x
- the x-coordinatey
- the y-coordinatetext
- the text to drawmodifiers
- the modifiers to apply to the command- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the text is null or coordinates are invalid
-
drawItemStack
@NotNull public static @NotNull DrawingContext.Command drawItemStack(@NotNull @NotNull NBTTag item, int x, int y) throws IllegalArgumentException Draws an item stack at the specified coordinates.- Parameters:
item
- the item to drawx
- the x-coordinatey
- the y-coordinate- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the item is null or coordinates are invalid
-
drawItemStack
@NotNull public static @NotNull DrawingContext.Command drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, int guiOffset) throws IllegalArgumentException Draws an item stack at the specified coordinates.- Parameters:
item
- the item to drawx
- the x-coordinatey
- the y-coordinateguiOffset
- the offset of the GUI- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the item is null or coordinates are invalid
-
drawItemStack
@NotNull public static @NotNull DrawingContext.Command drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, int guiOffset, float scale) throws IllegalArgumentException Draws an item stack at the specified coordinates.- Parameters:
item
- the item to drawx
- the x-coordinatey
- the y-coordinateguiOffset
- the offset of the GUIscale
- the scale of the item texture (default is 16)- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the item is null, coordinates are invalid, or scale is negative
-
drawItemStack
@NotNull public static @NotNull DrawingContext.Command drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, int guiOffset, float scale, @NotNull @NotNull ItemDisplayType displayType) throws IllegalArgumentException Draws an item stack at the specified coordinates.- Parameters:
item
- the item to drawx
- the x-coordinatey
- the y-coordinateguiOffset
- the offset of the GUIscale
- the scale of the item texture (default is 16)displayType
- the rendering context type for the item- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the item is null, coordinates are invalid, scale is negative, or display type is null
-
drawItemStack
@NotNull public static @NotNull DrawingContext.Command drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, int guiOffset, float scale, @NotNull @NotNull ItemDisplayType displayType, int combinedLight) throws IllegalArgumentException Draws an item stack at the specified coordinates.- Parameters:
item
- the item to drawx
- the x-coordinatey
- the y-coordinateguiOffset
- the offset of the GUIscale
- the scale of the item texture (default is 16)displayType
- the rendering context type for the itemcombinedLight
- the combined light color (default is 0xF000F0)- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the item is null, coordinates are invalid, scale is negative, display type is null, or light is negative
-
drawItemStack
@NotNull public static @NotNull DrawingContext.Command drawItemStack(@NotNull @NotNull NBTTag item, int x, int y, int guiOffset, float scale, @NotNull @NotNull ItemDisplayType displayType, int combinedLight, int combinedOverlay) throws IllegalArgumentException Draws an item stack at the specified coordinates.- Parameters:
item
- the item to drawx
- the x-coordinatey
- the y-coordinateguiOffset
- the offset of the GUIscale
- the scale of the item texture (default is 16)displayType
- the rendering context type for the itemcombinedLight
- the combined light color (default is 0xF000F0)combinedOverlay
- the combined overlay color (default is 655360)- Returns:
- A DrawingContext Command
- Throws:
IllegalArgumentException
- if the item is null, coordinates are invalid, scale is negative, display type is null, or light/overlay are negative
-
getId
public int getId()Gets the internal identifier for the command.- Returns:
- Command ID
-
getType
Gets the type of drawing command to use.- Returns:
- DrawingContext Type
-
getModifiers
Gets an immutable copy of the modifiers applied to the command.- Returns:
- Command Modifiers
-
getParameters
Description copied from interface:Paramaterized
Gets an immutable copy of the parameters.- Specified by:
getParameters
in interfaceParamaterized
- Returns:
- Object Parameters
-
equals
-
hashCode
public int hashCode() -
toString
-