Class ItemReward
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.reward.ItemReward
- All Implemented Interfaces:
AdvancementReward
An advancement reward that directly grants a specific
ItemStack to the player.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<ItemReward> The codec used for serializing and deserializing the item reward.static final RewardType<ItemReward> The registered type definition for the item reward. -
Constructor Summary
ConstructorsConstructorDescriptionItemReward(org.bukkit.inventory.ItemStack item) Constructs a new ItemReward. -
Method Summary
Modifier and TypeMethodDescriptionRewardType<?> getType()Retrieves the reward type definition associated with this instance.voidgrant(org.bukkit.entity.Player player) Adds the item to the player's inventory, dropping any remainder on the ground.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the item reward. -
TYPE
The registered type definition for the item reward.
-
-
Constructor Details
-
ItemReward
public ItemReward(org.bukkit.inventory.ItemStack item) Constructs a new ItemReward.- Parameters:
item- The stack to distribute.
-
-
Method Details
-
getType
Description copied from interface:AdvancementRewardRetrieves the reward type definition associated with this instance. This is used to identify the logic and handle polymorphic serialization.- Specified by:
getTypein interfaceAdvancementReward- Returns:
- The
RewardTypecharacterizing this specific reward.
-
grant
public void grant(org.bukkit.entity.Player player) Adds the item to the player's inventory, dropping any remainder on the ground.- Specified by:
grantin interfaceAdvancementReward- Parameters:
player- The player receiving the reward.
-