Integrated Dynamics

Integrated Dynamics

63M Downloads

Add operators to deal with enchantments.

DasBrain opened this issue · 2 comments

commented

Issue type:

Only keep the issue types that are applicable.

  • ➕ Feature request

Currently, we only have an enchantable and an enchanted operator.

I'd like to propose a new Type (Enchantment) with some operators:

  • Enchantment :: String -> Integer -> Enchantment
    the constructor
  • enchantments :: Item -> [Enchantment]
    returns a list of all Enchantments
  • enchantment.name() :: Enchantment -> String
    returns the name of the enchantment
  • enchantment.level() :: Enchantment -> Integer
    returns the level of the enchantment.
  • enchantment.maxLevel() :: Enchantment -> Integer
    returns the maximum level of this enchantment type.
  • enchantment.isTreasure() :: Enchantment -> Boolean
    returns if the enchantment is a "treasure" enchantment like Mending, Frost Walker, Curse of Vanishing.
  • enchantment.isCurse() :: Enchantment -> Boolean
    returns if the enchantment is a curse.
  • enchantment.isCompatible() :: Enchantment -> Enchantment -> Boolean
    returns if an enchantment is compatible with the other (e.g. false for Silk Touch and Fortune)

Maybe add also some helper operators:

  • enchantment.isMaxLevel() :: Enchantment -> Boolean
    returns true if the enchantment is at it's max level (or higher).
  • enchantment.getMinModifiedEnchantmentLevel() :: Enchantment -> Integer
    returns the minimum modified enchantment level.
  • enchantment.getMaxModifiedEnchantmentLevel() :: Enchantment -> Integer
    returns the maximum modified enchantment level.

Thank you for considering my suggestion.

commented

Maybe even add a new Aspect to the Extra Dimensional Rader: Available Enchantments?

commented

Good support for enchantments is indeed something I want to implement at some point. Doing this by creating a new value type for enchantments is indeed a good idea.