Class RecipeConditions

java.lang.Object
me.mehboss.utils.RecipeConditions

public final class RecipeConditions extends Object
Represents all optional conditions that may be required for a recipe to be considered valid before crafting/smelting/brewing/etc.

This container focuses on external world/state conditions such as time-of-day, biome, weather, world allow/deny lists, and more.

Each category of conditions is grouped into sub-objects. If a category contains no values, that category is ignored.

  • Method Details

    • getMoonPhase

      public static int getMoonPhase(org.bukkit.World world)
      Calculates the current moon phase for the given world.

      Minecraft cycles the moon every 8 in-game days. This method determines the phase by taking the world's total time and converting it into a day index, then modulo 8.

      Moon phases (0–7):

      • 0 – Full Moon
      • 1 – Waning Gibbous
      • 2 – Last Quarter
      • 3 – Waning Crescent
      • 4 – New Moon
      • 5 – Waxing Crescent
      • 6 – First Quarter
      • 7 – Waxing Gibbous
      Parameters:
      world - the world to read time information from
      Returns:
      an integer 0–7 representing the current moon phase
    • parseConditionSet

      public static RecipeConditions.ConditionSet parseConditionSet(org.bukkit.configuration.ConfigurationSection root)
      Parse an entire condition set from the per-recipe section.
    • parseBlock

      public static RecipeConditions.Block parseBlock(org.bukkit.configuration.ConfigurationSection s)
      Parse a single AND block (world/world_deny/biome/biome_deny/time/weather/advancement/moon_phase).