Package com.pixelmonmod.pixelmon.api.ui
Interface InputType<T>
- All Known Implementing Classes:
BooleanInputType
,DataProviderInputType
,ExpandableListInputType
,ItemStackInputType
,NumberInputType
,RegistryInputType
,TextInputType
public interface InputType<T>
Represents data that can be inputted by the user
Note: This class is required on the client and the server
Note: This class is required on the client and the server
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbool
(boolean currentValue, net.minecraft.network.chat.Component label) Creates a new boolean input type with the given valuecom.mojang.serialization.Codec<? extends InputType<?>>
codec()
The codec used for encoding and decoding the data when transferring between the client and serverdefault net.minecraft.resources.ResourceLocation
getKey()
Gets the registry key for this input typeList<net.minecraft.client.gui.layouts.Layout>
static InputType<net.minecraft.world.item.ItemStack>
itemStack
(net.minecraft.world.item.ItemStack currentValue, net.minecraft.network.chat.Component label) Creates a newItemStack
input type with the given valueCreates a new number input type with the given valuestatic InputType<net.minecraft.resources.ResourceLocation>
registry
(net.minecraft.resources.ResourceLocation currentValue, net.minecraft.resources.ResourceLocation registry, net.minecraft.network.chat.Component label) Creates a new registry input type with the given valuestatic InputType<net.minecraft.resources.ResourceLocation>
registry
(net.minecraft.resources.ResourceLocation currentValue, net.minecraftforge.registries.IForgeRegistry<?> registry, net.minecraft.network.chat.Component label) Creates a new registry input type with the given valuevoid
Sets the value of the inputCreates a new text input type with the given valuevalue()
The current value of the input
-
Field Details
-
CODEC
-
-
Method Details
-
codec
com.mojang.serialization.Codec<? extends InputType<?>> codec()The codec used for encoding and decoding the data when transferring between the client and server- Returns:
- The codec
-
getKey
default net.minecraft.resources.ResourceLocation getKey()Gets the registry key for this input type- Returns:
- The registry key
-
value
T value()The current value of the input- Returns:
- The current value
-
setValue
Sets the value of the input- Parameters:
value
- The new value
-
getWidget
- Parameters:
init
-rearrangeTabs
-- Returns:
-
text
Creates a new text input type with the given value- Parameters:
currentValue
- The current value- Returns:
- The new text input type
-
number
Creates a new number input type with the given value- Parameters:
currentValue
- The current value- Returns:
- The new text input type
-
bool
Creates a new boolean input type with the given value- Parameters:
currentValue
- The current value- Returns:
- The new text input type
-
itemStack
static InputType<net.minecraft.world.item.ItemStack> itemStack(net.minecraft.world.item.ItemStack currentValue, net.minecraft.network.chat.Component label) Creates a newItemStack
input type with the given value- Parameters:
currentValue
- The current value- Returns:
- The new text input type
-
registry
static InputType<net.minecraft.resources.ResourceLocation> registry(net.minecraft.resources.ResourceLocation currentValue, net.minecraftforge.registries.IForgeRegistry<?> registry, net.minecraft.network.chat.Component label) Creates a new registry input type with the given value- Parameters:
currentValue
- The current valueregistry
- The registry to uselabel
- The label to display- Returns:
- The new text input type
-
registry
static InputType<net.minecraft.resources.ResourceLocation> registry(net.minecraft.resources.ResourceLocation currentValue, net.minecraft.resources.ResourceLocation registry, net.minecraft.network.chat.Component label) Creates a new registry input type with the given value- Parameters:
currentValue
- The current valueregistry
- The registry to uselabel
- The label to display- Returns:
- The new text input type
-