Class LootTableDrops
java.lang.Object
net.darkhax.botanypots.common.impl.data.itemdrops.LootTableDrops
- All Implemented Interfaces:
ItemDropProvider
- Direct Known Subclasses:
BlockDrops
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<LootTableDrops> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, LootTableDrops> static final Supplier<ItemDropProviderType<?>> -
Constructor Summary
ConstructorsConstructorDescriptionLootTableDrops(net.minecraft.resources.ResourceLocation tableId) LootTableDrops(net.minecraft.resources.ResourceLocation tableId, List<net.minecraft.world.item.ItemStack> displayItems) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(BotanyPotContext context, net.minecraft.world.level.Level level, Consumer<net.minecraft.world.item.ItemStack> drops) Performs the outcome of the drop provider.final List<net.minecraft.world.item.ItemStack> Provides a list of items that can be produced by the provider.protected net.minecraft.world.level.storage.loot.LootParamsgetLootParams(BotanyPotContext context) net.minecraft.resources.ResourceLocationgetType()Gets the type of the provider.
-
Field Details
-
TYPE
-
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
-
apply
public void apply(BotanyPotContext context, net.minecraft.world.level.Level level, Consumer<net.minecraft.world.item.ItemStack> drops) Description copied from interface:ItemDropProviderPerforms the outcome of the drop provider.- Specified by:
applyin interfaceItemDropProvider- Parameters:
context- The context of the action.level- The current game level.drops- A consumer that adds produced items to the output.
-
getType
Description copied from interface:ItemDropProviderGets the type of the provider.- Specified by:
getTypein interfaceItemDropProvider- Returns:
- The type of the provider.
-
getDisplayItems
Description copied from interface:ItemDropProviderProvides 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:
getDisplayItemsin interfaceItemDropProvider- Returns:
- A list of items to display. Can be empty, can not be null.
-