diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java index 0f4e1c9..191c609 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java @@ -11,6 +11,7 @@ import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormats; import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.text.LiteralText; import net.minecraft.text.Text; import net.minecraft.util.math.MathHelper; import org.lwjgl.glfw.GLFW; @@ -455,6 +456,11 @@ public class WTextField extends WWidget { return suggestion; } + public WTextField setSuggestion(@Nullable String suggestion) { + this.suggestion = suggestion != null ? new LiteralText(suggestion) : null; + return this; + } + public WTextField setSuggestion(@Nullable Text suggestion) { this.suggestion = suggestion; return this; |