Package com.petrolpark.core.wish
Class AbstractWishList
java.lang.Object
com.petrolpark.core.wish.AbstractWishList
- Direct Known Subclasses:
PlayerWishList
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddLootPoolWishedAndRandomItems(net.minecraft.world.level.storage.loot.LootPool pool, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> additionalFunctions, Collection<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>> wishes, boolean fulfillWishes, Consumer<net.minecraft.world.item.ItemStack> output, net.minecraft.world.level.storage.loot.LootContext context) booleanaddLootPoolWishedItem(net.minecraft.world.level.storage.loot.LootPool pool, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> additionalFunctions, IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, Consumer<net.minecraft.world.item.ItemStack> output, net.minecraft.world.level.storage.loot.LootContext context) booleanaddLootTableWishedAndRandomItemsRaw(net.minecraft.world.level.storage.loot.LootTable table, Consumer<net.minecraft.world.item.ItemStack> output, net.minecraft.world.level.storage.loot.LootContext context) booleanaddLootTableWishedAndRandomItemsRaw(net.minecraft.world.level.storage.loot.LootTable table, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> additionalFunctions, Collection<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>> wishes, boolean fulfillWishes, Consumer<net.minecraft.world.item.ItemStack> output, net.minecraft.world.level.storage.loot.LootContext context) net.minecraft.world.item.ItemStackforceFunctions(net.minecraft.world.item.ItemStack stack, IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> functions, net.minecraft.world.level.storage.loot.LootContext context) abstract voidfulfillWish(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, net.minecraft.world.item.ItemStack stack) intabstract Collection<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>> abstract intgetWishInstanceCount(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, int maxFulfillments)
-
Field Details
-
DEFAULT_ATTEMPTS
public static final int DEFAULT_ATTEMPTS- See Also:
-
-
Constructor Details
-
AbstractWishList
public AbstractWishList()
-
-
Method Details
-
getWishes
public abstract Collection<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>> getWishes() -
getWishInstanceCount
public abstract int getWishInstanceCount(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, int maxFulfillments) - Parameters:
wish- Should exist ingetWishes()maxFulfillments- Maximum number of instances of that Wish to fulfill- Returns:
- Actual number of instances of that Wish that can be fulfilled (i.e. how many instances of that Wish are on the WishList)
-
fulfillWish
public abstract void fulfillWish(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, net.minecraft.world.item.ItemStack stack) - Parameters:
wish- Should exist ingetWishes()stack-
-
getAttempts
public int getAttempts() -
addLootTableWishedAndRandomItemsRaw
public boolean addLootTableWishedAndRandomItemsRaw(net.minecraft.world.level.storage.loot.LootTable table, Consumer<net.minecraft.world.item.ItemStack> output, net.minecraft.world.level.storage.loot.LootContext context) -
addLootTableWishedAndRandomItemsRaw
public boolean addLootTableWishedAndRandomItemsRaw(net.minecraft.world.level.storage.loot.LootTable table, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> additionalFunctions, Collection<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>> wishes, boolean fulfillWishes, Consumer<net.minecraft.world.item.ItemStack> output, net.minecraft.world.level.storage.loot.LootContext context) - Parameters:
table-additionalFunctions-LootItemFunctions to run after the built-in LootItemFunctions of thisLootTablewishes- Subset of Wishes in this WishList to try and fulfillfulfillWishes- Whether to actually callfulfillWish(IAdvancedIngredient, ItemStack)output-context-- Returns:
- Whether any Wishes in the list came true
-
addLootPoolWishedAndRandomItems
public boolean addLootPoolWishedAndRandomItems(net.minecraft.world.level.storage.loot.LootPool pool, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> additionalFunctions, Collection<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>> wishes, boolean fulfillWishes, Consumer<net.minecraft.world.item.ItemStack> output, net.minecraft.world.level.storage.loot.LootContext context) - Parameters:
pool-additionalFunctions-LootItemFunctions to run after the built-in LootItemFunctions of thisLootPoolwishes- Subset of Wishes in this WishList to try and fulfillfulfillWishes- Whether to actually callfulfillWish(IAdvancedIngredient, ItemStack)output-context-- Returns:
- Whether any Wishes in the list came true
-
addLootPoolWishedItem
public boolean addLootPoolWishedItem(net.minecraft.world.level.storage.loot.LootPool pool, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> additionalFunctions, IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, Consumer<net.minecraft.world.item.ItemStack> output, net.minecraft.world.level.storage.loot.LootContext context) - Parameters:
pool-wish-output-context-- Returns:
- Whether the wish was succesfully fulfilled at least once
-
forceFunctions
public net.minecraft.world.item.ItemStack forceFunctions(net.minecraft.world.item.ItemStack stack, IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> functions, net.minecraft.world.level.storage.loot.LootContext context)
-