Class AbstractWishList

java.lang.Object
com.petrolpark.core.wish.AbstractWishList
Direct Known Subclasses:
PlayerWishList

@Experimental public abstract class AbstractWishList extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
     
    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)
     
    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)
     
    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)
     
    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)
     
    abstract void
    fulfillWish(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, net.minecraft.world.item.ItemStack stack)
     
    int
     
    abstract Collection<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>>
     
    abstract int
    getWishInstanceCount(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, int maxFulfillments)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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 in getWishes()
      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 in getWishes()
      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 this LootTable
      wishes - Subset of Wishes in this WishList to try and fulfill
      fulfillWishes - Whether to actually call fulfillWish(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 this LootPool
      wishes - Subset of Wishes in this WishList to try and fulfill
      fulfillWishes - Whether to actually call fulfillWish(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)