diff --git a/Changelog.txt b/Changelog.txt
index 82235738a..7a55120e9 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -7,6 +7,9 @@ Key:
! Change
- Removal
+Version 2.1.28
+ Fixed a bug where Archery could not gain XP
+
Version 2.1.27
Fixed an exploit that allowed players to duplicate torches, and rails
diff --git a/pom.xml b/pom.xml
index 8e40134d4..bd73668a6 100755
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
4.0.0
com.gmail.nossr50.mcMMO
mcMMO
- 2.1.27
+ 2.1.28
mcMMO
https://github.com/mcMMO-Dev/mcMMO
diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java
index ae6910fee..c13a6cdee 100644
--- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java
+++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java
@@ -22,6 +22,7 @@ import com.gmail.nossr50.util.*;
import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableMap;
+import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.*;
@@ -240,7 +241,37 @@ public final class CombatUtils {
* @param event The event to run the combat checks on.
*/
public static void processCombatAttack(EntityDamageByEntityEvent event, Entity attacker, LivingEntity target) {
- EntityType entityType = attacker.getType();
+ Entity damager = event.getDamager();
+ EntityType entityType = damager.getType();
+
+ if (target instanceof Player) {
+ if (Misc.isNPCEntity(target)) {
+ return;
+ }
+
+ Player player = (Player) target;
+ if (!UserManager.hasPlayerDataKey(player)) {
+ return;
+ }
+ McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
+ AcrobaticsManager acrobaticsManager = mcMMOPlayer.getAcrobaticsManager();
+
+ if (acrobaticsManager.canDodge(target)) {
+ event.setDamage(acrobaticsManager.dodgeCheck(event.getDamage()));
+ }
+
+ if (ItemUtils.isSword(player.getInventory().getItemInMainHand())) {
+ if (!PrimarySkillType.SWORDS.shouldProcess(target)) {
+ return;
+ }
+
+ SwordsManager swordsManager = mcMMOPlayer.getSwordsManager();
+
+ if (swordsManager.canUseCounterAttack(damager)) {
+ swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage());
+ }
+ }
+ }
if (attacker instanceof Player && entityType == EntityType.PLAYER) {
Player player = (Player) attacker;
@@ -297,7 +328,7 @@ public final class CombatUtils {
}
else if (entityType == EntityType.WOLF) {
- Wolf wolf = (Wolf) attacker;
+ Wolf wolf = (Wolf) damager;
AnimalTamer tamer = wolf.getOwner();
if (tamer != null && tamer instanceof Player && PrimarySkillType.TAMING.shouldProcess(target)) {
@@ -309,7 +340,7 @@ public final class CombatUtils {
}
}
else if (entityType == EntityType.ARROW) {
- Arrow arrow = (Arrow) attacker;
+ Arrow arrow = (Arrow) damager;
ProjectileSource projectileSource = arrow.getShooter();
if (projectileSource != null && projectileSource instanceof Player && PrimarySkillType.ARCHERY.shouldProcess(target)) {
@@ -326,35 +357,6 @@ public final class CombatUtils {
}
}
}
-
- if (target instanceof Player) {
- if (Misc.isNPCEntity(target)) {
- return;
- }
-
- Player player = (Player) target;
- if (!UserManager.hasPlayerDataKey(player)) {
- return;
- }
- McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
- AcrobaticsManager acrobaticsManager = mcMMOPlayer.getAcrobaticsManager();
-
- if (acrobaticsManager.canDodge(target)) {
- event.setDamage(acrobaticsManager.dodgeCheck(event.getDamage()));
- }
-
- if (ItemUtils.isSword(player.getInventory().getItemInMainHand())) {
- if (!PrimarySkillType.SWORDS.shouldProcess(target)) {
- return;
- }
-
- SwordsManager swordsManager = mcMMOPlayer.getSwordsManager();
-
- if (swordsManager.canUseCounterAttack(attacker)) {
- swordsManager.counterAttackChecks((LivingEntity) attacker, event.getDamage());
- }
- }
- }
}
public static int getLimitBreakDamage(Player player, SubSkillType subSkillType) {