Package net.minecraft.advancements
Record Class AdvancementRewards
java.lang.Object
java.lang.Record
net.minecraft.advancements.AdvancementRewards
public record AdvancementRewards(int experience, List<ResourceLocation> loot, List<ResourceLocation> recipes, Optional<CacheableFunction> function)
extends Record
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AdvancementRewards>
static final AdvancementRewards
private final int
The field for theexperience
record component.private final Optional<CacheableFunction>
The field for thefunction
record component.private final List<ResourceLocation>
The field for theloot
record component.private final List<ResourceLocation>
The field for therecipes
record component. -
Constructor Summary
ConstructorDescriptionAdvancementRewards
(int experience, List<ResourceLocation> loot, List<ResourceLocation> recipes, Optional<CacheableFunction> function) Creates an instance of aAdvancementRewards
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.int
Returns the value of theexperience
record component.function()
Returns the value of thefunction
record component.void
grant
(ServerPlayer p_9990_) final int
hashCode()
Returns a hash code value for this object.loot()
Returns the value of theloot
record component.recipes()
Returns the value of therecipes
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
experience
private final int experienceThe field for theexperience
record component. -
loot
The field for theloot
record component. -
recipes
The field for therecipes
record component. -
function
The field for thefunction
record component. -
CODEC
-
EMPTY
-
-
Constructor Details
-
AdvancementRewards
public AdvancementRewards(int experience, List<ResourceLocation> loot, List<ResourceLocation> recipes, Optional<CacheableFunction> function) Creates an instance of aAdvancementRewards
record class.- Parameters:
experience
- the value for theexperience
record componentloot
- the value for theloot
record componentrecipes
- the value for therecipes
record componentfunction
- the value for thefunction
record component
-
-
Method Details
-
grant
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
experience
public int experience()Returns the value of theexperience
record component.- Returns:
- the value of the
experience
record component
-
loot
Returns the value of theloot
record component.- Returns:
- the value of the
loot
record component
-
recipes
Returns the value of therecipes
record component.- Returns:
- the value of the
recipes
record component
-
function
Returns the value of thefunction
record component.- Returns:
- the value of the
function
record component
-