java.lang.Object
de.cheaterpaul.enchantmentmachine.util.Utils

public class Utils extends Object
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • genLangKey

      public static String genLangKey(String type, String key)
    • genTranslation

      public static net.minecraft.network.chat.Component genTranslation(String type, String key)
    • tryApplyEnchantment

      public static int tryApplyEnchantment(EnchantmentInstanceMod enchInst, net.minecraft.world.item.enchantment.ItemEnchantments.Mutable existingEnchantments, boolean reducedPrice)
      Tries to combine the given enchantment instance into the mutable enchantment instance. Returns the enchantment cost.
      Parameters:
      enchInst - toApply
      existingEnchantments - mutable copy of the exiting enchantments
      reducedPrice - use reduced price (vanilla does this when enchantment comes from a book and not when combining items)
      Returns:
      -1 if incompatible