Search in sources :

Example 1 with IMaterialModifierType

use of net.silentchaos512.gear.api.material.modifier.IMaterialModifierType in project Silent-Gear by SilentChaos512.

the class AbstractMaterial method removeEnhancements.

public static IMaterialInstance removeEnhancements(IMaterialInstance material) {
    ItemStack stack = material.getItem().copy();
    for (IMaterialModifierType modifierType : MaterialModifiers.getTypes()) {
        modifierType.removeModifier(stack);
    }
    EnchantmentHelper.setEnchantments(Collections.emptyMap(), stack);
    IMaterial iMaterial = material.get();
    if (iMaterial != null) {
        return MaterialInstance.of(iMaterial, stack);
    } else {
        return material;
    }
}
Also used : IMaterialModifierType(net.silentchaos512.gear.api.material.modifier.IMaterialModifierType) ItemStack(net.minecraft.world.item.ItemStack)

Aggregations

ItemStack (net.minecraft.world.item.ItemStack)1 IMaterialModifierType (net.silentchaos512.gear.api.material.modifier.IMaterialModifierType)1