From a6f3581d24c7276d1817d6ca0120a244cfdc2d39 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 23 Dec 2016 15:33:45 +0100 Subject: [PATCH] Fix spawner changer not working with some mobs Closes #517 --- .../mod/items/ItemSpawnerChanger.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java index ca92de781..47fc877da 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java @@ -118,16 +118,19 @@ public class ItemSpawnerChanger extends ItemBase{ } if(!(entity instanceof EntityPlayer) && entity.isNonBoss()){ - String entityName = EntityList.getEntityString(entity); - if(entityName != null && !entityName.isEmpty()){ - for(String name : ConfigStringListValues.SPAWNER_CHANGER_BLACKLIST.getValue()){ - if(entityName.equals(name)){ - return false; + ResourceLocation entityLoc = EntityList.getKey(entity.getClass()); + if(entityLoc != null){ + String entityName = entityLoc.toString(); + if(entityName != null && !entityName.isEmpty()){ + for(String name : ConfigStringListValues.SPAWNER_CHANGER_BLACKLIST.getValue()){ + if(entityName.equals(name)){ + return false; + } } - } - stack.getTagCompound().setString("Entity", entityName); - return true; + stack.getTagCompound().setString("Entity", entityName); + return true; + } } } return false;