Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle healthbars even when skills are disabled. Fixes #1194

  • Loading branch information...
commit 30f7521a3ade7f1ded893e5e7819980c93297b33 1 parent 7b3869e
@gmcferrin gmcferrin authored
View
1  Changelog.txt
@@ -21,6 +21,7 @@ Version 1.4.08-dev
+ Added new experience bonus perk 'mcmmo.perks.xp.customboost.<skillname>' multiplies incoming XP by the boost amount defined in the experience config
+ Added Ender Dragon, Wither, and Witch to combat experience multipliers - they do not give XP by default
+ Added support for multiple mod config files, naming can be done as either armor.<modname>.yml or <modname>.armor.yml
+ = Fixed bug where healthbars wouldn't display if skills were disabled
= Fixed bug with Call of The Wild entities despawning
= Fixed bug with updating (very) old user data.
= Fixed bug with checking maximum durability of mod items.
View
1  src/main/java/com/gmail/nossr50/listeners/EntityListener.java
@@ -189,6 +189,7 @@ else if (attacker instanceof Tameable) {
}
CombatUtils.processCombatAttack(event, attacker, target);
+ CombatUtils.handleHealthbars(attacker, target, event.getDamage());
}
/**
View
23 src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java
@@ -298,15 +298,6 @@ else if (entityType == EntityType.ARROW) {
}
}
}
- else if (attacker instanceof Player) {
- Player player = (Player) attacker;
-
- if (Misc.isNPCEntity(player) || Misc.isNPCEntity(target)) {
- return;
- }
-
- MobHealthbarUtils.handleMobHealthbars(player, target, event.getDamage());
- }
}
/**
@@ -614,4 +605,18 @@ else if (mcMMO.getModManager().isCustomTool(inHand)) {
return tier;
}
+
+ public static void handleHealthbars(Entity attacker, LivingEntity target, double damage) {
+ if (!(attacker instanceof Player)) {
+ return;
+ }
+
+ Player player = (Player) attacker;
+
+ if (Misc.isNPCEntity(player) || Misc.isNPCEntity(target)) {
+ return;
+ }
+
+ MobHealthbarUtils.handleMobHealthbars(player, target, damage);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.