Fixed Death Bomber achievement exploit

This commit is contained in:
Sam 2017-03-19 00:01:11 +00:00
parent 18538d918c
commit 05bd93cbdf

View File

@ -1,17 +1,16 @@
package nautilus.game.arcade.stats; package nautilus.game.arcade.stats;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class DeathBomberStatTracker extends StatTracker<Game> public class DeathBomberStatTracker extends StatTracker<Game>
{ {
@ -52,6 +51,11 @@ public class DeathBomberStatTracker extends StatTracker<Game>
if(killer.equals(killed)) if(killer.equals(killed))
return; return;
if (killer.getItemInHand().getType() != Material.TNT)
{
return;
}
if (event.GetLog().GetKiller() != null && event.GetLog().GetKiller().GetReason().contains("Throwing TNT")) if (event.GetLog().GetKiller() != null && event.GetLog().GetKiller().GetReason().contains("Throwing TNT"))
{ {
Integer count = _killCount.get(killer.getUniqueId()); Integer count = _killCount.get(killer.getUniqueId());