Fix mob-spawners crashing for non-living entities and simply the patch in the process (#3042)

This commit is contained in:
diesieben07 authored and LexManos committed 2016-06-26 16:35:59 -07:00
1 parent 18b2eeef90
commit 4b9bf30fed
2 files changed
+15 -5

No files matched your search

@@ -161,6 +161,19 @@ public class ForgeEventFactory
return event.getResult();
}
public static boolean canEntitySpawnSpawner(EntityLiving entity, World world, float x, float y, float z)
{
Result result = canEntitySpawn(entity, world, x, y, z);
if (result == Result.DEFAULT)
{
return entity.getCanSpawnHere() && entity.isNotColliding(); // vanilla logic
}
else
{
return result == Result.ALLOW;
}
}
public static boolean doSpecialSpawn(EntityLiving entity, World world, float x, float y, float z)
{
return MinecraftForge.EVENT_BUS.post(new LivingSpawnEvent.SpecialSpawn(entity, world, x, y, z));