Class ScribeRules
java.lang.Object
johnsmith.enchantingoverhauled.menu.scribe.controller.ScribeRules
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcalculateCosts(ScribeGridData gridData) Dynamically calculates the required lapis and XP to process the enchantment binding.static voidcalculateDifficulty(net.minecraft.world.item.ItemStack book, ScribeGridData gridData) Dynamically calculates the required mine density based on the target book's existing enchantments.static ScribeGameStateevaluateState(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 booleanisProcessedAtStart(net.minecraft.world.item.ItemStack source) Validates whether a source item should be prematurely processed at the start of a Scribe game.static voidprocessSourceInPlace(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 booleanwillConvertOnAppend(int newAmount) Determines whether an item should upgrade to an Enchanted Tome based on the active append configuration.static booleanwillConvertOnUpgrade(int newLevel, int vanillaMax) Determines whether an item should upgrade to an Enchanted Tome based on the active upgrade configuration.
-
Constructor Details
-
ScribeRules
public ScribeRules()
-
-
Method Details
-
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. -
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.