Class PlantingSettings
java.lang.Object
ke.ric.gardening.data.PlantingSettings
Configuration for how and where a crop can be planted.
-
Constructor Summary
ConstructorsConstructorDescriptionPlantingSettings(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 TypeMethodDescriptionbooleanCheck 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).booleanCheck whether this crop has an explicit ceiling support allow-list.booleanCheck whether this crop has an explicit wall support allow-list.booleanCheck if a permission is required to plant this crop.static booleanisFenceLikeSupport(org.bukkit.Material material) Fence-like blocks are valid support for vine crops even though they are not full occluding wall blocks.booleanisValidCeilingBlock(org.bukkit.Material material) Check if the given material is valid support above a hanging crop.booleanisValidGroundBlock(org.bukkit.Material material) Check if the given material is a valid ground block for planting.booleanisValidWallBlock(org.bukkit.Material material) Check if the given material is a valid wall block for planting.booleanAlias for hasPermission() for API compatibility.booleanCheck if the crop requires water above it (for aquatic crops like rice).booleanAlias for consumesItem() for API compatibility.
-
Constructor Details
-
PlantingSettings
-
PlantingSettings
-
-
Method Details
-
getValidBlocks
Get valid ground blocks for planting (for ground-based crops). -
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
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
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.
-