Class EnchantmentUtils
java.lang.Object
me.desht.pneumaticcraft.common.util.EnchantmentUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAllBooks(net.minecraft.world.item.enchantment.Enchantment enchantment, List<net.minecraft.world.item.ItemStack> items) static voidaddPlayerXP(net.minecraft.world.entity.player.Player player, int amount) static floatgetEnchantPower(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) static intgetExperienceForLevel(int level) static intgetLevelForExperience(int targetXp) static intgetPlayerXP(net.minecraft.world.entity.player.Player player) Be warned, minecraft doesn't update experienceTotal properly, so we have to do this.static floatgetPower(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos position) static intgetXpToNextLevel(int level) static intxpBarCap(int level)
-
Constructor Details
-
EnchantmentUtils
public EnchantmentUtils()
-
-
Method Details
-
getPlayerXP
public static int getPlayerXP(net.minecraft.world.entity.player.Player player) Be warned, minecraft doesn't update experienceTotal properly, so we have to do this.- Parameters:
player- the player- Returns:
- player's current XP amount
-
addPlayerXP
public static void addPlayerXP(net.minecraft.world.entity.player.Player player, int amount) -
xpBarCap
public static int xpBarCap(int level) -
getExperienceForLevel
public static int getExperienceForLevel(int level) -
getXpToNextLevel
public static int getXpToNextLevel(int level) -
getLevelForExperience
public static int getLevelForExperience(int targetXp) -
getPower
public static float getPower(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos position) -
getEnchantPower
public static float getEnchantPower(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) -
addAllBooks
public static void addAllBooks(net.minecraft.world.item.enchantment.Enchantment enchantment, List<net.minecraft.world.item.ItemStack> items)
-