From 45171f086413936099a2335ca32dbdc129cf640e Mon Sep 17 00:00:00 2001 From: BlackHole Date: Sat, 5 Mar 2016 20:58:48 +0100 Subject: [PATCH] SPIGOT-1772: Use correct statistics for entities --- src/main/java/org/bukkit/craftbukkit/CraftStatistic.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java b/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java index 905cebe9d3..9b92cb6db5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java @@ -126,10 +126,15 @@ public class CraftStatistic { } public static net.minecraft.server.Statistic getEntityStatistic(org.bukkit.Statistic stat, EntityType entity) { - MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.eggInfo.get(Integer.valueOf(entity.getTypeId())); + MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.eggInfo.get(entity.getName()); if (monsteregginfo != null) { - return monsteregginfo.killEntityStatistic; + if (stat == org.bukkit.Statistic.KILL_ENTITY) { + return monsteregginfo.killEntityStatistic; + } + if (stat == org.bukkit.Statistic.ENTITY_KILLED_BY) { + return monsteregginfo.e; // PAIL: rename + } } return null; }