Interface ResourceConditionType<T extends ResourceCondition>
- Type Parameters:
T
- the type ofResourceCondition
public interface ResourceConditionType<T extends ResourceCondition>
A type of resource conditions.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<ResourceConditionType<?>> A codec used to serialize the condition type. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<T> codec()
static <T extends ResourceCondition>
ResourceConditionType<T> create
(Identifier id, com.mojang.serialization.MapCodec<T> codec) Creates a resource condition type.id()
-
Field Details
-
TYPE_CODEC
A codec used to serialize the condition type.
-
-
Method Details
-
id
Identifier id()- Returns:
- the condition's ID
-
codec
com.mojang.serialization.MapCodec<T> codec()- Returns:
- the condition's codec
-
create
static <T extends ResourceCondition> ResourceConditionType<T> create(Identifier id, com.mojang.serialization.MapCodec<T> codec) Creates a resource condition type. The returned value needs to be registered withResourceConditions.register(net.fabricmc.fabric.api.resource.conditions.v1.ResourceConditionType<?>)
.- Type Parameters:
T
- the type of the resource condition- Parameters:
id
- the ID of the conditioncodec
- the codec used to serialize the condition- Returns:
- the condition type to register
-