Class DataProviderInputType<T>

java.lang.Object
com.pixelmonmod.pixelmon.api.ui.type.DataProviderInputType<T>
All Implemented Interfaces:
InputType<DataProvider<T>>

public class DataProviderInputType<T> extends Object implements InputType<DataProvider<T>>
This input type represents DataProvider input from the user to be selected from a dropdown menu.
The DataProviders displayed in the dropdown menu are determined by the type given when creating the input type.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<DataProviderInputType<?>> CODEC
    • values

      protected List<net.minecraft.resources.ResourceLocation> values
    • label

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

      protected net.minecraft.resources.ResourceLocation currentValue
    • inputTypes

      protected List<InputType<?>> inputTypes
  • Constructor Details

    • DataProviderInputType

      protected DataProviderInputType(List<net.minecraft.resources.ResourceLocation> values, net.minecraft.network.chat.Component label, net.minecraft.resources.ResourceLocation currentValue, List<InputType<?>> inputTypes)
  • Method Details

    • of

      public static <T> DataProviderInputType<T> of(Class<T> dataProviderType, net.minecraft.network.chat.Component label, DataProvider<T> provider)
      Creates a new data provider input type for the given type
      Parameters:
      dataProviderType - The type of data provider to display
      label - The label to display
      provider - The current value
      Returns:
      The new data provider 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<T>
      Returns:
      The codec
    • value

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

      public void setValue(DataProvider<T> value)
      Description copied from interface: InputType
      Sets the value of the input
      Specified by:
      setValue in interface InputType<T>
      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<T>
      Returns: