Package com.petrolpark.core.wish
Class PlayerWishList
java.lang.Object
com.petrolpark.core.wish.AbstractWishList
com.petrolpark.core.wish.PlayerWishList
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Map<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>, Integer>> protected final net.minecraft.world.entity.player.Playerstatic final net.neoforged.neoforge.attachment.IAttachmentSerializer<net.minecraft.nbt.Tag, PlayerWishList> protected final it.unimi.dsi.fastutil.objects.Object2IntMap<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>> Fields inherited from class com.petrolpark.core.wish.AbstractWishList
DEFAULT_ATTEMPTS -
Constructor Summary
ConstructorsConstructorDescriptionPlayerWishList(PlayerWishList oldList, net.neoforged.neoforge.attachment.IAttachmentHolder attachmentHolder, net.minecraft.core.HolderLookup.Provider registries) PlayerWishList(net.neoforged.neoforge.attachment.IAttachmentHolder attachmentHolder) PlayerWishList(net.neoforged.neoforge.attachment.IAttachmentHolder attachmentHolder, Map<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>, Integer> wishes) -
Method Summary
Modifier and TypeMethodDescriptionvoidfulfillWish(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, net.minecraft.world.item.ItemStack stack) Collection<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>> intgetWishInstanceCount(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, int maxFulfillments) Methods inherited from class com.petrolpark.core.wish.AbstractWishList
addLootPoolWishedAndRandomItems, addLootPoolWishedItem, addLootTableWishedAndRandomItemsRaw, addLootTableWishedAndRandomItemsRaw, forceFunctions, getAttempts
-
Field Details
-
CODEC
public static final com.mojang.serialization.Codec<Map<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>,Integer>> CODEC -
SERIALIZER
public static final net.neoforged.neoforge.attachment.IAttachmentSerializer<net.minecraft.nbt.Tag,PlayerWishList> SERIALIZER -
player
protected final net.minecraft.world.entity.player.Player player -
wishes
protected final it.unimi.dsi.fastutil.objects.Object2IntMap<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>> wishes
-
-
Constructor Details
-
PlayerWishList
public PlayerWishList(net.neoforged.neoforge.attachment.IAttachmentHolder attachmentHolder) -
PlayerWishList
public PlayerWishList(PlayerWishList oldList, net.neoforged.neoforge.attachment.IAttachmentHolder attachmentHolder, net.minecraft.core.HolderLookup.Provider registries) -
PlayerWishList
public PlayerWishList(net.neoforged.neoforge.attachment.IAttachmentHolder attachmentHolder, Map<IAdvancedIngredient<? super net.minecraft.world.item.ItemStack>, Integer> wishes)
-
-
Method Details
-
getWishes
- Specified by:
getWishesin classAbstractWishList
-
getWishInstanceCount
public int getWishInstanceCount(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, int maxFulfillments) - Specified by:
getWishInstanceCountin classAbstractWishList- Parameters:
wish- Should exist inAbstractWishList.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 void fulfillWish(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> wish, net.minecraft.world.item.ItemStack stack) - Specified by:
fulfillWishin classAbstractWishList- Parameters:
wish- Should exist inAbstractWishList.getWishes()stack-
-