From 8cb836d5b3ae3d9e780a082285fad9655c5c2f04 Mon Sep 17 00:00:00 2001 From: CoderTim Date: Fri, 19 Sep 2014 02:46:04 -0400 Subject: [PATCH] Fixed some achievement bugs --- .../arcade/stats/BridgesSniperStatTracker.java | 10 ++++------ .../arcade/stats/DeathBomberStatTracker.java | 3 +-- .../arcade/stats/TheLongestShotStatTracker.java | 16 ++-------------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/BridgesSniperStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/BridgesSniperStatTracker.java index 6abe48543..7b10cb9b1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/BridgesSniperStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/BridgesSniperStatTracker.java @@ -44,12 +44,10 @@ public class BridgesSniperStatTracker extends StatTracker if (player == null) return; - if (player.getLastDamageCause() instanceof EntityDamageByEntityEvent) - { - EntityDamageByEntityEvent edbee = (EntityDamageByEntityEvent) player.getLastDamageCause(); + if (player == killer) + return; - if (edbee.getDamager() instanceof Arrow) - addStat(killer, "Sniper", 1, true, false); - } + if ("Archery".equals(event.GetLog().GetLastDamager().GetLastDamageSource())) + addStat(killer, "Sniper", 1, true, false); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/DeathBomberStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/DeathBomberStatTracker.java index fa456b1c8..8a1cf30fc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/DeathBomberStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/DeathBomberStatTracker.java @@ -48,8 +48,7 @@ public class DeathBomberStatTracker extends StatTracker if (player == null) return; - if (player.getLastDamageCause().getCause() == EntityDamageEvent.DamageCause.BLOCK_EXPLOSION - || player.getLastDamageCause().getCause() == EntityDamageEvent.DamageCause.ENTITY_EXPLOSION) + if ("Explosion".equals(event.GetLog().GetLastDamager().GetLastDamageSource())) { Integer count = _killCount.get(killer.getUniqueId()); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/TheLongestShotStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/TheLongestShotStatTracker.java index 2727b4564..8edaaac79 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/TheLongestShotStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/TheLongestShotStatTracker.java @@ -1,10 +1,8 @@ package nautilus.game.arcade.stats; -import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.entity.EntityDamageByEntityEvent; import mineplex.core.common.util.UtilPlayer; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; @@ -45,18 +43,8 @@ public class TheLongestShotStatTracker extends StatTracker if (event.GetLog().GetLastDamager().GetReason() != null && event.GetLog().GetLastDamager().GetReason().contains("Longshot")) { - if (player.getLastDamageCause() instanceof EntityDamageByEntityEvent) - { - EntityDamageByEntityEvent edbee = (EntityDamageByEntityEvent) player.getLastDamageCause(); - - if (edbee.getDamager() instanceof Arrow) - { - Arrow arrow = (Arrow) edbee.getDamager(); - - if (arrow.getShooter() == killer && killer.getLocation().distanceSquared(player.getLocation()) >= 64 * 64) - addStat(killer, "TheLongestShot", 1, false, false); - } - } + if (killer.getLocation().distanceSquared(player.getLocation()) >= 64 * 64) + addStat(killer, "TheLongestShot", 1, false, false); } } }