summaryrefslogtreecommitdiff
path: root/src/main/java/jp/plusplus/fbs/item/enchant/EnchantmentWealth.java
blob: 83b3f4d67e4549794b5ede9c4d06c3245626173a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package jp.plusplus.fbs.item.enchant;

import jp.plusplus.fbs.item.ItemCore;
import jp.plusplus.fbs.item.ItemStaff;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.EnumEnchantmentType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

/**
 * Created by nori on 2016/03/17.
 */
public class EnchantmentWealth extends Enchantment {
    public EnchantmentWealth(int id, int weight) {
        super(id, weight, EnumEnchantmentType.weapon);
        this.setName("fbs.wealth");
    }

    @Override
    public int getMinEnchantability(int p_77321_1_)
    {
        return 15 + (p_77321_1_ - 1) * 9;
    }

    @Override
    public int getMaxEnchantability(int p_77317_1_)
    {
        return super.getMinEnchantability(p_77317_1_) + 50;
    }

    @Override
    public int getMaxLevel()
    {
        return 3;
    }

    public static int getSum(EntityPlayer ep){
        int sum=0;

        if(ep.getCurrentEquippedItem()!=null){
            sum+=EnchantmentHelper.getEnchantmentLevel(ItemCore.eIdWealth, ep.getCurrentEquippedItem());
        }

        return sum;
    }
}