Package cn.nukkit.item.enchantment.loot
Class EnchantmentLoot
java.lang.Object
cn.nukkit.item.enchantment.Enchantment
cn.nukkit.item.enchantment.loot.EnchantmentLoot
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
EnchantmentLootDigging
,EnchantmentLootFishing
,EnchantmentLootWeapon
- Author:
- MagicDroidX (Nukkit Project)
-
Nested Class Summary
Nested classes/interfaces inherited from class cn.nukkit.item.enchantment.Enchantment
Enchantment.Rarity
-
Field Summary
Fields inherited from class cn.nukkit.item.enchantment.Enchantment
EMPTY_ARRAY, enchantmentName2IDMap, enchantments, id, ID_BINDING_CURSE, ID_BOW_FLAME, ID_BOW_INFINITY, ID_BOW_KNOCKBACK, ID_BOW_POWER, ID_CROSSBOW_MULTISHOT, ID_CROSSBOW_PIERCING, ID_CROSSBOW_QUICK_CHARGE, ID_DAMAGE_ALL, ID_DAMAGE_ARTHROPODS, ID_DAMAGE_SMITE, ID_DURABILITY, ID_EFFICIENCY, ID_FIRE_ASPECT, ID_FORTUNE_DIGGING, ID_FORTUNE_FISHING, ID_FROST_WALKER, ID_KNOCKBACK, ID_LOOTING, ID_LURE, ID_MENDING, ID_PROTECTION_ALL, ID_PROTECTION_EXPLOSION, ID_PROTECTION_FALL, ID_PROTECTION_FIRE, ID_PROTECTION_PROJECTILE, ID_SILK_TOUCH, ID_SOUL_SPEED, ID_SWIFT_SNEAK, ID_THORNS, ID_TRIDENT_CHANNELING, ID_TRIDENT_IMPALING, ID_TRIDENT_LOYALTY, ID_TRIDENT_RIPTIDE, ID_VANISHING_CURSE, ID_WATER_BREATHING, ID_WATER_WALKER, ID_WATER_WORKER, level, name, NAME_BINDING_CURSE, NAME_BOW_FLAME, NAME_BOW_INFINITY, NAME_BOW_KNOCKBACK, NAME_BOW_POWER, NAME_CROSSBOW_MULTISHOT, NAME_CROSSBOW_PIERCING, NAME_CROSSBOW_QUICK_CHARGE, NAME_DAMAGE_ALL, NAME_DAMAGE_ARTHROPODS, NAME_DAMAGE_SMITE, NAME_DURABILITY, NAME_EFFICIENCY, NAME_FIRE_ASPECT, NAME_FORTUNE_DIGGING, NAME_FORTUNE_FISHING, NAME_FROST_WALKER, NAME_KNOCKBACK, NAME_LOOTING, NAME_LURE, NAME_MENDING, NAME_PROTECTION_ALL, NAME_PROTECTION_EXPLOSION, NAME_PROTECTION_FALL, NAME_PROTECTION_FIRE, NAME_PROTECTION_PROJECTILE, NAME_SILK_TOUCH, NAME_SOUL_SPEED, NAME_SWIFT_SNEAK, NAME_THORNS, NAME_TRIDENT_CHANNELING, NAME_TRIDENT_IMPALING, NAME_TRIDENT_LOYALTY, NAME_TRIDENT_RIPTIDE, NAME_VANISHING_CURSE, NAME_WATER_BREATHING, NAME_WATER_WALKER, NAME_WATER_WORKER, type, words
-
Constructor Summary
ModifierConstructorDescriptionprotected
EnchantmentLoot
(int id, String name, int weight, EnchantmentType type) Deprecated.protected
EnchantmentLoot
(int id, String name, Enchantment.Rarity rarity, EnchantmentType type) -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkCompatibility
(Enchantment enchantment) Checks if this enchantment can be applied to an item that have the give enchantment without doing reverse check.int
getMaxEnchantAbility
(int level) The maximum enchantability for the given level as described in https://minecraft.gamepedia.com/Enchanting/Levelsint
The maximum safe level which is possible with this enchantment.int
getMinEnchantAbility
(int level) The minimum enchantability for the given level as described in https://minecraft.gamepedia.com/Enchanting/LevelsMethods inherited from class cn.nukkit.item.enchantment.Enchantment
canEnchant, clone, doAttack, doPostAttack, doPostHurt, get, getAttackSideEffects, getDamageBonus, getEnchantment, getEnchantment, getEnchantmentName2IDMap, getEnchantments, getId, getLevel, getMaxEnchantableLevel, getMinLevel, getName, getOriginalName, getProtectionFactor, getRandomName, getRarity, getRegisteredEnchantments, getWeight, init, isCompatibleWith, isItemAcceptable, isMajor, setLevel, setLevel
-
Constructor Details
-
EnchantmentLoot
@PowerNukkitOnly("Re-added for backward compatibility") @Deprecated @DeprecationDetails(since="1.4.0.0-PN", by="Cloudburst Nukkit", reason="The signature was changed and it doesn\'t exists anymore in Cloudburst Nukkit", replaceWith="EnchantmentLoot(int id, String name, Rarity rarity, EnchantmentType type)") protected EnchantmentLoot(int id, String name, int weight, EnchantmentType type) Deprecated. -
EnchantmentLoot
@Since("1.4.0.0-PN") protected EnchantmentLoot(int id, String name, Enchantment.Rarity rarity, EnchantmentType type)
-
-
Method Details
-
getMinEnchantAbility
public int getMinEnchantAbility(int level) Description copied from class:Enchantment
The minimum enchantability for the given level as described in https://minecraft.gamepedia.com/Enchanting/Levels- Overrides:
getMinEnchantAbility
in classEnchantment
- Parameters:
level
- The level being checked- Returns:
- The minimum value
-
getMaxEnchantAbility
public int getMaxEnchantAbility(int level) Description copied from class:Enchantment
The maximum enchantability for the given level as described in https://minecraft.gamepedia.com/Enchanting/Levels- Overrides:
getMaxEnchantAbility
in classEnchantment
- Parameters:
level
- The level being checked- Returns:
- The maximum value
-
getMaxLevel
public int getMaxLevel()Description copied from class:Enchantment
The maximum safe level which is possible with this enchantment.- Overrides:
getMaxLevel
in classEnchantment
-
checkCompatibility
Description copied from class:Enchantment
Checks if this enchantment can be applied to an item that have the give enchantment without doing reverse check.- Overrides:
checkCompatibility
in classEnchantment
- Parameters:
enchantment
- The enchantment to be checked- Returns:
- If this enchantment is compatible with the other enchantment.
-