Package cz.jeme.advancium
Interface CustomAdvancementRewards.Builder
- Enclosing interface:
CustomAdvancementRewards
public static interface CustomAdvancementRewards.Builder
Builder for constructing instances of
CustomAdvancementRewards.-
Method Summary
Modifier and TypeMethodDescriptiondefault CustomAdvancementRewards.BuilderaddLootTable(String key) Adds a loot table reward using aStringkey.default CustomAdvancementRewards.BuilderaddLootTable(org.bukkit.loot.LootTable lootTable) Adds a loot table reward using aLootTableobject.addLootTable(org.bukkit.NamespacedKey key) Adds a loot table reward to the advancement.default CustomAdvancementRewards.BuilderAdds a recipe reward using aStringkey.addRecipe(org.bukkit.NamespacedKey key) Adds a recipe reward to the advancement.default <R extends org.bukkit.inventory.Recipe & org.bukkit.Keyed>
CustomAdvancementRewards.BuilderaddRecipe(R recipe) Adds a recipe reward to the advancement using aRecipeobject.build()Builds and returns the configuredCustomAdvancementRewards.experience(int experience) Sets the amount of experience granted upon completion of the advancement.
-
Method Details
-
experience
Sets the amount of experience granted upon completion of the advancement.- Parameters:
experience- the amount of experience points- Returns:
- this builder instance for chaining
-
addRecipe
Adds a recipe reward to the advancement.- Parameters:
key- theNamespacedKeyof the recipe- Returns:
- this builder instance for chaining
-
addRecipe
default <R extends org.bukkit.inventory.Recipe & org.bukkit.Keyed> CustomAdvancementRewards.Builder addRecipe(@NotNull R recipe) Adds a recipe reward to the advancement using aRecipeobject.- Type Parameters:
R- the type of the recipe, which implementsRecipeandKeyed- Parameters:
recipe- the recipe to add as a reward- Returns:
- this builder instance for chaining
-
addRecipe
Adds a recipe reward using aStringkey.The string is converted into a
NamespacedKey. If the key is invalid, an exception is thrown.- Parameters:
key- the string representation of the recipe key- Returns:
- this builder instance for chaining
- Throws:
NullPointerException- if the key is invalid
-
addLootTable
Adds a loot table reward to the advancement.- Parameters:
key- theNamespacedKeyof the loot table- Returns:
- this builder instance for chaining
-
addLootTable
Adds a loot table reward using aLootTableobject.- Parameters:
lootTable- the loot table to add as a reward- Returns:
- this builder instance for chaining
-
addLootTable
Adds a loot table reward using aStringkey.The string is converted into a
NamespacedKey. If the key is invalid, an exception is thrown.- Parameters:
key- the string representation of the loot table key- Returns:
- this builder instance for chaining
- Throws:
NullPointerException- if the key is invalid
-
build
CustomAdvancementRewards build()Builds and returns the configuredCustomAdvancementRewards.- Returns:
- the built rewards object
-