Add ExperienceAPI::addCombatXP

This commit is contained in:
nossr50
2020-05-05 19:45:56 -07:00
parent 15e4dbfd92
commit fe2b7a8d61
3 changed files with 48 additions and 8 deletions

View File

@ -12,7 +12,9 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.child.FamilyTree;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.CombatUtils;
import org.bukkit.block.BlockState;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import java.util.ArrayList;
@ -35,6 +37,35 @@ public final class ExperienceAPI {
return PrimarySkillType.getSkill(skillType) != null;
}
/**
* Start the task that gives combat XP.
* Processes combat XP like mcMMO normally would, so mcMMO will check whether or not the entity should reward XP when giving out the XP
*
* @param mcMMOPlayer The attacking player
* @param target The defending entity
* @param primarySkillType The skill being used
* @param multiplier final XP result will be multiplied by this
* @deprecated Draft API
*/
@Deprecated
public static void addCombatXP(McMMOPlayer mcMMOPlayer, LivingEntity target, PrimarySkillType primarySkillType, double multiplier) {
CombatUtils.processCombatXP(mcMMOPlayer, target, primarySkillType, multiplier);
}
/**
* Start the task that gives combat XP.
* Processes combat XP like mcMMO normally would, so mcMMO will check whether or not the entity should reward XP when giving out the XP
*
* @param mcMMOPlayer The attacking player
* @param target The defending entity
* @param primarySkillType The skill being used
* @deprecated Draft API
*/
@Deprecated
public static void addCombatXP(McMMOPlayer mcMMOPlayer, LivingEntity target, PrimarySkillType primarySkillType) {
CombatUtils.processCombatXP(mcMMOPlayer, target, primarySkillType);
}
/**
* Returns whether the given skill type string is both valid and not a
* child skill. (Child skills have no XP of their own, and their level is