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
|
||||
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
|
||||
|
2
pom.xml
2
pom.xml
@ -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>
|
||||
|
@ -173,25 +173,34 @@ public final class CombatUtils {
|
||||
double initialDamage = event.getDamage();
|
||||
double finalDamage = initialDamage;
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(master);
|
||||
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
|
||||
if(master != null && !master.isOnline() && master.isValid()) {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(master);
|
||||
|
||||
if (tamingManager.canUseFastFoodService()) {
|
||||
tamingManager.fastFoodService(wolf, event.getDamage());
|
||||
//Make sure the profiles been loaded
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user