forked from wugin3643/MineMineNoMi3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainEnchantment.java
50 lines (41 loc) · 923 Bytes
/
MainEnchantment.java
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
48
49
50
package MineMineNoMi3;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnumEnchantmentType;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
public class MainEnchantment extends Enchantment
{
int max;
public MainEnchantment(int par1, int par2, EnumEnchantmentType par3, String par4, int par5)
{
super(par1, par2, par3);
setName(par4);
this.max = par5;
}
public int getMinEnchantability(int par1)
{
return 10 + 20 * (par1 - 1);
}
public int getMaxEnchantability(int par1)
{
return super.getMinEnchantability(par1) + 50;
}
public int getMaxLevel()
{
return this.max;
}
public boolean canApply(ItemStack stack)
{
if ((stack.getItem() instanceof ItemSword))
return true;
return false;
}
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
public boolean isAllowedOnBooks()
{
return false;
}
}