From 6f8f85c5fd29021152ce6f8969e060fd6e3fbe83 Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Thu, 21 May 2020 00:17:06 +0300 Subject: Add back WTextField.setSuggestion(String) --- src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- cgit