Fix undead causing chunkloading leading to extensive lag (#8583)

This commit is contained in:
Silver_David authored and GitHub committed 2022-05-03 18:24:13 +01:00
1 parent da82705e86
commit 2fb8b2eb18
1 file changed
+2
@@ -1161,6 +1161,8 @@ public class ForgeHooks
public static boolean canEntityDestroy(Level level, BlockPos pos, LivingEntity entity)
{
if (!level.isLoaded(pos))
return false;
BlockState state = level.getBlockState(pos);
return ForgeEventFactory.getMobGriefingEvent(level, entity) && state.canEntityDestroy(level, pos, entity) && ForgeEventFactory.onEntityDestroyBlock(entity, pos, state);
}