EnchantmentUntouching .java

net.minecraft.enchantment.EnchantmentUntouching (class): members: canApplyTogether, canApply, getMaxEnchantability, getMinEnchantability, getMaxLevel.

net.minecraft.enchantmentclass55 linescommonextends Enchantment1.5 KB

API Surface (5)

int getMinEnchantability(int enchantmentLevel)
int getMaxEnchantability(int enchantmentLevel)
int getMaxLevel()
boolean canApplyTogether(Enchantment ench)
boolean canApply(ItemStack stack)

String literals (1)

"untouching"

Code Graph: Dependencies (4)

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

Full Source

EnchantmentUntouching.java55 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 EnchantmentUntouching extends Enchantment
8
{
9
    protected EnchantmentUntouching(int p_i45763_1_, ResourceLocation p_i45763_2_, int p_i45763_3_)
10
    {
11
        super(p_i45763_1_, p_i45763_2_, p_i45763_3_, EnumEnchantmentType.DIGGER);
12
        this.setName("untouching");
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 15;
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 1;
37
    }
38
39
    /**
40
     * Determines if the enchantment passed can be applyied together with this enchantment.
41
     */
42
    public boolean canApplyTogether(Enchantment ench)
43
    {
44
        return super.canApplyTogether(ench) && ench.effectId != fortune.effectId;
45
    }
46
47
    /**
48
     * Determines if this enchantment can be applied to a specific ItemStack.
49
     */
50
    public boolean canApply(ItemStack stack)
51
    {
52
        return stack.getItem() == Items.shears ? true : super.canApply(stack);
53
    }
54
}
55

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