Fixed a NPE with taming.

This commit is contained in:
nossr50 2019-07-10 05:03:33 -07:00
parent 36932e397d
commit 5f7f6fc55a
3 changed files with 29 additions and 17 deletions

View File

@ -1,3 +1,6 @@
Version 2.1.97
Fixed a NPE that could occur if a pet participated in combat and its master's mcMMO data was not available
Version 2.1.96
Added the setting 'Skills.General.LimitBreak.AllowPVE' to advanced.yml to allow Limit Break damage bonus to apply in PVE again, defaults to false
Updated Limit Break locale strings

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.96</version>
<version>2.1.97-SNAPSHOT</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>

View File

@ -173,7 +173,14 @@ public final class CombatUtils {
double initialDamage = event.getDamage();
double finalDamage = initialDamage;
if(master != null && !master.isOnline() && master.isValid()) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(master);
//Make sure the profiles been loaded
if(mcMMOPlayer == null) {
return;
}
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
if (tamingManager.canUseFastFoodService()) {
@ -194,6 +201,8 @@ public final class CombatUtils {
startGainXp(mcMMOPlayer, target, PrimarySkillType.TAMING);
}
}
private static void processArcheryCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event, Arrow arrow) {
double initialDamage = event.getDamage();