Class TextInputType

java.lang.Object
com.pixelmonmod.pixelmon.api.ui.type.TextInputType
All Implemented Interfaces:
InputType<String>

public class TextInputType extends Object implements InputType<String>
This input type represents a single String input from the user
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<TextInputType>
     
    protected net.minecraft.network.chat.Component
     
    protected String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    TextInputType(String value, net.minecraft.network.chat.Component label)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.mojang.serialization.Codec<? extends InputType<?>>
    The codec used for encoding and decoding the data when transferring between the client and server
    List<net.minecraft.client.gui.layouts.Layout>
    getWidget(Runnable init, Runnable rearrangeTabs)
     
    of(String value, net.minecraft.network.chat.Component label)
    Creates a new text input type
    void
    Sets the value of the input
    The current value of the input

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.pixelmonmod.pixelmon.api.ui.InputType

    getKey
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<TextInputType> CODEC
    • label

      protected net.minecraft.network.chat.Component label
    • value

      protected String value
  • Constructor Details

    • TextInputType

      protected TextInputType(String value, net.minecraft.network.chat.Component label)
  • Method Details

    • of

      public static TextInputType of(String value, net.minecraft.network.chat.Component label)
      Creates a new text input type
      Parameters:
      value - The current value
      label - The label to display
      Returns:
      The new text input type
    • codec

      public com.mojang.serialization.Codec<? extends InputType<?>> codec()
      Description copied from interface: InputType
      The codec used for encoding and decoding the data when transferring between the client and server
      Specified by:
      codec in interface InputType<String>
      Returns:
      The codec
    • value

      public String value()
      Description copied from interface: InputType
      The current value of the input
      Specified by:
      value in interface InputType<String>
      Returns:
      The current value
    • setValue

      public void setValue(String value)
      Description copied from interface: InputType
      Sets the value of the input
      Specified by:
      setValue in interface InputType<String>
      Parameters:
      value - The new value
    • getWidget

      public List<net.minecraft.client.gui.layouts.Layout> getWidget(Runnable init, Runnable rearrangeTabs)
      Specified by:
      getWidget in interface InputType<String>
      Returns: