EnchantmentDigging .java

net.minecraft.enchantment.EnchantmentDigging (class, 47 lines): members: canApply, getMaxEnchantability, getMinEnchantability, getMaxLevel. imports: Items.

net.minecraft.enchantmentclass47 linescommonextends Enchantment1.2 KB

API Surface (4)

int getMinEnchantability(int enchantmentLevel)
int getMaxEnchantability(int enchantmentLevel)
int getMaxLevel()
boolean canApply(ItemStack stack)

String literals (1)

"digging"

Code Graph: Dependencies (4)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

EnchantmentDigging.java47 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.enchantment;
2
3
import net.minecraft.init.Items;
4
import net.minecraft.item.ItemStack;
5
import net.minecraft.util.ResourceLocation;
6
7
public class EnchantmentDigging extends Enchantment
8
{
9
    protected EnchantmentDigging(int enchID, ResourceLocation enchName, int enchWeight)
10
    {
11
        super(enchID, enchName, enchWeight, EnumEnchantmentType.DIGGER);
12
        this.setName("digging");
13
    }
14
15
    /**
16
     * Returns the minimal value of enchantability needed on the enchantment level passed.
17
     */
18
    public int getMinEnchantability(int enchantmentLevel)
19
    {
20
        return 1 + 10 * (enchantmentLevel - 1);
21
    }
22
23
    /**
24
     * Returns the maximum value of enchantability nedded on the enchantment level passed.
25
     */
26
    public int getMaxEnchantability(int enchantmentLevel)
27
    {
28
        return super.getMinEnchantability(enchantmentLevel) + 50;
29
    }
30
31
    /**
32
     * Returns the maximum level that the enchantment can have.
33
     */
34
    public int getMaxLevel()
35
    {
36
        return 5;
37
    }
38
39
    /**
40
     * Determines if this enchantment can be applied to a specific ItemStack.
41
     */
42
    public boolean canApply(ItemStack stack)
43
    {
44
        return stack.getItem() == Items.shears ? true : super.canApply(stack);
45
    }
46
}
47

Deobfuscated MCP 1.8.9 source of EnchantmentDigging from Marcelektro/MavenMCP-1.8.9 (net/minecraft/enchantment/EnchantmentDigging.java), stored verbatim.