Class DatapackableRegistryInputType

java.lang.Object
com.pixelmonmod.pixelmon.api.ui.type.DatapackableRegistryInputType
All Implemented Interfaces:
InputType<net.minecraft.resources.ResourceLocation>

public class DatapackableRegistryInputType extends Object implements InputType<net.minecraft.resources.ResourceLocation>
This input type represents a single String input from the user
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<DatapackableRegistryInputType>
     
    protected net.minecraft.network.chat.Component
     
    protected net.minecraft.resources.ResourceLocation
     
    protected net.minecraft.resources.ResourceLocation
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    DatapackableRegistryInputType(net.minecraft.network.chat.Component label, net.minecraft.resources.ResourceLocation value, net.minecraft.resources.ResourceLocation registry)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.mojang.serialization.MapCodec<? 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(net.minecraft.resources.ResourceLocation value, net.minecraft.core.Registry<?> registry, net.minecraft.network.chat.Component label)
    Creates a new text input type
    of(net.minecraft.resources.ResourceLocation value, net.minecraft.resources.ResourceLocation registry, net.minecraft.network.chat.Component label)
    Creates a new text input type
    void
    setValue(net.minecraft.resources.ResourceLocation value)
    Sets the value of the input
     
    net.minecraft.resources.ResourceLocation
    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.MapCodec<DatapackableRegistryInputType> CODEC
    • label

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

      protected net.minecraft.resources.ResourceLocation value
    • registry

      protected net.minecraft.resources.ResourceLocation registry
  • Constructor Details

    • DatapackableRegistryInputType

      protected DatapackableRegistryInputType(net.minecraft.network.chat.Component label, net.minecraft.resources.ResourceLocation value, net.minecraft.resources.ResourceLocation registry)
  • Method Details

    • of

      public static DatapackableRegistryInputType of(net.minecraft.resources.ResourceLocation value, net.minecraft.core.Registry<?> registry, 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
    • of

      public static DatapackableRegistryInputType of(net.minecraft.resources.ResourceLocation value, net.minecraft.resources.ResourceLocation registry, 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.MapCodec<? 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<net.minecraft.resources.ResourceLocation>
      Returns:
      The codec
    • type

      public InputElementType<? extends InputType<?>> type()
      Specified by:
      type in interface InputType<net.minecraft.resources.ResourceLocation>
    • value

      public net.minecraft.resources.ResourceLocation value()
      Description copied from interface: InputType
      The current value of the input
      Specified by:
      value in interface InputType<net.minecraft.resources.ResourceLocation>
      Returns:
      The current value
    • setValue

      public void setValue(net.minecraft.resources.ResourceLocation value)
      Description copied from interface: InputType
      Sets the value of the input
      Specified by:
      setValue in interface InputType<net.minecraft.resources.ResourceLocation>
      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<net.minecraft.resources.ResourceLocation>
      Parameters:
      init -
      rearrangeTabs -
      Returns: