java.lang.Object
net.darkhax.botanypots.common.impl.data.itemdrops.LootTableDrops
All Implemented Interfaces:
ItemDropProvider
Direct Known Subclasses:
BlockDrops

public class LootTableDrops extends Object implements ItemDropProvider
  • Field Details

    • TYPE

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

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

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

    • LootTableDrops

      public LootTableDrops(net.minecraft.resources.ResourceLocation tableId)
    • LootTableDrops

      public LootTableDrops(net.minecraft.resources.ResourceLocation tableId, List<net.minecraft.world.item.ItemStack> displayItems)
  • Method Details

    • getTableId

      public net.minecraft.resources.ResourceLocation getTableId()
    • getLootParams

      protected net.minecraft.world.level.storage.loot.LootParams getLootParams(BotanyPotContext context)
    • 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.
    • fallbackDrops

      public void fallbackDrops(BotanyPotContext context, net.minecraft.world.level.Level level, Consumer<net.minecraft.world.item.ItemStack> drops)
    • hasTableDrops

      public boolean hasTableDrops(net.minecraft.world.level.Level level)
    • 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 final 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.