Interface IMagicHelper
public interface IMagicHelper
Interface for magic related helper methods.
-
Method Summary
Modifier and TypeMethodDescriptionvoidawardLevel(net.minecraft.world.entity.player.Player player, int levels) Awards the given amount of magic levels to the given player.voidawardXp(net.minecraft.world.entity.player.Player player, float amount) Awards the given amount of magic xp to the given player.intgetLevel(net.minecraft.world.entity.player.Player player) floatgetXp(net.minecraft.world.entity.player.Player player) floatgetXpForNextLevel(int level) booleanknowsMagic(net.minecraft.world.entity.player.Player player) voidsetLevel(net.minecraft.world.entity.player.Player player, int level) Sets the given magic level for the given player.voidsetXp(net.minecraft.world.entity.player.Player player, float amount) Sets the given amount of magic xp for the given player.
-
Method Details
-
getLevel
int getLevel(net.minecraft.world.entity.player.Player player) - Parameters:
player- The player to get the magic level for.- Returns:
- The magic level of the given player.
-
getXp
float getXp(net.minecraft.world.entity.player.Player player) - Parameters:
player- The player to get the magic xp for.- Returns:
- The magic xp of the given player.
-
getXpForNextLevel
float getXpForNextLevel(int level) - Parameters:
level- The current magic level.- Returns:
- The magic xp required to level from the given level to the next magic level.
-
awardXp
void awardXp(net.minecraft.world.entity.player.Player player, float amount) Awards the given amount of magic xp to the given player. Also handles leveling.- Parameters:
player- The player to award the magic xp to.amount- The amount of magic xp to award.
-
setXp
void setXp(net.minecraft.world.entity.player.Player player, float amount) Sets the given amount of magic xp for the given player. Also handles leveling.- Parameters:
player- The player to set the magic xp for.amount- The amount of magic xp to set.
-
awardLevel
void awardLevel(net.minecraft.world.entity.player.Player player, int levels) Awards the given amount of magic levels to the given player. Also handles leveling.- Parameters:
player- The player to award the magic levels to.levels- The amount of magic levels to award.
-
setLevel
void setLevel(net.minecraft.world.entity.player.Player player, int level) Sets the given magic level for the given player. Also handles leveling.- Parameters:
player- The player to set the magic level for.level- The magic level to set.
-
knowsMagic
boolean knowsMagic(net.minecraft.world.entity.player.Player player) - Parameters:
player- The player to check.- Returns:
- True if the player knows magic, false otherwise.
-