Search in sources :

Example 1 with IEnchantment

use of crafttweaker.api.enchantments.IEnchantment in project GregTech by GregTechCE.

the class SolidMaterial method ctAddEnchantmentForTools.

@ZenMethod("addToolEnchantment")
@Method(modid = GTValues.MODID_CT)
public void ctAddEnchantmentForTools(IEnchantment enchantment) {
    Enchantment enchantmentType = (Enchantment) enchantment.getDefinition().getInternal();
    toolEnchantments.add(new EnchantmentData(enchantmentType, enchantment.getLevel()));
}
Also used : Enchantment(net.minecraft.enchantment.Enchantment) IEnchantment(crafttweaker.api.enchantments.IEnchantment) EnchantmentData(gregtech.api.enchants.EnchantmentData) ZenMethod(stanhebben.zenscript.annotations.ZenMethod) Method(net.minecraftforge.fml.common.Optional.Method) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Aggregations

IEnchantment (crafttweaker.api.enchantments.IEnchantment)1 EnchantmentData (gregtech.api.enchants.EnchantmentData)1 Enchantment (net.minecraft.enchantment.Enchantment)1 Method (net.minecraftforge.fml.common.Optional.Method)1 ZenMethod (stanhebben.zenscript.annotations.ZenMethod)1