Record Class AdvancementRewards
java.lang.Object
java.lang.Record
net.minecraft.advancements.AdvancementRewards
public record AdvancementRewards(int experience, List<ResourceKey<LootTable>> loot, List<ResourceKey<Recipe<?>>> recipes, Optional<CacheableFunction> function)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AdvancementRewards> static final AdvancementRewardsprivate final intThe field for theexperiencerecord component.private final Optional<CacheableFunction> The field for thefunctionrecord component.private final List<ResourceKey<LootTable>> The field for thelootrecord component.private final List<ResourceKey<Recipe<?>>> The field for therecipesrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAdvancementRewards(int experience, List<ResourceKey<LootTable>> loot, List<ResourceKey<Recipe<?>>> recipes, Optional<CacheableFunction> function) Creates an instance of aAdvancementRewardsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of theexperiencerecord component.function()Returns the value of thefunctionrecord component.voidgrant(ServerPlayer player) final inthashCode()Returns a hash code value for this object.loot()Returns the value of thelootrecord component.List<ResourceKey<Recipe<?>>> recipes()Returns the value of therecipesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
experience
private final int experienceThe field for theexperiencerecord component. -
loot
The field for thelootrecord component. -
recipes
The field for therecipesrecord component. -
function
The field for thefunctionrecord component. -
CODEC
-
EMPTY
-
-
Constructor Details
-
AdvancementRewards
public AdvancementRewards(int experience, List<ResourceKey<LootTable>> loot, List<ResourceKey<Recipe<?>>> recipes, Optional<CacheableFunction> function) Creates an instance of aAdvancementRewardsrecord class.- Parameters:
experience- the value for theexperiencerecord componentloot- the value for thelootrecord componentrecipes- the value for therecipesrecord componentfunction- the value for thefunctionrecord component
-
-
Method Details
-
grant
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
experience
public int experience()Returns the value of theexperiencerecord component.- Returns:
- the value of the
experiencerecord component
-
loot
Returns the value of thelootrecord component.- Returns:
- the value of the
lootrecord component
-
recipes
Returns the value of therecipesrecord component.- Returns:
- the value of the
recipesrecord component
-
function
Returns the value of thefunctionrecord component.- Returns:
- the value of the
functionrecord component
-