Record Class SimpleDropProvider

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

public record SimpleDropProvider(List<SimpleDropProvider.SimpleDrop> drops) extends Record implements ItemDropProvider
  • Field Details

  • Constructor Details

    • SimpleDropProvider

      public SimpleDropProvider(List<SimpleDropProvider.SimpleDrop> drops)
      Creates an instance of a SimpleDropProvider record class.
      Parameters:
      drops - the value for the drops record component
  • Method Details

    • 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.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • drops

      Returns the value of the drops record component.
      Returns:
      the value of the drops record component