Interface Tillage

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Tillage
What a hoe does to a block type: what the block turns into, whether it needs room above, and what falls out of it.

Only tilled() has to be given, so that a lambda is enough:

farming.tillable(PEAT, () -> farmland, plugin);
Since:
0.1.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<ItemStack>
    Works out what falls out of the block when it is tilled, such as the roots of rooted dirt.
    default boolean
    Returns true if the block can only be tilled with air right above it.
    Returns the state the tilled block turns into.
  • Method Details

    • tilled

      BlockData tilled()
      Returns the state the tilled block turns into.
      Returns:
      the state the tilled block turns into
      Since:
      0.1.0
    • needsRoom

      default boolean needsRoom()
      Returns true if the block can only be tilled with air right above it.
      Returns:
      true if the block can only be tilled with air right above it
      Since:
      0.1.0
    • drops

      default List<ItemStack> drops(RandomGenerator random)
      Works out what falls out of the block when it is tilled, such as the roots of rooted dirt.
      Parameters:
      random - the source of randomness to roll the drops with
      Returns:
      the stacks to drop from the clicked face, empty for nothing
      Since:
      0.1.0