Class PlantingSettings

java.lang.Object
ke.ric.gardening.data.PlantingSettings

public class PlantingSettings extends Object
Configuration for how and where a crop can be planted.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlantingSettings(Set<org.bukkit.Material> validBlocks, Set<org.bukkit.Material> validWallBlocks, boolean requiresWaterAbove, boolean consumeItem, String permission)
     
    PlantingSettings(Set<org.bukkit.Material> validBlocks, Set<org.bukkit.Material> validWallBlocks, Set<org.bukkit.Material> validCeilingBlocks, boolean requiresWaterAbove, boolean consumeItem, String permission)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Check if planting consumes the item.
    Get the optional permission required to plant this crop.
    Set<org.bukkit.Material>
    Get valid ground blocks for planting (for ground-based crops).
    Set<org.bukkit.Material>
    Get valid ceiling blocks for hanging crops.
    Set<org.bukkit.Material>
    Get valid wall blocks for planting (for vine/wall-mounted crops).
    boolean
    Check whether this crop has an explicit ceiling support allow-list.
    boolean
    Check whether this crop has an explicit wall support allow-list.
    boolean
    Check if a permission is required to plant this crop.
    static boolean
    isFenceLikeSupport(org.bukkit.Material material)
    Fence-like blocks are valid support for vine crops even though they are not full occluding wall blocks.
    boolean
    isValidCeilingBlock(org.bukkit.Material material)
    Check if the given material is valid support above a hanging crop.
    boolean
    isValidGroundBlock(org.bukkit.Material material)
    Check if the given material is a valid ground block for planting.
    boolean
    isValidWallBlock(org.bukkit.Material material)
    Check if the given material is a valid wall block for planting.
    boolean
    Alias for hasPermission() for API compatibility.
    boolean
    Check if the crop requires water above it (for aquatic crops like rice).
    boolean
    Alias for consumesItem() for API compatibility.

    Methods inherited from class Object

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

    • PlantingSettings

      public PlantingSettings(Set<org.bukkit.Material> validBlocks, Set<org.bukkit.Material> validWallBlocks, boolean requiresWaterAbove, boolean consumeItem, String permission)
    • PlantingSettings

      public PlantingSettings(Set<org.bukkit.Material> validBlocks, Set<org.bukkit.Material> validWallBlocks, Set<org.bukkit.Material> validCeilingBlocks, boolean requiresWaterAbove, boolean consumeItem, String permission)
  • Method Details

    • getValidBlocks

      public Set<org.bukkit.Material> getValidBlocks()
      Get valid ground blocks for planting (for ground-based crops).
    • getValidWallBlocks

      public Set<org.bukkit.Material> getValidWallBlocks()
      Get valid wall blocks for planting (for vine/wall-mounted crops).
    • hasConfiguredWallBlocks

      public boolean hasConfiguredWallBlocks()
      Check whether this crop has an explicit wall support allow-list.
    • getValidCeilingBlocks

      public Set<org.bukkit.Material> getValidCeilingBlocks()
      Get valid ceiling blocks for hanging crops.
    • hasConfiguredCeilingBlocks

      public boolean hasConfiguredCeilingBlocks()
      Check whether this crop has an explicit ceiling support allow-list.
    • requiresWaterAbove

      public boolean requiresWaterAbove()
      Check if the crop requires water above it (for aquatic crops like rice).
    • consumesItem

      public boolean consumesItem()
      Check if planting consumes the item.
    • getPermission

      public String getPermission()
      Get the optional permission required to plant this crop.
      Returns:
      The permission string, or null if no permission is required
    • hasPermission

      public boolean hasPermission()
      Check if a permission is required to plant this crop.
    • requiresPermission

      public boolean requiresPermission()
      Alias for hasPermission() for API compatibility.
    • shouldConsumeItem

      public boolean shouldConsumeItem()
      Alias for consumesItem() for API compatibility.
    • isValidGroundBlock

      public boolean isValidGroundBlock(org.bukkit.Material material)
      Check if the given material is a valid ground block for planting.
    • isValidWallBlock

      public boolean isValidWallBlock(org.bukkit.Material material)
      Check if the given material is a valid wall block for planting.
    • isValidCeilingBlock

      public boolean isValidCeilingBlock(org.bukkit.Material material)
      Check if the given material is valid support above a hanging crop. An empty configuration safely falls back to a solid, occluding block.
    • isFenceLikeSupport

      public static boolean isFenceLikeSupport(org.bukkit.Material material)
      Fence-like blocks are valid support for vine crops even though they are not full occluding wall blocks.