public final class EnchantmentUtils
extends java.lang.Object
| Constructor and Description |
|---|
EnchantmentUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areEnchantmentsCompatible(net.minecraft.enchantment.Enchantment firstEnchantment,
net.minecraft.enchantment.Enchantment secondEnchantment)
Checks if two enchantments are compatible with each other.
|
static net.minecraft.enchantment.Enchantment[] |
getEnchantmentsFromStack(net.minecraft.item.ItemStack stack,
boolean stored)
Retrieves an array of all the enchantments placed on an ItemStack.
|
static int |
getExperienceFromLevel(int level)
Calculates how many experience points are it would take to get to the specified level.
|
static int |
getExperienceToLevel(int startingLevel,
int destinationLevel)
Calculate the amount of experience to go from one level to another.
|
static int |
getLevelsFromExperience(int exp)
Calculates the amount of levels that an amount of EXP is equal to.
|
static boolean |
isItemEnchantable(net.minecraft.item.ItemStack itemStack)
A check to see if an ItemStack can be enchanted.
|
static boolean |
isStackEnchanted(net.minecraft.item.ItemStack stack)
Checks to see if an ItemStack has any enchantments written to it.
|
public static boolean isItemEnchantable(net.minecraft.item.ItemStack itemStack)
itemStack: - The ItemStack to check.public static int getExperienceFromLevel(int level)
level: - The level to calculate for.public static int getExperienceToLevel(int startingLevel,
int destinationLevel)
startingLevel: - The level you are currently at.destinationLevel: - The level you want to go to.public static int getLevelsFromExperience(int exp)
exp: - The amount of EXP to solve for.public static boolean areEnchantmentsCompatible(net.minecraft.enchantment.Enchantment firstEnchantment,
net.minecraft.enchantment.Enchantment secondEnchantment)
firstEnchantment: - The first Enchantment to check.secondEnchantment: - The second Enchantment to check.public static boolean isStackEnchanted(net.minecraft.item.ItemStack stack)
stack: - The ItemStack to check for enchantments.public static net.minecraft.enchantment.Enchantment[] getEnchantmentsFromStack(net.minecraft.item.ItemStack stack,
boolean stored)
stack: - The ItemStack you wish to read the enchantments from.stored: - Whether or not the stored enchantments should be read. Stored
enchantments are those which do not give the ItemStack special abilities. For
example, enchanted books.