public class EnchantmentProtection extends Enchantment
Modifier and Type | Field and Description |
---|---|
private static int[] |
baseEnchantability
Holds the base factor of enchantability needed to be able to use the enchant.
|
private static int[] |
levelEnchantability
Holds how much each level increased the enchantability factor to be able to use this enchant.
|
private static java.lang.String[] |
protectionName
Holds the name to be translated of each protection type.
|
int |
protectionType
Defines the type of protection of the enchantment, 0 = all, 1 = fire, 2 = fall (feather fall), 3 = explosion and
4 = projectile.
|
private static int[] |
thresholdEnchantability
Used on the formula of base enchantability, this is the 'window' factor of values to be able to use thing
enchant.
|
aquaAffinity, baneOfArthropods, blastProtection, depthStrider, effectId, efficiency, enchantmentsBookList, featherFalling, fireAspect, fireProtection, flame, fortune, infinity, knockback, looting, luckOfTheSea, lure, name, power, projectileProtection, protection, punch, respiration, sharpness, silkTouch, smite, thorns, type, unbreaking
Constructor and Description |
---|
EnchantmentProtection(int p_i45765_1_,
ResourceLocation p_i45765_2_,
int p_i45765_3_,
int p_i45765_4_) |
Modifier and Type | Method and Description |
---|---|
int |
calcModifierDamage(int level,
DamageSource source)
Calculates the damage protection of the enchantment based on level and damage source passed.
|
boolean |
canApplyTogether(Enchantment ench)
Determines if the enchantment passed can be applyied together with this enchantment.
|
static double |
func_92092_a(Entity p_92092_0_,
double p_92092_1_) |
static int |
getFireTimeForEntity(Entity p_92093_0_,
int p_92093_1_)
Gets the amount of ticks an entity should be set fire, adjusted for fire protection.
|
int |
getMaxEnchantability(int enchantmentLevel)
Returns the maximum value of enchantability nedded on the enchantment level passed.
|
int |
getMaxLevel()
Returns the maximum level that the enchantment can have.
|
int |
getMinEnchantability(int enchantmentLevel)
Returns the minimal value of enchantability needed on the enchantment level passed.
|
java.lang.String |
getName()
Return the name of key in translation table of this enchantment.
|
calcDamageByCreature, canApply, func_181077_c, getEnchantmentById, getEnchantmentByLocation, getMinLevel, getTranslatedName, getWeight, onEntityDamaged, onUserHurt, setName
private static final java.lang.String[] protectionName
private static final int[] baseEnchantability
private static final int[] levelEnchantability
private static final int[] thresholdEnchantability
public final int protectionType
public EnchantmentProtection(int p_i45765_1_, ResourceLocation p_i45765_2_, int p_i45765_3_, int p_i45765_4_)
public int getMinEnchantability(int enchantmentLevel)
getMinEnchantability
in class Enchantment
public int getMaxEnchantability(int enchantmentLevel)
getMaxEnchantability
in class Enchantment
public int getMaxLevel()
getMaxLevel
in class Enchantment
public int calcModifierDamage(int level, DamageSource source)
calcModifierDamage
in class Enchantment
public java.lang.String getName()
getName
in class Enchantment
public boolean canApplyTogether(Enchantment ench)
canApplyTogether
in class Enchantment
public static int getFireTimeForEntity(Entity p_92093_0_, int p_92093_1_)
public static double func_92092_a(Entity p_92092_0_, double p_92092_1_)