Record Class GrantExperiencePlayerReward
java.lang.Object
java.lang.Record
com.petrolpark.core.data.reward.entity.GrantExperiencePlayerReward
- All Implemented Interfaces:
IEntityReward,IPlayerReward,ITypedReward<EntityRewardType>,net.minecraft.world.level.storage.loot.LootContextUser
public record GrantExperiencePlayerReward(net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount)
extends Record
implements IPlayerReward
Give a Player some XP.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<GrantExperiencePlayerReward> Fields inherited from interface com.petrolpark.core.data.reward.entity.IEntityReward
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionGrantExperiencePlayerReward(net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount) Creates an instance of aGrantExperiencePlayerRewardrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidnet.minecraft.world.level.storage.loot.providers.number.NumberProvideramount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.voidrender(net.minecraft.client.gui.GuiGraphics graphics) voidrewardPlayer(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.storage.loot.LootContext context, float multiplier) 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 com.petrolpark.core.data.reward.entity.IPlayerReward
rewardMethods inherited from interface com.petrolpark.core.data.reward.ITypedReward
translate, translateSimpleMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
GrantExperiencePlayerReward
public GrantExperiencePlayerReward(net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount) Creates an instance of aGrantExperiencePlayerRewardrecord class.- Parameters:
amount- the value for theamountrecord component
-
-
Method Details
-
rewardPlayer
public void rewardPlayer(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.storage.loot.LootContext context, float multiplier) - Specified by:
rewardPlayerin interfaceIPlayerReward
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics) - Specified by:
renderin interfaceITypedReward<EntityRewardType>
-
addToDescription
- Specified by:
addToDescriptionin interfaceITypedReward<EntityRewardType>
-
getType
- Specified by:
getTypein interfaceITypedReward<EntityRewardType>
-
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). -
amount
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-