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 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 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 Updated Limit Break locale strings

View File

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

View File

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