Class Utils
java.lang.Object
de.cheaterpaul.enchantmentmachine.util.Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgenLangKey(String type, String key) static net.minecraft.network.chat.ComponentgenTranslation(String type, String key) static inttryApplyEnchantment(EnchantmentInstanceMod enchInst, net.minecraft.world.item.enchantment.ItemEnchantments.Mutable existingEnchantments, boolean reducedPrice) Tries to combine the given enchantment instance into the mutable enchantment instance.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
genLangKey
-
genTranslation
-
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- toApplyexistingEnchantments- mutable copy of the exiting enchantmentsreducedPrice- use reduced price (vanilla does this when enchantment comes from a book and not when combining items)- Returns:
- -1 if incompatible
-