Record Class GrantAdvancementPlayerReward
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.data.reward.entity.GrantAdvancementPlayerReward
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser,IEntityReward,IPlayerReward,IAbstractReward<IEntityReward.Type>
@ParametersAreNonnullByDefault
public record GrantAdvancementPlayerReward(net.minecraft.resources.ResourceLocation advancementId, String criterion)
extends Record
implements IPlayerReward
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface petrolpark.mc.library.core.data.reward.entity.IEntityReward
IEntityReward.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<GrantAdvancementPlayerReward> Fields inherited from interface petrolpark.mc.library.core.data.reward.entity.IEntityReward
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionGrantAdvancementPlayerReward(net.minecraft.resources.ResourceLocation advancementId, String criterion) Creates an instance of aGrantAdvancementPlayerRewardrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocationReturns the value of theadvancementIdrecord component.Returns the value of thecriterionrecord component.final booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.info()booleanrewardPlayer(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.level.storage.loot.LootContext context, float multiplier, boolean simulate) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface petrolpark.mc.library.core.data.reward.entity.IPlayerReward
rewardMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
GrantAdvancementPlayerReward
public GrantAdvancementPlayerReward(net.minecraft.resources.ResourceLocation advancementId, String criterion) Creates an instance of aGrantAdvancementPlayerRewardrecord class.- Parameters:
advancementId- the value for theadvancementIdrecord componentcriterion- the value for thecriterionrecord component
-
-
Method Details
-
rewardPlayer
public boolean rewardPlayer(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.level.storage.loot.LootContext context, float multiplier, boolean simulate) - Specified by:
rewardPlayerin interfaceIPlayerReward
-
info
- Specified by:
infoin interfaceIAbstractReward<IEntityReward.Type>
-
getType
- Specified by:
getTypein interfaceIAbstractReward<IEntityReward.Type>
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
advancementId
public net.minecraft.resources.ResourceLocation advancementId()Returns the value of theadvancementIdrecord component.- Returns:
- the value of the
advancementIdrecord component
-
criterion
Returns the value of thecriterionrecord component.- Returns:
- the value of the
criterionrecord component
-