java.lang.Object
johnsmith.enchantingoverhauled.menu.scribe.controller.ScribeRules

public class ScribeRules extends Object
Encapsulates the pure domain logic, mathematics, and rule validations for the Scribe Mini-game. Strictly separates game evaluation from the side-effecting mutations found in ScribeAction.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Dynamically calculates the required lapis and XP to process the enchantment binding.
    static void
    calculateDifficulty(net.minecraft.world.item.ItemStack book, ScribeGridData gridData)
    Dynamically calculates the required mine density based on the target book's existing enchantments.
    evaluateState(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack sourceStack, ScribeGridData gridData)
    Evaluates the current state of the source item and the target book on the lectern to determine if a game is permitted to start, or if constraints (max enchantments) are violated.
    static boolean
    isProcessedAtStart(net.minecraft.world.item.ItemStack source)
    Validates whether a source item should be prematurely processed at the start of a Scribe game.
    static void
    processSourceInPlace(net.minecraft.world.level.Level level, net.minecraft.world.Container container, ScribeGridData gridData, net.minecraft.world.item.ItemStack source)
    Handles the safe extraction of an enchantment from a source catalyst without destroying it fully, unless the item is deemed fleeting or completely depleted.
    static boolean
    willConvertOnAppend(int newAmount)
    Determines whether an item should upgrade to an Enchanted Tome based on the active append configuration.
    static boolean
    willConvertOnUpgrade(int newLevel, int vanillaMax)
    Determines whether an item should upgrade to an Enchanted Tome based on the active upgrade configuration.

    Methods inherited from class java.lang.Object

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

    • ScribeRules

      public ScribeRules()
  • Method Details

    • evaluateState

      public static ScribeGameState evaluateState(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack sourceStack, ScribeGridData gridData)
      Evaluates the current state of the source item and the target book on the lectern to determine if a game is permitted to start, or if constraints (max enchantments) are violated.
    • willConvertOnUpgrade

      public static boolean willConvertOnUpgrade(int newLevel, int vanillaMax)
      Determines whether an item should upgrade to an Enchanted Tome based on the active upgrade configuration.
    • willConvertOnAppend

      public static boolean willConvertOnAppend(int newAmount)
      Determines whether an item should upgrade to an Enchanted Tome based on the active append configuration.
    • calculateDifficulty

      public static void calculateDifficulty(net.minecraft.world.item.ItemStack book, ScribeGridData gridData)
      Dynamically calculates the required mine density based on the target book's existing enchantments.
    • calculateCosts

      public static void calculateCosts(ScribeGridData gridData)
      Dynamically calculates the required lapis and XP to process the enchantment binding.
    • isProcessedAtStart

      public static boolean isProcessedAtStart(net.minecraft.world.item.ItemStack source)
      Validates whether a source item should be prematurely processed at the start of a Scribe game.
    • processSourceInPlace

      public static void processSourceInPlace(net.minecraft.world.level.Level level, net.minecraft.world.Container container, ScribeGridData gridData, net.minecraft.world.item.ItemStack source)
      Handles the safe extraction of an enchantment from a source catalyst without destroying it fully, unless the item is deemed fleeting or completely depleted.