mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fixed a NPE with taming.
This commit is contained in:
parent
36932e397d
commit
5f7f6fc55a
@ -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
|
||||||
|
2
pom.xml
2
pom.xml
@ -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>
|
||||||
|
@ -173,25 +173,34 @@ public final class CombatUtils {
|
|||||||
double initialDamage = event.getDamage();
|
double initialDamage = event.getDamage();
|
||||||
double finalDamage = initialDamage;
|
double finalDamage = initialDamage;
|
||||||
|
|
||||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(master);
|
if(master != null && !master.isOnline() && master.isValid()) {
|
||||||
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(master);
|
||||||
|
|
||||||
if (tamingManager.canUseFastFoodService()) {
|
//Make sure the profiles been loaded
|
||||||
tamingManager.fastFoodService(wolf, event.getDamage());
|
if(mcMMOPlayer == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
|
||||||
|
|
||||||
|
if (tamingManager.canUseFastFoodService()) {
|
||||||
|
tamingManager.fastFoodService(wolf, event.getDamage());
|
||||||
|
}
|
||||||
|
|
||||||
|
tamingManager.pummel(target, wolf);
|
||||||
|
|
||||||
|
if (tamingManager.canUseSharpenedClaws()) {
|
||||||
|
finalDamage+=tamingManager.sharpenedClaws();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tamingManager.canUseGore()) {
|
||||||
|
finalDamage+=tamingManager.gore(target, initialDamage);
|
||||||
|
}
|
||||||
|
|
||||||
|
applyScaledModifiers(initialDamage, finalDamage, event);
|
||||||
|
startGainXp(mcMMOPlayer, target, PrimarySkillType.TAMING);
|
||||||
}
|
}
|
||||||
|
|
||||||
tamingManager.pummel(target, wolf);
|
|
||||||
|
|
||||||
if (tamingManager.canUseSharpenedClaws()) {
|
|
||||||
finalDamage+=tamingManager.sharpenedClaws();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tamingManager.canUseGore()) {
|
|
||||||
finalDamage+=tamingManager.gore(target, initialDamage);
|
|
||||||
}
|
|
||||||
|
|
||||||
applyScaledModifiers(initialDamage, finalDamage, event);
|
|
||||||
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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user