Class AbstractGiveItemsReward

java.lang.Object
petrolpark.mc.library.core.data.reward.AbstractGiveItemsReward
All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser, IAbstractReward<IReward.Type>, IReward
Direct Known Subclasses:
GiveItemReward, GiveLootReward

@ParametersAreNonnullByDefault public abstract class AbstractGiveItemsReward extends Object implements IReward
  • Nested Class Summary

    Nested classes/interfaces inherited from interface petrolpark.mc.library.core.data.reward.IReward

    IReward.Type
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final BiFunction<net.minecraft.world.item.ItemStack,net.minecraft.world.level.storage.loot.LootContext,net.minecraft.world.item.ItemStack>
     

    Fields inherited from interface petrolpark.mc.library.core.data.reward.IReward

    CODEC, DIRECT_CODEC, SET_CODEC, TYPED_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractGiveItemsReward(List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> functions)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<net.minecraft.world.level.storage.loot.parameters.LootContextParam<?>>
     
    final List<net.minecraft.world.level.storage.loot.functions.LootItemFunction>
     
    protected static <REWARD extends AbstractGiveItemsReward>
    com.mojang.datafixers.Products.P1<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<REWARD>,List<net.minecraft.world.level.storage.loot.functions.LootItemFunction>>
    lateItemFunctionsField(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<REWARD> instance)
     
    final boolean
    reward(net.minecraft.world.level.storage.loot.LootContext context, float multiplier, boolean simulate)
     
    abstract Stream<net.minecraft.world.item.ItemStack>
    streamStacks(net.minecraft.world.level.storage.loot.LootContext context)
     
    void
    validate(net.minecraft.world.level.storage.loot.ValidationContext context)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface petrolpark.mc.library.core.data.reward.IAbstractReward

    getType, info
  • Field Details

    • compositeFunction

      protected final BiFunction<net.minecraft.world.item.ItemStack,net.minecraft.world.level.storage.loot.LootContext,net.minecraft.world.item.ItemStack> compositeFunction
  • Constructor Details

    • AbstractGiveItemsReward

      public AbstractGiveItemsReward(List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> functions)
  • Method Details

    • lateItemFunctionsField

      protected static <REWARD extends AbstractGiveItemsReward> com.mojang.datafixers.Products.P1<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<REWARD>,List<net.minecraft.world.level.storage.loot.functions.LootItemFunction>> lateItemFunctionsField(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<REWARD> instance)
    • itemFunctions

      public final List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> itemFunctions()
    • streamStacks

      public abstract Stream<net.minecraft.world.item.ItemStack> streamStacks(net.minecraft.world.level.storage.loot.LootContext context)
    • reward

      public final boolean reward(net.minecraft.world.level.storage.loot.LootContext context, float multiplier, boolean simulate)
      Specified by:
      reward in interface IReward
    • getReferencedContextParams

      public Set<net.minecraft.world.level.storage.loot.parameters.LootContextParam<?>> getReferencedContextParams()
      Specified by:
      getReferencedContextParams in interface net.minecraft.world.level.storage.loot.LootContextUser
    • validate

      public void validate(net.minecraft.world.level.storage.loot.ValidationContext context)
      Specified by:
      validate in interface net.minecraft.world.level.storage.loot.LootContextUser