java.lang.Object
net.darkhax.botanypots.common.impl.data.itemdrops.EntityDrops
All Implemented Interfaces:
ItemDropProvider

public class EntityDrops extends Object implements ItemDropProvider
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<EntityDrops>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,EntityDrops>
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntityDrops(net.minecraft.nbt.CompoundTag entityData, Optional<net.minecraft.core.Holder<net.minecraft.world.damagesource.DamageType>> damageType)
     
    EntityDrops(net.minecraft.nbt.CompoundTag entityData, Optional<net.minecraft.core.Holder<net.minecraft.world.damagesource.DamageType>> damageType, net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> tableId, List<net.minecraft.world.item.ItemStack> displayItems)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(BotanyPotContext context, net.minecraft.world.level.Level level, Consumer<net.minecraft.world.item.ItemStack> drops)
    Performs the outcome of the drop provider.
    Optional<net.minecraft.core.Holder<net.minecraft.world.damagesource.DamageType>>
     
    List<net.minecraft.world.item.ItemStack>
    Provides a list of items that can be produced by the provider.
    net.minecraft.nbt.CompoundTag
     
    Gets the type of the provider.

    Methods inherited from class java.lang.Object

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

    • TYPE

      public static final Supplier<ItemDropProviderType<?>> TYPE
    • CODEC

      public static final com.mojang.serialization.MapCodec<EntityDrops> CODEC
    • STREAM

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,EntityDrops> STREAM
  • Constructor Details

    • EntityDrops

      public EntityDrops(net.minecraft.nbt.CompoundTag entityData, Optional<net.minecraft.core.Holder<net.minecraft.world.damagesource.DamageType>> damageType)
    • EntityDrops

      public EntityDrops(net.minecraft.nbt.CompoundTag entityData, Optional<net.minecraft.core.Holder<net.minecraft.world.damagesource.DamageType>> damageType, net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> tableId, List<net.minecraft.world.item.ItemStack> displayItems)
  • Method Details

    • getEntityData

      public net.minecraft.nbt.CompoundTag getEntityData()
    • getDamageType

      public Optional<net.minecraft.core.Holder<net.minecraft.world.damagesource.DamageType>> getDamageType()
    • apply

      public void apply(BotanyPotContext context, net.minecraft.world.level.Level level, Consumer<net.minecraft.world.item.ItemStack> drops)
      Description copied from interface: ItemDropProvider
      Performs the outcome of the drop provider.
      Specified by:
      apply in interface ItemDropProvider
      Parameters:
      context - The context of the action.
      level - The current game level.
      drops - A consumer that adds produced items to the output.
    • getType

      public ItemDropProviderType<?> getType()
      Description copied from interface: ItemDropProvider
      Gets the type of the provider.
      Specified by:
      getType in interface ItemDropProvider
      Returns:
      The type of the provider.
    • getDisplayItems

      public List<net.minecraft.world.item.ItemStack> getDisplayItems()
      Description copied from interface: ItemDropProvider
      Provides a list of items that can be produced by the provider. These are used to display potential outcomes in recipe viewers like JEI.
      Specified by:
      getDisplayItems in interface ItemDropProvider
      Returns:
      A list of items to display. Can be empty, can not be null.